Skip to content

Line chart

import { LineChart } from '@arshad-shah/swift-chart';
const chart = new LineChart('#chart', { theme: 'midnight' });
chart.setData(monthlySales, { x: 'month', y: ['revenue', 'target'] });

Common options

smooth

Use cubic interpolation for a curved line.

dots

Render a dot at each data point.

lineWidth

Thicken the line stroke.

step

Render as a step line. Useful for state-change or staircase data. Accepts 'before' | 'after' | 'middle' (or true for the default 'after'); steps are mutually exclusive with smooth.

Reference