Activity6_Question2
✓ Published0🌍 Public
A stacked bar chart displays energy consumption proportions across four sectors—Residential, Commercial, Industrial, and Transportation—from 2016 to 2020, using data from data.csv. The visualization uses d3.scaleBand, d3.scaleLinear, and d3.scaleOrdinal with d3.stack to layer bars, while d3.axisBottom and d3.axisLeft render axes with percentage formatting. An SVG legend maps colors to sectors, and the chart is styled via external CSS.
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