Chartsv0.0.2
MobileA2UI

BarChart

Category comparisons, vertical by default or horizontal for ranked lists and long labels. See Charts overview for the loading, empty, events and ref props shared by every chart.

Basic

<BarChart  theme={resolvedTheme}  ariaLabel="Orders by region"  categories={['North', 'South', 'East', 'West']}  series={[{ name: 'Orders', data: [420, 332, 301, 234] }]}  showLegend={false}/>

Horizontal

horizontal moves the category axis to the left — better for ranked categories or long labels.

<BarChart  horizontal  showLegend={false}  ariaLabel="Requests by channel"  categories={['Email', 'Chat', 'Phone', 'Social', 'Portal']}  series={[{ name: 'Requests', data: [1280, 960, 720, 540, 410] }]}/>

Reference lines

referenceLines draws target or threshold lines across the value axis, each with an optional label and colour.

<BarChart  showLegend={false}  ariaLabel="Resolution time by team against target"  categories={['Alpha', 'Bravo', 'Charlie', 'Delta']}  series={[{ name: 'Hours', data: [18, 27, 12, 33] }]}  referenceLines={[    { value: 24, label: 'SLA' },    { value: 16, label: 'Target' },  ]}/>

Props

PropTypeDefaultNotes
categories / series(string | number)[] / Series[]—Category labels and named series of numbers.
horizontalbooleanfalseCategory axis on the left; value axis along the bottom.
stackbooleanfalseStack series into a cumulative total.
dataZoombooleanfalseSlider and drag-to-zoom, bound to the category axis.
referenceLines{ value, label?, color? }[]—Target or threshold lines across the value axis.
valueFormatter(value: number) => string—Format values on the value axis and in tooltips.
colorsstring[]—Override the theme palette; one colour per series.