Skip to main content
100%

Activity 6_Task 2

✓ Published0🌍 Public
Kkblikitha22@gmail.com
Last edited Mar 31, 2025
Created on Mar 31, 2025
Forked from Hello VizHub

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 description
MIT Licensed

Similar vizzes