Donut Chart

Die Teile eines Ganzen als Ring: ein Segment pro Teil, die Summe in der Mitte, eine Legende mit den Werten und Segmente, die sich per Zeiger oder mit den Pfeiltasten erkunden lassen.

Verfügbar für
  • Angular: verfügbar
  • Vue: verfügbar
  • React: verfügbar
  • React Native: verfügbar

Verwendung

  • 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";

API-Referenz

SoneDonutChartComponentKomponente

`<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
Inputs
NameTyp Standard
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`