Reference Line

A Reference Line is essentially an arbitrary fixed line, which runs parallel to the time axis and is mapped to a specific value of YAxis. It can help you quickly compare any data point against a fixed value line.

Refer to the image below:

Reference Line

The salient features of the reference line:

  • A label which is by default displayed on the opposite side of the YAxis, when you hover on the knob of the reference line.
  • A value is by default displayed in the reflect tag when you hover on the knob of the reference line.
  • A reference line can be customized in terms of shape, size, color, etc.

A chart with a reference line is shown below:

Loading data for chart…

In the example given above, a reference line appears, parallel to the time axis. Hover on the knob of the reference line to see the label and the value.

Add a Reference Line

You can add a reference line using the following attributes of the referenceLine object inside the YAxis object:

  • Use the value attribute to set the value at which the reference line should appear.
  • Use the label attribute to set the text of the label.

Refer to the code given below:

{
    type: 'timeseries',
    dataSource: {
        data: dataStore,
        yaxis: {
            //Reference Line
            "referenceLine": [{
                "label": "Daily Target",
                "value": 300
            }],
        }
    }
}

Reference Line in Multivariate chart

For multivariate charts, each chart canvas can have its own reference line. A chart with reference lines in each canvas is shown below:

Loading data for chart…