Skip to content

Lines

Configure the appearance and behaviour of line.

Options

OptionTypeDefaultDescription
datanumber[]Required. Array of data points
colourstring#000000Hex color for the line
labelstringline-0Unique label for the series
interpolationlinear|cubiclinearLine curve style
stylesolid|dashedsolidLine stroke pattern
annotatePointsbooleanfalseShow circles at data points
areaobjectArea fill configuration

Interpolation

Choose how points are connected:

ValueDescription
linearStraight lines between points
cubicSmooth curves through points

Line Styles

ValueDescription
solidContinuous line (default)
dashedDashed line pattern

Area Fill

Fill the region under a line:

ts
{
    area: {
        fill: true;
    }
}

INFO

When area color matches line color, 60% opacity is applied automatically.

Point Annotations

Show markers at each data point with annotatePoints: true:

Released under the ISC License.