Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Pie Chart

Public visualization

Viewing a saved revision (read-only)

d5ed8e4e57504ddc998dac12578d4a24

Fork of Pie Chart

0 stars0🌍 Public
NNaimisha-M
Last edited Jun 30, 2022
Created on Jun 30, 2022
Forked from Pie Chart

This visualization displays a pie chart comparing the pollution levels across 10 US states, with each slice labeled by its population value and accompanied by a color-coded legend. It uses D3.js (v5) to fetch CSV data from a GitHub gist, then renders the chart as SVG elements. The code employs D3's `pie` layout, `arc` for generating the pie segments, `scaleOrdinal` for assigning categorical colors, and `format` for tick label formatting. A legend group is constructed with rectangles and text elements to identify each state and its corresponding population.

AI-generated description