🌍 Public
Viewing a saved revision (read-only)
1c102d0343f44bef81800e120cc4b5d5
Activity6_Question2
This stacked bar chart compares the proportional energy sources—coal, natural gas, nuclear, renewables, and other—across six countries using D3 v7’s `d3.stack`, `d3.scaleLinear`, and `d3.scaleBand`. Each bar segment is colored via a `d3.scaleOrdinal` color scale, and a hover tooltip reveals the exact percentage for each energy type. The SVG renders with custom axes and labels, reading the data from a CSV file that specifies each country’s energy mix as fractions.
AI-generated descriptionMIT Licensed