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
Hi Lazar,
Many thanks for the prompt reply.
Using your version, i added a check for newLeft and newTop on the windowRectChanged event and it now enables and disables the button as expected.
Great job and keep up the great work with the controls, very easy to use and very functional.
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