Skip to main content
100%

Donut Example

✓ Published1🌍 Public
PPeter Maida
Last edited Oct 28, 2020
Created on Oct 27, 2020

A donut chart displays five randomly generated numeric values as proportional arcs, with each slice labeled by its value in white text. The visualization updates its data on button press or when the data reference changes, demonstrating a React hook-based update pattern. Built with D3 v5 and React, the `Pie` component uses `d3.pie()` for arc generation, `d3.arc()` with configurable inner and outer radii, and a `scaleOrdinal` color scheme. SVG rendering occurs within a React component using `useRef` and `useEffect` hooks to manage the D3 selection lifecycle.

AI-generated description

Animated Pie chart taken from this website.

MIT Licensed

Similar vizzes