Activity 5_Question 3
✓ Published0🌍 Public
A stacked bar chart displays regional product sales across four regions, with each bar segmented by product category. The visualization uses D3 v7’s `d3.stack`, `d3.scaleBand`, `d3.scaleLinear`, and `d3.scaleOrdinal` to render SVG rectangles with color-coded segments per product. Data loads from a CSV file via `d3.csv` with `d3.autoType`, and axes are generated using `d3.axisBottom` and `d3.axisLeft`. A legend maps product names to their ordinal color range, annotating each segment’s contribution.
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