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-chart

Usage

import { LineChart } from "@/components/ui/line-chart";

<LineChart labels={months} series={[{ name: "This year", values }, { name: "Last year", values: prev, dashed: true }]} />

API reference

PropTypeDefaultDescription
labelsstring[]requiredX axis labels.
series{ name; values: number[]; color?; dashed? }[]requiredOne or more lines.
curvedbooleantrueSmooth curves or straight segments.
legendbooleantrueShow the legend.
format(n: number) => stringAxis and tooltip format.

View the source on GitHub