4th visualisation
✓ Published1🌍 Public
This visualization shows the composition of electricity generation by country, using stacked bar charts to break down each country’s total energy mix into six sources: coal, biofuel, hydro, nuclear, solar, and wind. The chart uses d3.csv to load data from a GitHub-hosted dataset, then applies d3.stack, d3.scaleBand, and d3.scaleLinear to compute and position the stacked segments. Color-coded bars via d3.scaleOrdinal distinguish the energy types, while interactive tooltips are provided through SVG title elements and axes are generated with d3.axisBottom.
AI-generated descriptionA responsive scatter plot.
MIT Licensed