Skip to content

Line

import { Line } from 'react-chartjs-2';
<Line
options={...}
data={...}
{...props}
/>

Usage examples:

Also supports all standard <canvas> props.

datarequired

The data object that is passed into the Chart.js chart See more

Type: ChartData<"line", TData, TLabel>

options

The options object that is passed into the Chart.js chart See more

Type: ChartOptions<"line"> · Default: {}

plugins

The plugins array that is passed into the Chart.js chart See more

Type: Plugin<"line", AnyObject>[] · Default: []

redraw

Teardown and redraw chart on every update

Type: boolean · Default: false

datasetIdKey

Key name to identificate dataset

Type: string · Default: 'label'

fallbackContent

A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions See more

Type: ReactNode · Default: null

updateMode

A mode string to indicate transition configuration should be used. See more

Type: "resize" | "reset" | "none" | "hide" | "show" | "default" | "active"

ref

Type: ForwardedRef<Chart<"line", TData, TLabel>>