Skip to main content
100%

Fork of Fork of Pie chart-ice-7

✓ Published1🌍 Public
SSaiipriiya
Last edited Mar 12, 2023
Created on Mar 12, 2023

This example shows a pie chart displaying the top 10 countries by prisoner count, with each slice labeled in thousands (e.g., "1.2K") and a legend pairing country names with their corresponding values. The chart uses D3 v5 to fetch CSV data from a GitHub gist and render SVG paths via `d3.pie` and `d3.arc`, with a `d3.scaleOrdinal` mapping slice colors. Text labels are positioned using `arc.centroid`, while the legend is built from appended rectangles and text elements.

AI-generated description
MIT Licensed

Similar vizzes