Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pie Chart

Public visualization

Viewing a saved revision (read-only)

d2184d031d65455f877f232f2768a42e

Pie Chart

0 stars0🌍 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