2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Data

BarChart

Updated: May 14, 2025
View on GitHub
The BarChart component provides a way to display bar charts with interactive features, including hover effects, click events, and custom styling options. It supports various customization options including different chart types, color schemes, and interactive features. barWidth takes a t-shirt token, a pixel number, or "fill" to let the bars consume the whole band with no gap between them. Wider bars read better for a handful of categories; "s" or a number keeps a long series legible. reverseX and reverseY move an axis to the opposite side of the plot — the x axis to the top, the y axis to the right. They reposition the labels; they do not reverse the scale, and the data is untouched. Reach for reverseY when the chart sits at the left edge of a layout and the labels read better on the inside, or when two charts are placed side by side and you want their axes on the outer edges. hover paints the whole band behind the bar on pointer-over, which makes a dense chart easier to read across — the row you are pointing at is the one lighting up, rather than just the bar you happened to hit.
Prop
Type
Default
barWidth
Bar thickness. "fill" removes the gap between bands.
numberxllmsxsfill
l
hover
Highlight the whole band on pointer-over.
booleanfalse
reverseY
Move the y axis to the right.
booleanfalse
reverseX
Move the x axis to the top.
booleanfalse
legend
Legend position and visibility.
LegendConfig{}
error
Render the error state instead of the chart.
booleanfalse
tooltip
Show a tooltip on hover.
booleantrue
grid
Which grid lines to draw.
xybothnone
y
axis
Which axes to label.
xybothnone
both
loading
Render the loading state instead of the chart.
booleanfalse
border
Panel border colour. false removes it.
Colorssurfacetransparentboolean
neutral-alpha-weak
…and every ChartProps propinherited
…and every FlexProps propinherited
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club