🌍 Public
Viewing a saved revision (read-only)
d86f6b7512d741b9b20683506a92ae96
ic_7 pie chart
This pie chart visualizes the top 10 countries by deaths from air pollution in 2020, using a CSV dataset fetched via D3’s `csv` loader. The chart displays each country’s death count in thousands as labeled slices, with a legend showing country names and values. The code uses `d3.pie` and `d3.arc` to generate the segments, `scaleOrdinal` for the color mapping, and renders all elements as SVG. Text labels are positioned with `arc.centroid`, and the legend is built using manual SVG group transformations.
AI-generated description