Stacked Bar

Une barre découpée en parts d’un total, avec piste restante en option, légende et un résumé lu par les lecteurs d’écran.

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

Utilisation

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

Importation

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

Référence de l’API

SoneStackedBarComponentComposant

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

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