I'm trying to plot roughly a million data points (x,y) (floats) into a xamDataChart. When using a CategoryXAxis and LineSeries, the performance is excellent and zooming is smooth.
When using a NumericXAxis and a ScatterLineSeries, I am experiencing a significant loss in performance. This can be reproduced by adapting the "BindingHighVolumeData" sample.
Also, I am experiencing rendering artifacts when zooming deep into the graph:
Thes issues do not occur when using a CategoryXAxis.
I am currently evaluating to buy Infragistics DV for Silverlight for its stellar performance. However, I do need a precise x,y plot. As far as I understand CategoryXAxis will align my data points with a constant x spacing, correct?
Why is the performance of ScatterLineSeries so much worse? Is there a recommended way to draw a high performance xy line plot?
Hi Graham,
All testing refers to the latest 2011 Vol2 SL5 release.
Markers are set to none for all graphs. My data usually contains regular patterns, much similar to a distorted sine wave.
I have fixed my issues with the three charts being unsynced by using CategoryDateTimeXAxis on all charts, but I'm still seeing performance issues. If you let me know an email adress, I'd be happy to send you my sample project plus sample data (it's around 10mb). The sample data I'm using is the real data, no faked data. I assume your sampling algorithms play bad with the type of data I'm using. It would be great if you could expose an API where one could hook in a custom sampling algorithm.
I tried playing with the resolution property of the LineSeries, but even though I can see a difference in the fidelity of the graph, I'm not seeing a considerable performance improvement. I do see some improvements if I make the chart smaller so only a few pixels have to be rendered.
Also note:
You can think of the Resolution property as if it is a measure of the pixel distance that two data points have to be from each other for the chart to consider them as two distinct values for display. By default, if the data point would be in a seperate pixel then it is considered distinct, but if you raised the Resolution to, say, 4, the shape of the displayed series will adjust due to the fact that it considers many more points coincident to eachother. You will see a banded shape that notifies you of the y range of the values over that section of 4 pixels.
Its possible, however, with the CategoryDateTimeXAxis that you may have certain data sets where this doesn't help the performance much. Let me know.
-Graham
Its expected that CategoryDateTimeXAxis should be slower than CategoryXAxis, but it should still be much faster than the equivalent ScatterLineSeries. Could you provide me with a bit more detail about your scenario:
Knowing what data you are using in that plot should help a lot because sometimes the performance can be sensitive to this, and you may have hit a bad case that we can alleviate or fix. A concrete sample would help a lot.
Note, that if you are mocking up some data to test performance, make sure that it has some resemblence to the real data that will be coming from the sensor as there are many easy ways to mock up data that aren't especially realistic, yet can create performance problems due to their dissimilarity to the most common use cases. Is it the same data that you've tried feeding to the CategoryXAxis?
Also note, that on the series you are using there is a property called Resolution which defaults to 1 for most series. You can actually raise this to a higher value which will decrease the fidelity of the line to the data, but as you zoom in and the individual points spread out, they will begin to fit the data better. Depending on the shape of your data, it may not turn out that this helps you, but you may want to give it a try if the fidelity of the zoomed out chart is less important than the zoomed in view.
I did actually try to use CategoryDateTimeXAxis (this actually reflects the nature of my data). I did a straightforward transform of my data to generate DateTime timestamps from my x double values.
However, my testing using CategoryDateTimeXAXis and a LineSeries showed that I can still not get smooth panning and zooming when rendering half a million data points on a 1920*1200 screen (using a Phenom X6 CPU @ 3.6 Ghz). When I use the same setup but use a CategoryXAxis, panning and zooming is smooth. The I found the performance of CategoryDateTimeXAxis+LineSeries and NumericXAxis+ScatterLineSeries about the same.
The basic scenario is like this: I have one graph that shows acceleration sensor data recorded at 100Hz. There are other measurements taken at 1 or 0.25Hz approximately. All this data shall be correlated in multiple charts synced via a SyncManager. On the non-acceleration graph I am using NumericXAxis and ScatterLineSeries with no problem since they only show a fraction of the data points but need high accuracy. When I'm using some other type of xAxis on the acceleration graph, it is no longer properly synced with the other two graphs.
I can happily accept inaccuracy when viewing the data "zoomed out", fast zooming and panning is critical. I need the "Level of Detail" to adapt however when zooming into the graph.