Fork of Fork of ICE - 7 Pie Chart Maanas Katta
✓ Published0🌍 Public
This example shows a pie chart of the top 10 countries by deaths in 2020 attributed to air pollution, with slices labeled in thousands and an accompanying legend listing country names and values. It loads data from a CSV via `d3.csv` and renders the chart using SVG. The chart uses `d3.pie` and `d3.arc` to generate segments, `d3.scaleOrdinal` for slice colors, and custom text elements positioned via `arc.centroid`. Legend items are built with appended rectangles and text, with values formatted using `d3.format`.
AI-generated descriptionMIT Licensed