🌍 Public
Viewing a saved revision (read-only)
ccb7c1f8c48a40f08a261b3cd27d33cf
playground #2
This example shows a donut chart with three randomly sized and colored slices rendered as SVG paths. The code uses React to build the component, while D3 v7 provides the `pie` generator and `arc` generator to compute the angular layout and path geometry. Slice values come from `d3.randomUniform`, and each color is generated as a random hexadecimal string. The chart is centered in a fixed 900 by 600 viewport with an inner radius of 60 and outer radius of 200.
AI-generated descriptionReact Starter code.