03-15-2013 03:07 AM
I want to chart multiple plots in the same ni graph, by using the WPF version of Measurement Studion 2013 (VS2012).
Your wpf charting example is modified with a declaration of two plots in the graph instead of one - see the enclosed project: MainWindow xaml file.
My problem is that I'am only able to update one of the plot in the GenerateData timer callback function.
I have tried several versions of constructing the generic ChartCollection (see the enclosed project: MainWindow cs file ) class:
- ChartCollection< List<double>, List<double>> d = new ChartCollection< List< double> , List<double>>(100);
This declaration does not compile
- ChartCollection< double, List<double>> d = new ChartCollection< double , List<double>>(100);
This compiles, but crashes in the Append() call
- ChartCollection<double, double> d = new ChartCollection<double, double>(100);
This compiles but the Append() call only updates the first plot.
Does anyone have a solution to this relative simple question ??
03-15-2013 12:38 PM
To display chart data for multiple plots, you can use multiple chart collections.
The easiest way to update your example project would be to use an array of chart collections:
ChartCollection<double, double>[] d = new[] {
new ChartCollection<double, double>(100),
new ChartCollection<double, double>(100)
};
...
d[0].Append(t, s);
d[1].Append(t, s1);