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'] });

Use cubic interpolation for a curved line.

Render a dot at each data point.

Thicken the line stroke.

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.