Components › Charts
Line chart
Lines with a y axis and legend. Dash a series for targets or last period. Hover or arrow through points.
Installation
npx plankui@latest add line-chartUsage
import { LineChart } from "@/components/ui/line-chart";
<LineChart labels={months} series={[{ name: "This year", values }, { name: "Last year", values: prev, dashed: true }]} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| labels | string[] | required | X axis labels. |
| series | { name; values: number[]; color?; dashed? }[] | required | One or more lines. |
| curved | boolean | true | Smooth curves or straight segments. |
| legend | boolean | true | Show the legend. |
| format | (n: number) => string | Axis and tooltip format. |