Bar Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Simple static & beautifully designed bar charts
Installation
Usage
The bar chart is composible. <BeeBarChart> is the container, and you compose only the parts you need — <Grid>, <XAxis>, <YAxis>, <Legend>, <Tooltip>, and one or more <Bar> — as its children. Each <Bar> carries its own variant, radius, glowing, bufferBar, and isClickable, so a single chart can mix fill styles and make only some series interactive.
import {
BeeBarChart,
Bar,
XAxis,
YAxis,
Grid,
Tooltip,
Legend,
} from "@/components/beecharts/charts/bar-chart";const chartConfig = {
desktop: {
label: "Desktop",
colors: { light: ["#047857"], dark: ["#10b981"] },
},
mobile: {
label: "Mobile",
colors: { light: ["#be123c"], dark: ["#f43f5e"] },
},
} satisfies ChartConfig;
<BeeBarChart data={data} config={chartConfig} xDataKey="month" barRadius={8}>
<Grid />
<XAxis dataKey="month" />
<Legend />
<Tooltip />
<Bar dataKey="desktop" />
<Bar dataKey="mobile" />
</BeeBarChart>Bar, line, and composed basic previews share the same twelve-month desktop / mobile dataset, color tokens, and 8px rounded bar tops (barRadius on the chart root).
Loading State
The bar chart supports loading state with a shimmer animation. You can pass the isLoading prop to the chart to show the loading state while your data is being fetched.
More examples
Below are bar chart examples with different stackType, layout, and <Bar variant /> fills.
Stack types
Bar variants
3D bar
Isometric bars with beveled faces and a highlighted peak — see Bar blocks for the full block.
Histogram
Bin numeric samples with binForHistogram() from Chart recipes, then render with variant="histogram" on <BeeBarChart /> (touching bins, square corners).
Bullet chart
Horizontal range bands plus actual and target markers — use prepareBulletRow() and layout="horizontal".
API Reference
The chart is composed of several parts. The props below are grouped by the component they belong to.
The root container. It owns the data, the shared selection state, the loading skeleton, and the optional brush. Everything visual is composed as its children.
A single bar series. Each <Bar /> is self-contained and generates its own gradient/pattern definitions, so a chart can hold any number of bars — each with its own variant, radius, glow, and clickability.
The category and value axes. Both ship with the chart's flat default styling and forward every Recharts axis prop, so dataKey, tickFormatter, tickMargin, etc. pass straight through. They are hidden automatically while the chart is loading, and each resolves its axis type from the chart layout — categorical or numeric — unless you set type explicitly.
The background grid lines. Defaults to dashed lines aligned to the value axis based on the chart layout, and forwards every Recharts CartesianGrid prop.
The hover tooltip. It reads the chart's selection state so its content dims unselected series.
The series legend. When isClickable is set, each entry toggles selection of its series.