Skip to Content

[Viz] Get number of visible points in VizFrame

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 22, 2017 at 11:44 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 22, 2017 at 01:34 AM

    How about using Time Axis for huge datasets.

    Add comment
    10|10000 characters needed 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.