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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

programmatically zoom and pan sfchart

Thread ID:

Created:

Updated:

Platform:

Replies:

132926 Sep 28,2017 12:54 PM UTC Oct 5,2017 05:43 AM UTC Xamarin.Android 5
loading
Tags: SfChart
Alex
Asked On September 28, 2017 12:54 PM UTC

Hy,

I want to zoom chart programmatically to a specific range of data, but I don't know what method to use.

What methods should I use for that?


Thank you,



Parthiban Sundaram [Syncfusion]
Replied On September 29, 2017 11:46 AM UTC

Hi Alex,  
 
Thanks for using Syncfusion products.  
 
You can use the ZoomByRange method in the ChartZoomPanBehavior class to achieve your requirement. Please refer the following code snippet for more details.  
 
Code snippet:  
  
  
   zoomPan.ZoomByRange(yAxis, 50, 60); // Specify the range to zoom  
  
Please download the sample from following location.  
 
 
Please let us know, if you need further assistance on this.  
 
Regards  
Parthiban S  


Alex
Replied On October 3, 2017 08:22 AM UTC

Hello,


Thank you for your answer. 

1. I want to zoom and pan on DateTimeAxis, how can I use the ZoomByRange method?

2. More important, how can I zoom to fit on  numerical axis(the vertical one).


Thank you


Parthiban Sundaram [Syncfusion]
Replied On October 3, 2017 09:34 AM UTC

Hi Alex,  
  
Thanks for the update.  
  
You can achieve this requrimenet by passing start date and end date with DateTimeAxis in the ZoomByRange method of the ChartZoomPanBehavior. Please refer the following code snippet for more details.    
   
Code snippet:    
  
ZoomByRange in DateTimeAxis  
  
  
 double startDate = new DateTime(2017, 10, 5).ToOADate();  
 double endDate = new DateTime(2017, 10, 7).ToOADate();  
  
 zoomPan.ZoomByRange(xAxis,startDate,endDate); // Specify the range to zoom  
  
  
ZoomByRange in NumericalAxis  
  
    
   zoomPan.ZoomByRange(yAxis, 0, 2); // Specify the range to zoom    
  
  
We have prepared the sample based on your requirement. Please download the sample from following location.    
   
   
Please let us know, if you need further assistance on this.    
   
Regards    
Parthiban S    


Alex
Replied On October 4, 2017 11:20 AM UTC

Hey,


Thank you


Parthiban Sundaram [Syncfusion]
Replied On October 5, 2017 05:43 AM UTC

Hi Alex,

Thanks for the update. We are glad that the given solution has helped to achieve your requirement. Please let us know, if you need further assistance on this.

Regards,
Parthiban S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;