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

Poor scrolling performance for high datapoint count.

Thread ID:





147209 Sep 4,2019 09:04 AM UTC Sep 6,2019 05:10 AM UTC WPF 3
Tags: SfChart
Asked On September 4, 2019 09:04 AM UTC

Hello, after customizing sfChart to increase performance as much as possible, there is an issue remaining. When zooming in very close on a chart with many datapoints, the scrolling is sluggish. This should not be the case, because only the area within the visible range needs to be redrawn. However, it seems that behind the scenes, sfChart still converts every datapoint into pixels for the entire range, which unnecessarily decreases performance.

The culprit is this line:

GetType(FastStepLineBitmapSegment).GetMethod("CalculatePoints", BindingFlags.InvokeMethod Or BindingFlags.Instance Or BindingFlags.NonPublic).Invoke(Me, New Object() {chartTransformer})

Attached is a sample. Run the sample while ensuring the the Immediate window is open in Visual Studio. When the chart becomes visible, the output measurement shows that the method in question takes about 1700 ms. Next, click the Zoom 1 day button. Now the measure measurement is about 1450 ms. Next, scroll the chart by dragging the chart with the mouse button. The scrolling is very sluggish. The measurements are around 1450 ms per update.

Is there a way to speed this up, by for example having the method only perform pixel conversions for the visible range rather than the entire range?
Thank you.

Attachment: sfChartLargeDataPerformance_515194f7.rar

Muneesh Kumar G [Syncfusion]
Replied On September 5, 2019 07:23 AM UTC

Hi Tom, 
Greetings from Syncfusion.  
We have analysed your query and we would like to inform you that in CalculatePoints method every data point getting added with calculation to pixel rendering collection. So that it takes so much time in small level data count also.  
We can able to reduce this cycle with visible range. It improves the zoomed state panning performance in your sample. But in load it takes more time compared with old time.  
Instead of calling CalculatePoints method in reflection, we have tried to implement the calculation in sample level itself.  
Public Overrides Sub Update(transformer As IChartTransformer) 
            Debug.WriteLine("CalculatePoints method completed in {0} milliseconds.", sw.ElapsedMilliseconds) 
        End If 
    End Sub 
    Private Sub CalculatePoints(ByVal cartesianTransformer As ChartTransform.ChartCartesianTransformer) 
        Dim xAxis As ChartAxis = cartesianTransformer.XAxis 
        Dim cnt As Integer = xChartVals.Count - 1 
        Dim start As Integer = 0, endV As Integer = 0 
        start = Math.Floor(xAxis.VisibleRange.Start) 
        endV = Math.Ceiling(xAxis.VisibleRange.End) 
        If start < 0 Then 
            start = 0 
        End If 
        If endV > yChartVals.Count - 1 Then 
            endV = yChartVals.Count - 1 
        End If 
        For i As Integer = start To [endV] 
            GetType(FastStepLineBitmapSegment).GetMethod("AddDataPoint", BindingFlags.InvokeMethod Or BindingFlags.Instance Or BindingFlags.NonPublic). 
                Invoke(Me, New Object() {cartesianTransformer, i}) 
    End Sub 
Please check and let us know if you have any other queries.  
Muneesh Kumar G 

Replied On September 5, 2019 02:27 PM UTC

This is brilliant! Actually, being able to add points individually you can also add them in intervals, greatly speeding up when the visible range is the entire range.
Thank you.

Muneesh Kumar G [Syncfusion]
Replied On September 6, 2019 05:10 AM UTC

Hi Tom,  
Thanks for the update. 
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
Muneesh Kumar G. 


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

Live Chat Icon For mobile
Live Chat Icon