Line Chart

A multi series SVG line chart with smooth curves, a dashed hairline grid and dots on the last point of each line, colored from chart tokens. No library.

src/registry/ui/line-chart.tsx/r/line-chart.json

Installation#

bash
npx shadcn@latest add @minidev/line-chart

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/line-chart.json

Usage#

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

export function Example() {
  return (
    <LineChart series={[[10,14,12,20,18,26],[8,9,15,14,21,19]]} />
  )
}

API reference#

LineChart props
PropTypeDefault
seriesnumber[][]SAMPLE_SERIES
classNamestring-
labelstring"Line chart"
gridbooleantrue

Dependencies#

npm

React only

Built from

Examples#

All chart components

Learn more