I am using C#, and would like to plot a line chart to visualize my data, the data could be stored as a double array, the number could be very large, over 100000 maybe, and I also would like to update the data source all the time, but when I use the Microsoft Win Chart, the refresh rate will be very slow if the number is too large (20000 would give a very bad user experience), I use the FastLine/FastPoint chartType, but it did not give me too much improvement, and I also tried to directly bind the data to the Points.DataBindY method, still, does not feel very well.
Is there anyone has experience on how to deal with this?
Many thanks.
You're going to find that trying to chart that number of points (100k) is going to overwhelm even the most powerful of charting controls. And I would question why it's even necessary to do that. How can you possibly differentiate 100k points on a chart? It seems unnecessary. Most charting controls (I'm most familiar with WPF controls) allow you to 'sample' the data (via a sampling threshold). This permits you to still retain the general shape of the data, but do so with far fewer data points, and much better performance.
Also, be very careful when binding data. With many charting controls, when you bind data, each data point bound to the chart causes a refresh of the chart. You can imagine what 100k refreshes would do :(. If you can, find a way to refresh the chart after all the data has been bound to the chart.
A solution might be to reduce the scale to 1:10000, greatly reducing drawn points while keeping the same draw.
You could do this by working on the data array before giving it to the chart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With