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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic insertion of points in the graph with zooming

Thread ID:





132036 Aug 9,2017 10:23 AM UTC Aug 14,2017 06:02 PM UTC Xamarin.Forms 2
Tags: SfChart
Novel Alex
Asked On August 9, 2017 12:23 PM UTC

I use sfChart in Xamarin.Forms for Android, I have graphics with large number of points.For fast loading, i  display only a part of the points, and then at Zoom I add other points to see the graph in details, but when adding points sfChart redraws the whole Graph and shows it with ZoomFactor = 1,  How can this be changed? I also tried to use the different Axes of CategoryAxis and NumbericAxis and i had the same situation with it. I'm using FastLine Series
Best regards

Novel Alex
Replied On August 14, 2017 08:32 AM UTC

I had the wrong Binding in Series  In IsVisible. He gave an incorrect result. And turned off the zoom

Manivannan Elangovan [Syncfusion]
Replied On August 14, 2017 06:02 PM UTC

Hi Novel Alex,
Thanks for using Syncfusion products.
We are able to achieve your requirement by using ZoomFactorZoomPosition properties and platform specific codes.  Please refer the following code snippet to stay zoomed position, after added the new data points in chart. 
Code snippet:
private void GetVisibleRangeValues() 
    List<double>visibleValues = DependencyService.Get<IAxisDependencyService>().GetVisibleRange(xAxis); 
    visibleStart = visibleValues[0]; 
    visibleEnd = visibleValues[1]; 
private void SetCurrentZoomPosition() 
    var start = (double)Data[0].XValue; 
    var end = (double)Data[Data.Count - 1].XValue; 
    double delta = GetDelta(start, end); 
    xAxis.ZoomPosition = (visibleStart - start) / delta; 
    xAxis.ZoomFactor = (visibleEnd - visibleStart) / delta; 
Note:  This workaround worked on latest volume 3 release ( only.
Sample: http://www.syncfusion.com/downloads/support/forum/132036/ze/Sample1612023583  

Manivannan E 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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