Activtiy6-Question2
✓ Published0🌍 Public
This example visualizes the proportional sales distribution across five product categories (Clothing, Electronics, Books, Toys, Furniture, Jewelry) for five different time ranges, using a horizontal stacked bar chart. It imports data from a local `data.csv` file and renders the chart as an SVG with D3 v7, employing `d3.stack()` to aggregate the series and `d3.scaleOrdinal()` for color encoding. Interactive tooltips appear on mouseover, displaying the sales value for each segment, while a legend identifies the time ranges. The axes are labeled “Product Categories” and “Sales,” with the title “Sales by Category of Product” displayed above the plot.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed