Data | BarChart
BarChart#
Description#
- Compact, responsive bar chart for time series: days of the week, hours or months.
- Bars are boxes with percentage-based height, not SVG, to respect the design system.
- Accessible as a
figurewith a list of bars, each announced as “name: value”.
Props#
bars(BarChartItem[]) — The chart data. Required.label(string) — Chart name for the screen reader. Required.max(number) — The value that fills the bar. Without this, the highest ofbars. Default:undefined.
BarChartItem#
label(string) — Name below the bar («Mon»). Required.shortLabel(string) — Name when the full one does not fit («M»). Without this, the same aslabel. Default:undefined.value(number) — The bar value. Required.valueLabel(string) — Written value for tooltip and screen reader («4 h 13 min»). Default:undefined.current(boolean) — Marks the current bar (today, this hour) with theui-dataaccent andaria-current. Default:undefined.key(string) — Vue key; without this, thelabel. Default:undefined.
Usage#
| |
Notes#
- Occupies the given width and height, with an 80 px floor.
- Below 16 rem width, each bar shows its
shortLabelinstead oflabel. - A bar with zero value is not drawn; a low-value bar is drawn with a minimum height of 4 %.