Skip to content
SENVENLI UI

Line chart

Up to five series over time as lines, for comparing trends.
Orders by region
import { LineChart } from "@senvenli/react/charts";

Examples

With a target line

A dashed reference line with its label at the end.

Missing values

A null leaves a gap; `connectNulls` joins the line across it.

Guidelines

When to use it

  • Comparing a few series over the same periods.

Use something else when

Accessibility

Keyboard

KeysWhat happens
Arrow left / rightMoves between data points; the tooltip follows.

Built in

  • A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide

  • A title that says what the figure is.

API reference

LineChart

title
string

What the chart shows ("Revenue"), over it; leave it out when a card or a heading already says so.

aria-label
string

Names the chart when it has no visible title (a card's heading already says what it shows).

period
string

The period it covers ("June–September 2026").

total
React.ReactNode

The headline figure, in metric-medium ("€ 184,2k").

dataRequired
readonly T[]
indexRequired
keyof T & string

The x key: the period or category of each row.

categoriesRequired
readonly (keyof T & string)[]

The series keys, in order; the first is the product's own figure (ds-chart-1).

labels
Readonly<Partial<Record<string, string>>>

Series names by key ("web" → "Website"); the key by default.

valueFormatter
ChartValueFormatter

Shared by axis, tooltip and table (Intl): "€ 48.920".

indexFormatter
(value: unknown) => string

The index label in the tooltip and the table ("August 2026").

indexLabel
string

The index column's header in the data table; "Period" for time charts, "Category" for BarChart.

height
number

The plot's height in px; 240 by default.

isLoading
boolean
emptyState
React.ReactNode

Shown instead of the plot when there is no data: an EmptyState size="small" or text; "No data" by default.

allowDecimals
boolean

false for whole counts (orders, new customers): the value axis steps by whole numbers, so a small count reads 0 / 1 / 2 / 3, never 0.7 / 1.4 / 2.1. Fractional steps by default. Percent bars keep their 0–100% steps.

referenceLines
readonly ChartReferenceLine[]

A target or an average: dashed ds-border-bold with a label at its end.

connectNulls
boolean

Join across missing values; gaps stay gaps by default.