Skip to main content
100%

pie chart

✓ Published2🌍 Public
Mmadipadiga.raviteja@gmail.com
Last edited Mar 28, 2024
Created on Mar 28, 2024
Forked from Circles with D3

This pie chart visualizes the top 10 countries by deaths from air pollution in 2022, with each slice’s area proportional to the death count. The chart renders as a circular SVG with labeled slices and a legend listing each country alongside its corresponding death figure. The code uses D3 v5 APIs including `pie()`, `arc()`, and `scaleOrdinal()` to generate and color the slices, while data is loaded from a CSV via the `csv` function. Death values are formatted in thousands (e.g., “150K”) using `format()`, and both slice labels and legend values are positioned using `arcGenerator.centroid()`.

AI-generated description
MIT Licensed

Similar vizzes