Activity-6-Q3
✓ Published0🌍 Public
A stacked horizontal bar chart displays the percentage distribution of five energy sources—Coal, Solar, Wind, Nuclear, Hydro, and Natural Gas—across five categories from below 10% to above 40%. The chart uses d3.stack, d3.scaleOrdinal, d3.scaleBand, and d3.scaleLinear to render SVG rectangles, with tooltips on mouseover showing exact percentages via d3.format. A legend identifies each color-coded energy source. Data comes from the embedded energy_data.csv file.
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