Skip to main content
100%

Fork of Pie Chart

✓ Published0🌍 Public
KKarnisrikanth
Last edited Mar 25, 2023
Created on Mar 25, 2023
Forked from Pie Chart

This example displays the total sales figures for the top 10 US states as a pie chart, with each segment sized proportionally to its sales value. The visualization includes a legend showing state names and formatted dollar amounts, and hovering over a segment logs that state’s sales to the console. Built with D3 v5 and React, it uses `d3.csv` to load data from a GitHub gist, `d3.pie` to compute angles, `d3.arc` to generate SVG paths, and `d3.scaleOrdinal` with `schemeCategory10` for colors. The data is sorted descending before rendering.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes