Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind datasource to a custom class?

Solved!
Go to solution

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 ?

0 Kudos
Message 1 of 3
(5,854 Views)

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.

~ Paul H
0 Kudos
Message 2 of 3
(5,841 Views)
Solution
Accepted by topic author darkeria

 

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:-)

0 Kudos
Message 3 of 3
(5,836 Views)