Donut Chart

Les parts d’un tout sous forme d’anneau : un segment par part, le total au centre, une légende avec les valeurs, et des segments à survoler ou à parcourir avec les flèches.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Utilisation

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

Importation

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

Référence de l’API

SoneDonutChartComponentComposant

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

Sélecteur
sone-donut-chart
Inputs
NomType Par défaut
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`