Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Q2 Dinesh Pie chart D3.js!

Public visualization

Viewing a saved revision (read-only)

10160a18b5b64bb5bc577cd8393bcc8f

Q2 Dinesh Pie chart D3.js!

0 stars0🌍 Public
Ddineshsingiri18@gmail.com
Last edited Oct 27, 2025
Created on Oct 27, 2025

This D3.js pie chart visualizes global energy consumption by source, displaying percentage shares for coal, natural gas, hydroelectric, nuclear, and renewables. It renders SVG slices using `d3.pie` and `d3.arc`, with `d3.scaleOrdinal` and `d3.schemeSet2` for color encoding. Labels positioned via `arc.centroid` show source names and percentages, while a legend on the right uses colored rectangles. Data comes from an external CSV file loaded with `d3.csv`.

AI-generated description