Activity_6_Question 2.3
✓ Published0🌍 Public
A stacked bar chart displays regional product sales, with each bar segmented by product category (productA, productB, productC) and colored via a categorical scale. The visualization loads CSV data with d3.csv and d3.autoType, then uses d3.stack to compute the stacked series. d3.scaleBand maps regions to x positions, d3.scaleLinear maps sales values to y positions, and d3.axisBottom and d3.axisLeft render the axes. A legend groups color swatches and labels, while the SVG output is generated entirely in d3.v7.
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