Kumar Danam -pie chart
✓ Published0🌍 Public
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 descriptionMIT Licensed