Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of ICE - 7 Pie Chart

Public visualization

Viewing a saved revision (read-only)

e303d3423efc441485a68ed61f09ed76

Fork of ICE - 7 Pie Chart

0 stars1🌍 Public
NNaimisha-M
Last edited Jul 1, 2022
Created on Jul 1, 2022

This pie chart displays the top 10 countries by air pollution deaths in 2020, using a colorful segmented circle with each slice labeled in thousands and a legend pairing colors with country names. The code loads CSV data via `d3.csv`, converts death counts to numbers, and renders the chart using `d3.pie` and `d3.arc` to compute segment paths, with `d3.scaleOrdinal` assigning colors. Text labels are positioned using `arc.centroid`, and the legend is built manually with appended `rect` and `text` elements. The SVG canvas is selected with `d3.select`, and the visualization is generated asynchronously through an `async` function.

AI-generated description