Area chart for trends over time, with gradient fills, stacking, and a left-to-right reveal on mount.
npx shadcn@latest add @preskok/area-chartimport { AreaChart } from "@/components/ui/preskok-ui/area-chart"
const data = [
{ month: "January", desktop: 186, mobile: 80 },
{ month: "February", desktop: 305, mobile: 200 },
{ month: "March", desktop: 237, mobile: 120 },
]
const config = {
desktop: { label: "Desktop", color: "var(--chart-1)" },
mobile: { label: "Mobile", color: "var(--chart-2)" },
} as const
export function AreaChartDemo() {
return (
<AreaChart
config={config}
data={data}
dataKey="month"
fillType="gradient"
lineType="monotone"
/>
)
}default, stacked, and percentgradient, solid, or none, with the line drawn along the top edge onlylineType (linear, monotone, natural, step, and more)connectNulls