Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Labeled Line Chart

ProNew

Lines that end in their own names, moved apart where they would overlap, on linear or logarithmic time. The nearest line takes its color and reads its value under the pointer.

Installation

pnpm dlx shadcn@latest add @viewport/labeled-line-chart

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
title*string—
yLabel*string—
xLabel*string—
series*LineSeries[]—
xTicks*number[]—
yTicks*number[]—
logXboolean

Use a logarithmic x axis, e.g. for time that runs from minutes to hours.

false
formatX(value: number) => stringString
formatY(value: number) => stringString
heightnumber

The height of the plot, in pixels.

300
classNamestring—

Accessibility

  • Up and Down choose a line; Left and Right move along it.
  • Direct labels mean no legend to match by color.
  • The data is also a table for screen readers.
  • Lines appear already drawn under reduced motion.