Donut Chart
As partes de um todo como um anel: um segmento por parte, o total no centro, uma legenda com os valores e segmentos que se podem apontar ou percorrer com as setas.
Angular: disponível Vue: disponível React: disponível React Native: disponível
Uso
- Chrome275
- Safari200
- Firefox187
- Edge173
- Other90
| Browser | Visitors | Share |
|---|---|---|
| Chrome | 275 | 30% |
| Safari | 200 | 22% |
| Firefox | 187 | 20% |
| Edge | 173 | 19% |
| Other | 90 | 10% |
<div class="demo-stack" style="align-items: center">
<sone-donut-chart
[segments]="browsers"
label="Visitors"
ariaLabel="Visitors by browser, January to June 2026"
categoryHeader="Browser"
valueHeader="Visitors"
/>
</div>Importação
import {
SoneDonutChartComponent,
} from "@surface-one/angular/donut-chart";Referência da API
SoneDonutChartComponentComponente
`<sone-donut-chart>` — the parts of a whole as a ring (shadcn/ui Pie Chart, donut with text): one segment per part, clockwise from 12 o'clock, the total (or the hovered or focused segment) in the centre and a legend. One Tab stop with a roving focus over the segments (arrow keys, Home/End, Escape returns the centre to the total); each segment is an image named “Chrome: 275 (39%)”, and a visually hidden table carries the data.
| Nome | Tipo | Padrão |
|---|---|---|
segmentsThe parts, clockwise from 12 o'clock; zero and negative values draw nothing. | readonly SoneDonutChartSegment[] | [] |
sizeThe ring's diameter in CSS pixels (it shrinks to fit a narrower container). | number | 200 |
thicknessThe ring's width as a part of its radius: 0.3 by default, 1 draws a pie. | number | 0.3 |
padAngleThe gap between neighbouring segments, in degrees. | number | 1 |
labelThe caption under the centre value. | — | $localize`Total` |
centerValueThe centre value at rest; default: the formatted total. | string | null | null |
legendShows the legend under the ring. | boolean | true |
ariaLabelNames the chart and captions its data table (“Visitors by browser”). | string | "" |
valueFormatFormats values in the centre, the names and the data table. | SoneDonutChartFormat | defaultFormat |
categoryHeaderThe data table's column headers. | — | $localize`Category` |
valueHeader | — | $localize`Value` |
shareHeader | — | $localize`Share` |