Skip to main content
Version: 6.1.2

Altering component draw order

By default, the drawing order of series is the same as the order you create them in.

// Example, lineSeries1 is drawn under lineSeries2
const lineSeries1 = chart.addLineSeries()
const lineSeries2 = chart.addLineSeries()

This can be conveniently overridden using the setDrawOrder method:

// Works similar to CSS zIndex, higher number results in being drawn later.
lineSeries1.setDrawOrder({ seriesDrawOrderIndex: 10 })
lineSeries2.setDrawOrder({ seriesDrawOrderIndex: 1 })