zoom multiple SfCharts simultaneously

Hi, 
I have 2 SfCharts in my application, and when I start zooming on one of the charts, I want the other chart to start to zoom as well. I mean I want to be able to zoom them both at the same time, is that possible?
Thanks in advance

3 Replies

MP Michael Prabhu M Syncfusion Team September 5, 2018 11:51 AM UTC

Hi Reihaneh, 
 
Greetings from Syncfusion, if you want two charts zoom simultaneously, you can user our ZoomPosition and ZoomFactor properties of the axis. We have achieved your requirement by syncing the ZoomPosition and ZoomFactor of two chart axes using ZoomDelta event as like in below code snippet. 
 
Code Snippet C# 
            Chart1.ZoomDelta += Chart1_ZoomDelta; 
            Chart2.ZoomDelta += Chart2_ZoomDelta; 
            Chart1.ResetZoom += Chart1_ResetZoom; 
            Chart2.ResetZoom += Chart2_ResetZoom; 
 
 
private void Chart2_ZoomDelta(object sender, ChartZoomDeltaEventArgs e) 
        { 
            Chart1.PrimaryAxis.ZoomPosition = e.CurrentZoomPosition; 
            Chart1.PrimaryAxis.ZoomFactor = e.CurrentZoomFactor; 
        } 
 
  
We have also prepared as sample for your requirement and it can be downloaded from the link below.  
 
Sample: 139663 
 
Hope this helps.  
 
Thanks, 
Michael 




RK Reihaneh Khaksaran September 12, 2018 03:44 PM UTC

Thank you so much for your fast and efficient reply, it worked perfectly fine


MP Michael Prabhu M Syncfusion Team September 13, 2018 04:56 AM UTC

Hi Reihaneh, 
 
Glad we could help. Feel free to contact us any time if you need any other assistance from us. 
 
Thanks, 
Michael  



Loader.
Up arrow icon