Skip to Content
0

[Viz] Get number of visible points in VizFrame

Mar 21, 2017 at 02:34 PM

43

avatar image

Hello,

i am using a VizFrame line chart to display a rather big amount of data. Because the performance gets bad when zooming out too much, I would like to know if there is a way to find out how many data points are currently visible. So that i could say something like: "current visible data points > 1000 means zooming out is blocked". The user would be then only able to scroll to left or right.

I know this is not perfect but in my case it would still be better than just decreasing the total amount of data points.

Best Regards,
Henrik

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ulrich Block
Mar 22, 2017 at 11:44 AM
1

This could be done like:

jQuery('.v-datapoint').length

You probably want to narrow down a bit more before using the above like:

jQuery('#' + this.getView().byId('vizFrameID').getId()).find(jQuery('.v-datapoint')) 

This is how we access and validate the data points in our OPA5 tests.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks a lot! This allowed me building custom zooming buttons and preventing the user too zoom out too far.

0
Seungchul Yang Mar 22, 2017 at 01:34 AM
0

How about using Time Axis for huge datasets.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

We are actually using a time axis but when having around 10000 data points and being zoomed out completely so that all points have to be rendered, the performance gets bad.

0