02-28-2013 02:34 AM
Hi,all.
I'm using the Graph control to plot two kinds of plots. One is a spectrum plot which refresh all the samples in a short time, and the the other one is a time serial plot which add only one sample each time. Now a chartcollection was binded to the datasource, but the spectrum plot seems not to refresh very quickly. Was that due to the propertychanged event? In order to improve the respones speed, what should I do to deal with the datasource ?
Solved! Go to Solution.
02-28-2013 09:56 AM
If I understand your question correctly, you want to show two plots on the same graph (one that updates with small additions and one that updates by replacing all the data each time), and want to use a ChartCollection for these plots.
It sounds like what you are doing should work fine: giving the graph the two chart collections through DataSource (e.g. public ChartCollection<double>[] MyData { get; } ... <Graph DataSource="{Binding MyData}" ...), updating one chart collection with calls to Append individual values, and updating the other with Append calls of a range of values (either setting Capacity to match your data size, or calling Clear to remove the old values).
If that is not what you were looking for, please provide some example code so that we can better understand your problem.
02-28-2013 08:01 PM
I went through your reply and the help files and found I made a stupid mistake - I always used the Append(double,double) method and didn't notice its override format Append(List<double>, List<double>).
Thanks for your patient reply, Paul:-)