We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ZoomFactor

I'm hooking into the chart zoom events:

                _chart.ZoomStart += ChartZoomStarted;
                _chart.ZoomDelta += ChartZoomChanged;

and I limit zoom to X:

                 ZoomMode = ZoomMode.X  

and I set the initial zoom factor on the chart to 0.5 - I note that this is on the chart and NOT an axis...

Then, when I pinch zoom the chart, the zoom factors I get reported to me in the event handlers don't appear to bear any relation to the zoom factor on the chart - which remains fixed at 0.5. Is this because these are axis zooms and these are independent of chart zoom?

Is this how it is supposed to work? I couldn't find any meaningful documentation on the zoom factors reported and I'm just blindly experimenting to try and achieve what I want which is rather unsatisfactory and time consuming. Is there some documentation I'm missing? This: http://help.syncfusion.com/cr/xamarin/sfchart tells me nothing I couldn't read direct from the Assembly browser....

What I'm trying to do is cancel zooming when it reaches a specified threshold in each direction but allow it to return in the opposite direction. I can do this by setting

                 ChartZoomStartEventArgs.Cancel = true; 

but I need to make sense of the reported zoom factors to re-enable it at the appropriate time...

3 Replies

MH Mark Hatton replied to Mark Hatton May 1, 2015 02:21 PM UTC

I'm hooking into the chart zoom events:

                _chart.ZoomStart += ChartZoomStarted;
                _chart.ZoomDelta += ChartZoomChanged;

and I limit zoom to X:

                 ZoomMode = ZoomMode.X  

and I set the initial zoom factor on the chart to 0.5 - I note that this is on the chart and NOT an axis...

Then, when I pinch zoom the chart, the zoom factors I get reported to me in the event handlers don't appear to bear any relation to the zoom factor on the chart - which remains fixed at 0.5. Is this because these are axis zooms and these are independent of chart zoom?

Is this how it is supposed to work? I couldn't find any meaningful documentation on the zoom factors reported and I'm just blindly experimenting to try and achieve what I want which is rather unsatisfactory and time consuming. Is there some documentation I'm missing? This: http://help.syncfusion.com/cr/xamarin/sfchart tells me nothing I couldn't read direct from the Assembly browser....

What I'm trying to do is cancel zooming when it reaches a specified threshold in each direction but allow it to return in the opposite direction. I can do this by setting

                 ChartZoomStartEventArgs.Cancel = true; 

but I need to make sense of the reported zoom factors to re-enable it at the appropriate time...

Ignore the "I note that this is on the chart and NOT an axis..." - my head is frazzled after so much guesswork!


YP Yuvaraj Palanisamy Syncfusion Team May 4, 2015 01:34 PM UTC

Hi Mark,

Thanks for using Syncfusion Products,

#1) when I pinch zoom the chart, the zoom factors I get reported to me in the event handlers don't appear to bear any relation to the zoom factor on the chart - which remains fixed at 0.5. should be fixed when we zoom,
We don't have ZoomFactor property in SfChart class. This property is present in an axis instance. When you zoomin/zoomout, you will get correct zoom factor value in CurrentZoomFactor property in the event arguments. While zooming, value of the ZoomFactor property on axis remains 0.5 and we confirm it is a bug.

#2)Is this how it is supposed to work? I couldn't find any meaningful documentation on the zoom factors reported
Currently, we are working on UG documentation and we will publish it as soon as possible.

#3) What I'm trying to do is cancel zooming when it reaches a specified threshold in each direction but allow it to return in the opposite direction. I can do this by setting
ZoomStart event will be fired only once when you are about to zoom. ZoomDelta event will be fired continuously while zooming. We suggest you to cancel ZoomDelta event when it reached certain threshold as we demonstrated in the sample.

Sample : http://www.syncfusion.com/downloads/support/forum/118985/ChartSample-821216568.zip

Please let us know if you require further assistance, we are happy to assist you.

Thanks,
Yuvaraj P


YP Yuvaraj Palanisamy Syncfusion Team July 8, 2015 01:07 PM UTC

Hi Mark,

We are glad to announce that our Essential Studio 2015 Volume 2 is rolled out and is available for download under the following link:

http://www.syncfusion.com/forums/119549/essential-studio-2015-volume-2-final-release-v13-2-0-29-available-for-download

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Yuvaraj

Loader.
Live Chat Icon For mobile
Up arrow icon