Bar Chart

短い系列のための縦棒グラフ。目盛りラベル、ホバーとフォーカスで出るツールチップ、矢印キーでの移動、スクリーンリーダー向けの非表示データ表を備えます。

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

使い方

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

インポート

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

API リファレンス

SoneBarChartComponentコンポーネント

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

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