Donut Chart

全体の内訳をリングで表示します。部分ごとに 1 つのセグメント、中央に合計、値付きの凡例を備え、セグメントはホバーまたは矢印キーで順にたどれます。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

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

インポート

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

API リファレンス

SoneDonutChartComponentコンポーネント

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

セレクター
sone-donut-chart
入力
名前型 デフォルト
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`