About
A composed chart for shadcn/ui that mixes areas, lines, and bars in one plot, with a second y-axis for series on different scales, reference lines, peak markers, and hatched bars for forecast or projected values.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Composed Chart to your project and fits it to your theme.
Code
How Composed Chart is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client"
import { ComposedChart } from "@/components/ui/dashboardcn-composed-chart"
import { formatNumber } from "@/components/ui/dashboardcn-composed-chart"
const data = [
{ region: "NA", air: 420, sea: 1_280 },
{ region: "EU", air: 380, sea: 1_040 },
{ region: "APAC", air: 610, sea: 1_720 },
{ region: "LATAM", air: 140, sea: 460 },
{ region: "MEA", air: 90, sea: 310 },
]
export default function ComposedChartHatchedDemo() {
return (
<ComposedChart
data={data}
xKey="region"
series={[
{ key: "sea", label: "Sea freight", type: "bar" },
{ key: "air", label: "Air freight", type: "bar", pattern: "hatched", color: "var(--chart-4)" },
]}
yFormatter={(v) => `${formatNumber(v)} t`}
showYAxis
showLegend
/>
)
}
















