Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Current zoom level
posted

So, im looking at how the jQuery charts  function on mobile devices.  So far so good but have come up against a minor problem,  does anyone know how to get the Current Zoom Scale on a chart.

For example, i've loaded up the chart, scrolled the mouse wheel and its zoomed the chart in.  Based on the fact i've zoomed the chart i want to enable a button on the screen but then also disable it again when ive returned to the normal level.  So need to know when the current zoom is 1 and when its not 1.  

So the best way i could think of doing it was using the "refreshCompleted" option and checking it there, so when the chart is refreshed i check to see what the current zoom level is and enable/disable this button based on the value pulled back.

But the problem is, i cant seem to get to the current zoom level (horizontal or vertical),  any ideas how to retrieve this value ?

Cheers

Parents
  • 1775
    Verified Answer
    posted

    Hi, whitingr

    I suggest that you use the windowRect option of the chart to get the actual zoom level. When you display a chart initially the windowRect must be Left=0, Top=0, Width=1, Height=1. You can compare against these values to detect if you are at the "default" zoom level. Besides the refreshCompleted event you can also use the windowRectChanged event to get all changes in the chart view (either position or scale, or both).

    Cheers, Lazar

Reply Children
No Data