Yash.S.Narang
Yash.S.Narang

Reputation: 554

What method to use to stop scrolling of a chart?

I was looking through the methods of the chartXY of LightningChartJs and I can't seem to find a method to pause the scroll.I would like to know a method to play (continue) the scroll. Thanks in advance

Upvotes: 0

Views: 550

Answers (1)

terhoLCJS
terhoLCJS

Reputation: 391

You can pause the scrolling by calling the Axis.stop() method.

You can then continue the scrolling by calling the Axis.release() method. This will scroll the view to the latest added value that was added, while the scrolling was paused.

// Cache the default X axis for this example
const axisX = chart.getDefaultAxisX()

// Stop the axis from scrolling after 5 seconds
setTimeout(() => axisX.stop(), 5000)
// Release the axis after 6 seconds
setTimeout(() => axisX.release(), 6000 )

Upvotes: 2

Related Questions