maq webster
maq webster

Reputation: 21

How to get data from selected points in Lightning Chart

In lightning chart i need to get Y axis data(only portion which i have zoomed in),I have used chart with zoom band feature through which i make zoom into the portion,I need data of that zoomed portion,Is there any example of that.

Upvotes: 1

Views: 298

Answers (1)

Niilo Keinänen
Niilo Keinänen

Reputation: 2582

you'll need to manually filter the relevant data points from your data set.

The active Axis interval (start -> end) can be requested at any time with Axis.getInterval method.

Alternatively, you can trigger actions when an Axis interval changes by using Axis.onScaleChange method.

chart.getDefaultAxisX().onScaleChange((start, end) => {
    // This code gets called when X axis interval changes.
    // `start` and `end` variables refer to the active X axis interval range.
})

In your case, you should keep a reference to your data set, and when required find all the points whose x value lies between X interval start and end values.

Upvotes: 1

Related Questions