Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Kumar Danam -pie chart

Public visualization

Kumar Danam -pie chart

0 stars0🌍 Public
KKumar Danam
Last edited Oct 27, 2025
Created on Oct 27, 2025
Forked from ICE 7 pie chart Ar

This example shows the distribution of energy consumption across six sources—Coal, Natural Gas, Hydro, Nuclear, Solar, and Wind—using a pie chart with a color-coded legend and slice labels. The SVG visualization is built with D3 v7, using `d3.pie()` to compute arc angles and `d3.arc()` to generate the slices. Data is loaded from an external CSV file via `d3.csv()`, and a categorical color scale (`d3.scaleOrdinal` with `schemeTableau10`) assigns distinct hues to each energy source. The chart includes a title and a right-aligned legend, with white strokes separating the slices.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed