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.
Unfortunately, activation email could not send to your email. Please try again.

Dynamic insertion of points in the graph with zooming

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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
Alexandr

Novel Alex
Replied On August 14, 2017 04:32 AM

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 02:02 PM

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 (15.3.0.26) only.
 
Sample: http://www.syncfusion.com/downloads/support/forum/132036/ze/Sample1612023583  

Thanks,
Manivannan E 


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.

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.

;