Stacked Bar

Uma barra dividida nas partes de um total, com trilho restante opcional, legenda e um resumo para leitores de tela.

Disponível em
  • Angular: disponível
  • Vue: disponível
  • React: disponível
  • React Native: disponível

Uso

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

Importação

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

Referência da API

SoneStackedBarComponentComponente

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

Seletor
sone-stacked-bar
Inputs
NomeTipo Padrão
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`