Hello
I'm working in a software that needs to show thousands of points (double, string). Also I need the ability to zoom and pan the data. The functionality can be easily reached with XamDataChart, but I'm experimenting an terrible performance issue. The strange thing is that the line of code that has the worst performance (perceived during a debug session) is as follows:
private XamDataChart Datachart;
....
DataChart.Series.Clear();
What you suggest? What else do you need to know?
Thanks
Tárik
Hi,
Do you have a lot of differenct series in the chart or just one? We've perceived an issue with this internally, but unfortunately the fix did not make it into the latest Service Release, and will have to wait for the next one. Are you running the latest Service Release? There have been some other performance improvements recently that should possibly help.
If you can share a project that simulates what you are doing, I can take a look at it and see if there is anything you can do as a workaround, and verify that the pending fix also alleviates your problem.
If the performance profile looks vastly different when you are in run mode, then the performance problem is likely just a lot of verbose binding information that WPF outputs as the markers are removed from the tree. It can create a performance lag on chart creation too. Run without the debugger attached to get a better idea of real world performance.
-Graham
Hi Graham
I don't know if I have a lot of series, you tell me what you think. The software will work from 2 to 12 series, depending on users input, each series could have 30 to 3.000.000 points. A note is necessary, when the data is larger than 7.200, I don't show all at once, I bind the data but change the WindowRect area, this already improves the performance. I'm using the InfragisticsWPF4.Controls.Charts.XamDataChart.v10.3 binary.
I will try to make a sample project to emulate what is my problem, I don't guarantee that will be realist, but I'll see what can I do.
Yes, that was an idea that I had too and I tested in the release mode and didn't perceived any meaningful performance improvement. Although I didn't use any formal profiler to validate the suspect over the Clear method raised on debug session.
I'm really disappointed, with the performance. The worst is that occurs in Clear() method. I just need to say that the usability of my software is compromised by the Infragistics library. I'm already looking for an alternative vendor.
Regards
There is a fix for this issue that is due to be released in the next service release of the chart. If you can provide a sample that simulates the issue you are seeing I can see if I can find you any valid work arounds until the service release is available. Have you tried recreating the chart rather than calling clear on the Series collection, for example?
which series type are you using?I can confirm there is no appreciable delay either before or after the service release when removing the series as below for LineSeries.But other series types may have different performance characteristics.
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); var xAxis = theChart.Axes.OfType<CategoryXAxis>().First(); var yAxis = theChart.Axes.OfType<NumericYAxis>().First(); xAxis.ItemsSource = new TestData(); for (int i = 0; i < 12; i++) { LineSeries l = new LineSeries(); l.ItemsSource = new TestData(); l.ValueMemberPath = "Value"; l.XAxis = xAxis; l.YAxis = yAxis; theChart.Series.Add(l); } } private void remove_Click(object sender, RoutedEventArgs e) { theChart.Series.Clear(); } } public class TestData : ObservableCollection<TestDataItem> { private static Random _rand = new Random(); public TestData() { double curr = 100.0; for (int i = 0; i < 500000; i++) { if (_rand.NextDouble() > .5) { curr += _rand.NextDouble() * 3.0; } else { curr -= _rand.NextDouble() * 3.0; } Add(new TestDataItem() { Label = i.ToString(), Value = curr }); } } } public class TestDataItem { public string Label { get; set; } public double Value { get; set; } }
How would I make this sample more like your situation?-Graham