Skip to main content
100%

Assignment7 Pie Chart

✓ Published0🌍 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
MIT Licensed

Similar vizzes