🌍 Public
Viewing a saved revision (read-only)
853870eeb7cb43d1b7f4eb54b4d91022
Pie Chart with Legend
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 descriptionReact Starter code.