Performance issue when Stripline changes size and position while scrolling
Hi, There is an issue with the performance of the sfChart when one or more chartrows contains a stripline which changes size and position as the user scrolls the chart. There is no problem however, if the stripline has a constant size and position.
Attachment: sfChartStriplinePerformance_b75cb8d1.rar
Attached is a sample. Run the sample, press the Zoom 3 Days button and drag the scrollbar (quite small) to scroll the chart back and forth the whole range. The two red striplines for the volume1 and volume2 chartrows constantly update themselves to fill the range from 0 to 50 on their yaxis. The performance is quite sluggish. Now, turn off the Update Striplines checkmark and scroll again. The striplines do not update, so they will move beyond their chartrows some times. The performance however is now better, about twice as responsive.
The reason for this is because when the striplines change size and position via the SetStriplinesPosition sub, the CalculateVisibleRange sub in the CustomDateTimeCategoryXAxis class is called twice for no apparent reason. More important, the Update sub in the CustomFastStepLineBitmapSegment class is also called twice whereas when the checkmark is off, it's only called once. There should be no reason for it to be called twice.
How can the performance be improved while having the striplines update properly while scrolling?
Thank you.
Attachment: sfChartStriplinePerformance_b75cb8d1.rar
SIGN IN To post a reply.
3 Replies
MK
Muneesh Kumar G
Syncfusion Team
March 22, 2019 07:04 AM UTC
Hi Tom,
Greetings from Syncfusion.
We have analyzed your query with provided sample and we were able to reproduce the reported problem with our end.
However, the stripline performance during scrolling has been improved by setting the dispatcher thread true when striplines are updated implicitly in axis range calculation.
Note: This is set True when Stripline’s range is set in chart extensions implicitly but when set explicitly (Updating only Stripline's position) this should not be set True.
Code Snippet
|
Sub SetStriplinesPosition()
GetType(ChartAxisBase2D).GetField("isUpdateStripDispatched", BindingFlags.GetField OrElse BindingFlags.Instance OrElse BindingFlags.NonPublic).SetValue(Me, True)
…
End Sub
|
Please let us know if you have any queries.
Thanks,
Muneesh Kumar G.
TO
Tom
March 22, 2019 08:30 AM UTC
Fantastic, thank you so much Muneesh.
MK
Muneesh Kumar G
Syncfusion Team
March 22, 2019 08:35 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.
Thanks,
Muneesh Kumar G.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
TO Tom
- Mar 20, 2019 05:56 PM UTC
- Mar 22, 2019 08:35 AM UTC