Skip to main content
100%

ic_7 pie chart

✓ Published1🌍 Public
SSaivignesh-9176
Last edited Mar 13, 2023
Created on Mar 13, 2023

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
MIT Licensed

Similar vizzes