Bar Chart
Preview
Revenue by region
Demo data, in thousands of dollars
Install
Add it with your package manager, or copy the source manually.
Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide
Download the release archive to your project root, then install the local file.
Import the shared styles once in your application.
API Reference
BarChart
seriesreadonly LineChartSeries[]Nonnegative values aligned with categories. Missing or negative values leave a gap.
—categoriesreadonly string[]Unique category labels in display order.
—layout?"grouped" | "stacked"—orientation?"vertical" | "horizontal"—sort?"none" | "ascending" | "descending"Order categories by their visible total. Bars glide to their new place when it changes.
—max?numberFixed top of the value axis. Defaults to a rounded value above the tallest bar.
—v-model:activeId?string | nullInspected category, by label.
—defaultActiveId?string | null—@active-change?(id: string | null) => void—v-model:hiddenSeries?readonly string[]Series ids hidden through the legend.
—defaultHiddenSeries?readonly string[]—formatValue?(value: number) => string—formatTick?(value: number) => stringAxis tick labels. Defaults to compact notation (1.2K).
—label?string—labels?Partial<BarChartMessages>Override any built-in string, including the shared `xyChart` ones.
—class?string—@hidden-series-change?(ids: string[]) => void—#default?slotCompose `BarChartPlot`, `BarChartTooltip` and `BarChartLegend`; omit it for the complete chart.
—BarChartLegend
class?string—BarChartPlot
height?numberPlot height in px. Horizontal charts default to 36px per category.
—labelWidth?numberWidth of the category label gutter for horizontal bars, in px.
96showGrid?booleantrueclass?string—BarChartTooltip
class?string—side?"top" | "right" | "bottom" | "left"top#default?BarChartTooltipDataReplaces the default content. Receives the inspected category, its index, its rows and their total.
—Updated