🌍 Public
Viewing a saved revision (read-only)
e303d3423efc441485a68ed61f09ed76
Fork of ICE - 7 Pie Chart
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