I’ve created a view with approximately 50 series, each containing ~200 datapoints.
I have noticed that rendering this with the legend showing, has a significant performance impact. I would expect the legend to have a cost, but I’m seing a big change in render time (the chart refreshes when the user checks a checkbox, so the performance has to be good).
I’ve added the legend using the following standard (I believe) xaml:
s:LegendModifier x:Name=”legendModifier”
IsEnabled=”True”
ShowLegend=”True”
Orientation=”Vertical”
Margin=”5″
LegendPlacement=”Inside”
GetLegendDataFor=”AllVisibleSeries”
ShowVisibilityCheckboxes=”False”
ShowSeriesMarkers=”True”
ScrollViewer.VerticalScrollBarVisibility=”Auto”/
When I set IsEnabled=”False” the performance improves significantly.
Does anybody have any hints to how performance can be improved?
Best regards
- bjarne munch asked 9 years ago
- You must login to post comments
Hi Andrew,
Thanks for the quick reply!
I did try using your example, and I must admit that the fault was mine. I had left out the SuspendUpdates call (because I was using databinding).
But after I introduced it , performance is absolutely perfect.
Thanks!
- bjarne munch answered 9 years ago
- Great! Thanks for letting us know! :)
- You must login to post comments
Hi Bjarne,
Interesting issue you have found here. I did a short investigation, by modifying our Chart Legends example (MutlipleLinesView.xaml in the examples suite) to create 50 series of 200 points:
private void MultipleLinesView_OnLoaded(object sender, RoutedEventArgs e)
{
int count = 50;
sciChart.RenderableSeries.Clear();
using (sciChart.SuspendUpdates())
{
for (int i = 0; i < count; i++)
{
var dataSeries = new XyDataSeries<double, double> {SeriesName = "Curve #" + (i + 1)};
var data1 = DataManager.Instance.GetStraightLine((i+1)*10, 1.0, 200);
dataSeries.Append(data1.XData, data1.YData);
var renderSeries = new FastLineRenderableSeries() {DataSeries = dataSeries};
sciChart.RenderableSeries.Add(renderSeries);
}
}
// Zoom to extents of the data
sciChart.ZoomExtents();
}
The result is below:
5MByte Animated Gif file showing legend performance with 50 series of 200 data-points
Rendering performance seems ok, as does performance of checking / unchecking items. Is this what you observe? Can you take my modification and modify it further until the performance issue occurs? We would be glad to investigate & provide a solution – performance is our middle name!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 9 years ago
- You must login to post comments
Please login first to submit.