Activity_6_Q3
✓ Published0🌍 Public
This example visualizes the distribution of energy generation percentages across five energy sources (Coal, Solar, Wind, Nuclear, Hydro, and Natural Gas) using a stacked horizontal bar chart. It shows the proportional share of each source across five percentage categories, from below 10% to above 40%. The chart uses D3 v7’s `d3.stack()` and `d3.scaleBand()`, with SVG rendering and an ordinal color scale. Hovering over any bar segment highlights it and displays a tooltip with the exact percentage value, formatted via `d3.format()`. Data comes from a locally loaded 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