Installation
Theme
Mode

Data viz

Line chart

For trends over time — throughput, velocity, burn-up. Same SVG foundation and theme as the bar chart: Geist axes, the fixed Orbit series palette, a dark tooltip, and a dashed crosshair that tracks the cursor. One component, three line styles.

$npx shadcn@latest add @orbit/line-chart

Overview

Created vs. completed over seven months. Hover the plot for the crosshair and shared tooltip.

Issue flow — created vs. completed
Issue flow
Created vs. completed · hover the plot
Net positive
CreatedCompletedReopened

Variants

A single variant switches between one focused line, a multi-series comparison, and a stepped line for discrete state changes. The curve prop trades the monotone easing for straight segments.

single — one focused line for a single metric
multi — several series on the same axes, with a legend
CreatedCompletedReopened
stepped — holds each value until the next
curve="linear" — straight segments between points
CreatedCompletedReopened

Options

Hide the point dots for a clean trend line, drop the gridlines, or recolor a single-series line with the accent.

showDots=false · showGrid=false
accent="var(--acc)"

In context

A velocity panel — the headline metrics above the trend that produced them, with a working range toggle.

Velocity
82+14%
Avg / week
58+9%
Reopened
6−12%
Velocity over time

Props

PropTypeDefaultDescription
variant"single" | "multi" | "stepped""multi"single/stepped plot data; multi plots categories + series.
curve"smooth" | "linear""smooth"Monotone curve or straight segments. The stepped variant overrides it.
data{ label: string; value: number }[]Single-series points for single | stepped.
categoriesstring[]X labels for the multi variant.
series{ name: string; values: number[]; color?: string }[]Multi-series values. Colors default to the fixed CHART_SERIES palette by position.
accentstring"var(--pri)"Single-series line color (any token or color-mix).
heightnumber340Total height in px, legend included. Width is responsive.
showGridbooleantrueHorizontal hairline gridlines.
showDotsbooleantrueSurface-cored dots on every point.
showLegendbooleantrueLegend under the multi variant. Never rendered for one series.
namestring"Value"Single-series name shown in the tooltip.
formatValue(v: number) => stringStringFormats tooltip and axis values.
ariaLabelstringPlain-language summary for the chart's role=“img”.
…restHTMLAttributes<HTMLDivElement>Forwarded to the root div, including ref and className.

Usage

Lines show change over a continuous axis — usually time. Keep the trend the hero.

Do

Use a continuous x-axis

Lines imply progression — reserve them for time or another ordered, evenly-spaced axis.

Don’t

Plot too many lines

Past three or four series the chart turns to spaghetti; split it up or highlight one.

Do

Smooth for trends, step for states

Monotone curves read as a trend; stepped lines show a value that holds then jumps.

Don’t

Truncate the axis to dramatize

A misleading baseline exaggerates wiggles — the scale here always starts at zero.

Keyboard & accessibility

The chart renders as a labelled image; the crosshair tooltip reads every series at the hovered point.

roleimg with an aria-label summary of the trend
TooltipAll series at the hovered x, with a crosshair
LegendNames series beyond color alone
ContrastSeries palette holds ≥ 3:1 on both modes