pie chart
✓ Published2🌍 Public
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 descriptionMIT Licensed