Donut Chart

Części całości jako pierścień: jeden segment na część, suma w środku, legenda z wartościami i segmenty, które można wskazać kursorem lub przejść klawiszami strzałek.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

  • Chrome275
  • Safari200
  • Firefox187
  • Edge173
  • Other90
Visitors by browser, January to June 2026
BrowserVisitorsShare
Chrome27530%
Safari20022%
Firefox18720%
Edge17319%
Other9010%

Import

ts
import {
  SoneDonutChartComponent,
} from "@surface-one/angular/donut-chart";

Dokumentacja API

SoneDonutChartComponentKomponent

`<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.

Selektor
sone-donut-chart
Wejścia
NazwaTyp Domyślnie
segments

The parts, clockwise from 12 o'clock; zero and negative values draw nothing.

readonly SoneDonutChartSegment[][]
size

The ring's diameter in CSS pixels (it shrinks to fit a narrower container).

number200
thickness

The ring's width as a part of its radius: 0.3 by default, 1 draws a pie.

number0.3
padAngle

The gap between neighbouring segments, in degrees.

number1
label

The caption under the centre value.

—$localize`Total`
centerValue

The centre value at rest; default: the formatted total.

string | nullnull
legend

Shows the legend under the ring.

booleantrue
ariaLabel

Names the chart and captions its data table (“Visitors by browser”).

string""
valueFormat

Formats values in the centre, the names and the data table.

SoneDonutChartFormatdefaultFormat
categoryHeader

The data table's column headers.

—$localize`Category`
valueHeader—$localize`Value`
shareHeader—$localize`Share`