Activity-6_Question-2
✓ Published1🌍 Public
This example shows quarterly sales for three product categories—Electronics, Office Supplies, and Furniture—as a stacked horizontal bar chart. The chart renders with SVG using D3 v7, loading data from a CSV file. The code applies `d3.stack()` to create stacked series, `d3.scaleBand()` for category positioning, and `d3.scaleLinear()` for the value axis. A tooltip appears on mouseover using `d3.select` and event handlers, displaying each segment’s category and sales amount. An ordinal color scale distinguishes the four quarters, with a legend positioned in the chart margins.
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