Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Assignment7 Pie Chart

Public visualization

Viewing a saved revision (read-only)

4f38faa963af4ff6804bf6c1146154af

Assignment7 Pie Chart

0 stars0🌍 Public
445.saiful@gmail.com
Last edited Mar 30, 2026
Created on Mar 30, 2026
Forked from D3 Starter

This pie chart displays the distribution of energy use across five sources—Petroleum, Natural Gas, Renewables, Coal, and Nuclear—using data from the energy_use.csv file. The visualization loads data with `d3.csv`, calculates the arc paths using `d3.pie` and `d3.arc`, and renders each slice as a `path` element in SVG with an ordinal color scale. A legend on the right side, built with `selectAll` and `append`, maps each colored rectangle to its corresponding energy source.

AI-generated description