Bar Chart

Wykres kolumnowy krótkiej serii z etykietami osi, podpowiedzią przy najechaniu i fokusie, nawigacją strzałkami i ukrytą tabelą danych dla czytników ekranu.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: jeszcze niedostępny

Użycie

Meetings per day, last 30 days
DayMeetings
Sep 100
Sep 111
Sep 120
Sep 132
Sep 143
Sep 151
Sep 160
Sep 170
Sep 182
Sep 194
Sep 203
Sep 211
Sep 220
Sep 230
Sep 241
Sep 252
Sep 265
Sep 273
Sep 282
Sep 290
Sep 300
Oct 11
Oct 23
Oct 34
Oct 42
Oct 51
Oct 60
Oct 70
Oct 82
Oct 93

Import

ts
import {
  SoneBarChartComponent,
} from "@surface-one/angular/bar-chart";

Dokumentacja API

SoneBarChartComponentKomponent

`<sone-bar-chart>` — a column chart for a short series (a day per bar). Bars are HTML boxes, not a stretched SVG: crisp edges and real rounded corners at any width, and hover, focus and tooltip positioning are plain CSS. One Tab stop with a roving focus (Left/Right/Home/End); each bar is an image named by its tooltip, and a visually hidden table carries the data for screen-reader browsing.

Selektor
sone-bar-chart
Wejścia
NazwaTyp Domyślnie
data

The bars, left to right (oldest first for a time series).

readonly T[][]
height

The plot height in CSS pixels (ticks sit below it).

number132
yMax

The top of the value axis; defaults to `niceCeiling(values, 4)`.

number | null | undefinedundefined
tick

The axis label under a bar, or `null` for none; no function, no axis row.

SoneBarChartTick<T> | null | undefinedundefined
tooltip

A bar's tooltip and accessible name; defaults to “label: value”.

SoneBarChartTooltip<T> | null | undefinedundefined
zero

How a zero value draws: a flat stub (`baseline`) or nothing (`gap`).

SoneBarChartZero"baseline"
tone

The bar colour.

SoneChartTone"accent"
ariaLabel

Names the chart and captions its data table (“Meetings per day, last 30 days”).

string""
valueFormat

Formats values in the default tooltip and the data table.

SoneBarChartFormatdefaultFormat
categoryHeader

The data table's category column header.

—$localize`Category`
valueHeader

The data table's value column header.

—$localize`Value`