Renewable energy production vs Consumption from 10 Random Countries
✓ Published0🌍 Public
This example visualizes renewable energy production versus consumption for nine countries in 2010 using a diverging stacked bar chart. Each bar shows the ratio of energy consumption to production, with bar segments colored by relative production values using a diverging RdYlGn color scale. The visualization uses D3 v7 to load CSV data, apply scales for positioning and color, and render SVG elements including axes, labels, and a linear gradient legend. The chart filters data to aggregate renewable sources and formats each country's values for comparison.
AI-generated descriptionA demonstration of how to start using D3 version 6.
MIT Licensed