Components
Loading preview...
Here is Bar Chart component
npx shadcn@latest add https://21st.dev/r/bklitai/bar-chart"use client";
import {
BarChart,
Bar,
BarXAxis,
Grid,
ChartTooltip,
PatternLines,
} from "@/components/ui/bar-chart";
const chartData = [
{ month: "Jan", revenue: 4200 },
{ month: "Feb", revenue: 3800 },
{ month: "Mar", revenue: 5100 },
{ month: "Apr", revenue: 4600 },
{ month: "May", revenue: 5400 },
{ month: "Jun", revenue: 6200 },
{ month: "Jul", revenue: 5800 },
{ month: "Aug", revenue: 6800 },
{ month: "Sep", revenue: 6100 },
{ month: "Oct", revenue: 7200 },
{ month: "Nov", revenue: 6900 },
{ month: "Dec", revenue: 7800 },
];
export default function BarChartDemo8() {
return (
<div className="w-full">
<BarChart data={chartData} xDataKey="month">
<PatternLines
height={8}
id="barPattern"
orientation={["diagonal"]}
stroke="var(--chart-1)"
strokeWidth={2}
width={8}
/>
<Grid horizontal />
<Bar
dataKey="revenue"
fill="url(#barPattern)"
lineCap={4}
stroke="var(--chart-1)"
/>
<BarXAxis />
<ChartTooltip />
</BarChart>
</div>
);
}