Activity 6_Task 2
✓ Published0🌍 Public
This stacked horizontal bar chart shows the percentage breakdown of energy sources—fossil fuels, nuclear, hydroelectric, solar, wind, and other renewables—for eight countries, with each bar segment colored by source and an interactive tooltip revealing exact values. The visualization uses D3 v7's `d3.stack()` to compute layered series, `d3.scaleBand()` and `d3.scaleLinear()` for axes, and `d3.scaleOrdinal()` for color mapping. Data is loaded from `data.csv` and rendered as SVG rectangles, with a custom mouseover tooltip built via D3 selections and a legend generated dynamically from the column headers.
AI-generated descriptionMIT Licensed