Charts & Stats
v1.0.0Added in 1.0.0
Parts of a whole as a donut or pie, with the total in the middle, a legend with values and shares, and a selectable slice.
The slices sweep in clockwise from the start angle the first time the chart scrolls into view, while the total in the middle counts up. Hover a slice and it lifts, the others dim and the center reads its value, name and share (a pie, or a donut too small for a center, shows a floating readout instead; the folded Other slice lists what is inside it above the chart). Click a slice to select it: it stays lifted and the center keeps its value (click it again, or click the hole, to clear). On a phone, tap a slice to select it (the ring is widened by 12px on each side, so thin rings and slivers are easy to hit), slide a finger along the ring to scrub (the center reads each slice and the one you let go on is selected), tap the hole or outside the ring to clear. Legend rows are buttons: tap or click one to select its slice, hover or focus it to preview the slice in the center. With the keyboard, Tab to the chart: Left / Right (or Up / Down) walk the slices, Home / End jump to the first and last, Enter or Space selects the inspected slice and Escape clears the selection; a live region reads each slice. When the data changes, the slices glide to their new angles. The legend sits beside the chart from a 480px wide container and below it on phones.
npx wingo-ui@latest add donut-chartPro item: the CLI needs a Pro account. See plans
Acme CRM, September 2026, amounts in USD
| Slice | Value | Share |
|---|---|---|
| Direct sales | 48,920 | 38.1% |
| Online store | 36,400 | 28.3% |
| Partners | 22,130 | 17.2% |
| Public tenders | 13,600 | 10.6% |
| Other | 7,400 | 5.8% |
| Total | 128,450 | 100% |
Tap a slice or a legend row to focus it; tap it again or the hole to clear.
selected: none · tooltip: on · sweep: on