Skip to main content

<st-bar-chart>

JSON type: BarChart

A vertical bar chart for a fixed set of categories: value labels above the bars, gridlines with labels on the left, and category labels underneath. Heights scale to max, or to the largest bar or tick when max is not set. Values are not formatted here: pass valueLabel and tick labels already formatted (currency, lakh/crore), so this element stays locale-free.

Usage​

import '@sankhyatronics/sankhya-cms/bar-chart'; // registers <st-bar-chart>

Properties​

PropertyAttributeTypeDefaultDescription
bars—BarChartBar[][]The bars, in order from left to right.
ticks—BarChartTick[][]Optional gridlines with labels.
maxmaxnumber | nullnullThe value that maps to the top of the plot. Defaults to the largest bar or tick.
plotHeightplot-heightnumber200Plot height in pixels, excluding category labels.
chartLabelchart-labelstring''Accessible name for the chart.

See the live examples in Storybook.