Skip to main content
100%

Charan Fork of ICE - 7 Pie Chart

✓ Published1🌍 Public
Ccharanchand9
Last edited Jul 3, 2022
Created on Jul 3, 2022

This example visualizes the top 10 most populated U.S. states as a pie chart, with each slice labeled with its population in thousands and accompanied by a legend showing state names and values. The chart is rendered as an SVG using D3 v5, with data fetched from a CSV hosted on GitHub. It employs D3’s `pie`, `arc`, and `scaleOrdinal` APIs to generate slices and assign colors, and uses `arc.centroid` to position population labels within each segment. The legend is built with appended `rect` and `text` elements.

AI-generated description
MIT Licensed

Similar vizzes