Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of ICE - 7 Pie Chart Maanas Katta

Public visualization

Fork of Fork of ICE - 7 Pie Chart Maanas Katta

0 stars0🌍 Public
Ggayathri
Last edited Mar 27, 2022
Created on Mar 27, 2022

This example visualizes the top 10 countries by deaths from air pollution in 2020 as a pie chart. Each slice is labeled with the death count in thousands, and a legend lists each country with its corresponding value and color. The code loads CSV data from a GitHub gist using `d3.csv`, then computes pie angles with `d3.pie()` and draws SVG paths using `d3.arc()`. Colors are assigned via `d3.scaleOrdinal()`, and text labels are positioned using `arc.centroid()`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed