Skip to main content
100%

Renewable energy production vs Consumption from 10 Random Countries

✓ Published0🌍 Public
Mmandadi1999
Last edited Jul 27, 2023
Created on Jul 27, 2023
Forked from D3 Starter

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 description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes