Skip to main content
Public

Share visualization

Loading preview…

ic_7 pie chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

ic_7 pie chart

1
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