Skip to main content
100%

Pie Chart

✓ Published0🌍 Public
Hheykrizza
Last edited Aug 22, 2022
Created on Aug 22, 2022

This example shows a pie chart of country-level death counts, with each slice labeled by its value in thousands and accompanied by a color-coded legend. The chart is rendered as SVG using D3 v5, pulling CSV data from a GitHub gist. The code uses `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to compute slice geometry, assign colors, and draw paths, while `d3.select` and `d3.format` handle DOM updates and label formatting. The legend and slice labels are added as SVG text elements, with an outer ring arc generator used only for positioning text at slice centroids.

AI-generated description
MIT Licensed

Similar vizzes