Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

ic_7 pie chart

Public visualization

ic_7 pie chart

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed