A bar chart for comparisons and distributions, with stacked, horizontal, and grouped variants.
Search for a command to run...
A bar chart for comparisons and distributions, with stacked, horizontal, and grouped variants.
Revenue
Monthly revenue (USD)
Last 6 months
Used for side-by-side comparisons, time-bucketed counts, and distribution breakdowns inside AI-generated analytics responses and dashboard cards.
ChartTooltipContentnpx shadcn@latest add https://ui.heygaia.io/r/bar-chart.jsonimport { BarChart } from "@/components/ui/bar-chart";
const data = [
{ month: "Jan", revenue: 4200 },
{ month: "Feb", revenue: 5100 },
{ month: "Mar", revenue: 4800 },
];
export default function Example() {
return (
<BarChart
data={data}
xKey="month"
yKeys="revenue"
title="Revenue"
description="Monthly revenue"
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| data | Array<Record<string, string | number>> | - | Chart data rows |
| xKey | string | - | Key on each row used for the category axis |
| yKeys | string | string[] | - | One or more numeric keys to plot as bars |
| title | string | - | Card title |
| description | string | - | Card description |
| footer | string | - | Optional footer text |
| colors | string[] | CHART_COLORS | Custom palette for series |
| variant | "default" | "stacked" | "horizontal" | "multiple" | "default" | Layout / grouping mode |