Skip to main content
100%

Pie Chart with Legend

✓ Published1🌍 Public
Ddldowning
Last edited Mar 26, 2023
Created on Mar 26, 2023
Forked from React Starter

This pie chart visualizes the population of fantasy worlds in millions, using a categorical color scale to distinguish each world. The chart renders an SVG with D3’s `pie` and `arc` generators, while `scaleOrdinal` and `schemeCategory10` assign colors. A legend on the right lists each world and its population, built with appended SVG rectangles and text labels. Data is loaded as CSV from a GitHub gist, formatted via a custom number formatter, and styled with red and blue headings in the HTML.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes