SYS:ONLINE● ACTIVE
THEME
GITHUBv0.1.0

LINE CHART

SVG line chart with multi-series support, animated draw-on effect, optional area fill, grid lines, and an automatic legend.

PREVIEW

ISS ALTITUDE TRACK // KM
423421419417T+0T+10T+20T+30T+40T+50T+60T+70

INSTALLATION

BASH
npx shadcn@latest add @scificn/line-chart

USAGE

TSX
import { LineChart, type LineChartSeries } from '@/ui/line-chart'

// Single series
<LineChart
  series={[{ id: 'power', label: 'POWER', data: [80, 85, 78, 90, 88] }]}
  labels={['MON', 'TUE', 'WED', 'THU', 'FRI']}
  title="POWER OUTPUT"
  variant="ACTIVE"
  showArea
/>

// Multi-series
const series: LineChartSeries[] = [
  { id: 'reactor', label: 'REACTOR', data: [72, 78, 85, 82, 89] },
  { id: 'shields', label: 'SHIELDS', data: [95, 88, 82, 87, 80] },
]

<LineChart
  series={series}
  labels={['T+0', 'T+5', 'T+10', 'T+15', 'T+20']}
  title="SYSTEM LOAD"
  showLegend
/>

MULTI-SERIES

SYSTEM LOAD // MULTI-SERIES
95837260T+0T+10T+20T+30T+40T+50T+60T+70
Reactor
Shields
Engines

VARIANTS

variant="ACTIVE"

422420419417T+0T+5T+10T+15T+20T+25T+30T+35

variant="WARNING"

422420419417T+0T+5T+10T+15T+20T+25T+30T+35

variant="CRITICAL"

422420419417T+0T+5T+10T+15T+20T+25T+30T+35

variant="DEFAULT"

422420419417T+0T+5T+10T+15T+20T+25T+30T+35

OPTIONS

showDots=false showArea=true

423421419417T+0T+10T+20T+30T+40T+50T+60T+70

showGrid=false showDots=true

T+0T+10T+20T+30T+40T+50T+60T+70

PROPS

PROPTYPEDEFAULTDESCRIPTION
seriesLineChartSeries[]Array of data series. Each has id, label, data[], and optional variant.
labelsstring[]X-axis labels, same length as each series.data.
titlestringundefinedOptional header label.
heightnumber160Chart area height in px.
minnumbermin(data)Override y-axis minimum.
maxnumbermax(data)Override y-axis maximum.
showDotsbooleantrueShow circles at data points.
showAreabooleanfalseFill area under the line.
showGridbooleantrueShow horizontal grid lines.
showLegendbooleanautoShow legend. Defaults to true when series.length > 1.
animatedbooleantrueAnimate the line drawing on mount.
classNamestringAdditional classes merged via cn().