Stacked Bar

1 本のバーを全体の内訳に分割。残りのトラックと凡例をオプションで表示し、スクリーンリーダー向けの要約を生成します。

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

使い方

  • Playback4.2 GB
  • Masters2.8 GB
  • Locked0.6 GB
  • Working9
  • Need attention2
  • Optional3

インポート

ts
import {
  SoneStackedBarComponent,
} from "@surface-one/angular/stacked-bar";

API リファレンス

SoneStackedBarComponentコンポーネント

`<sone-stacked-bar>` — one bar split into the parts of a whole (storage by kind, checks by state). With `max` above the sum, the rest shows as the empty track. The bar is `role="img"` named by a generated summary ("Storage: Playback 4.2 GB (40%), …; 7.6 GB of 20 GB"); `valueLabel` formats the values (bytes, durations), `locale` the numbers and percentages.

セレクター
sone-stacked-bar
入力
名前型 デフォルト
segmentsreadonly SoneStackedBarSegment[][]
max

The whole the parts are measured against; `null` (default) = their sum.

number | nullnull
ariaLabel

What the bar measures ("Storage"); starts the spoken summary.

string | nullnull
showLegendbooleanfalse
sizeSoneStackedBarSize"md"
locale

Locale for numbers and percentages; defaults to the active `$localize` locale.

string | nullnull
valueLabel

Formats one value for the summary and the legend; default: a localized number.

SoneStackedBarValueFn | nullnull
emptyLabel—$localize`:Stacked bar with nothing to show:No data`