Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

One X Axis with many plots in WPF NI Graph

Solved!
Go to solution

Hi,

I am currently using NI WPF Graph.

For one graph I have a list that is supposed to represent the X Axis, and many plots.

In the model: There is a list of data binding to DataSource of graph.

 

 private ObservableCollection<ObservableCollection<double>> _data = new ObservableCollection<ObservableCollection<double>>();
 public ObservableCollection<ObservableCollection<double>> Data
        {
            get { return _data; }
            set
            {
                if (_data != value)
                {
                    _data = value;
                    NotifyPropertyChanged("Data");
                }
            }
        }


Each ObservableCollection<double> represent one plot, and the Data property represent the all plots (data).

 

I also have a list of double which is supposed to represent the X Axis. (All plots in the same size)

 

For example: lf I have some plots with 5000 double, the X axis list contain 5000 double also, and each double in the plot supposed to set on double in the x in match.

 

How can I do that?

 

[I don't want to hold list of point instead double to plot beacuase it is vert massive, and I need only one X Axis for all plots]

 

 

0 Kudos
Message 1 of 2
(3,807 Views)
Solution
Accepted by hodaya273

If I understand your problem correctly, you have a single collection of X values, and multiple collections of Y values (the Data property in your example), with all collections having the same length. Unfortunately, we do not have any pre-defined data types that will chart multiple Y values against a single X value. I have added a task to our backlog to look at implementing such a type.

 

As a workaround, you might be able to use the suggestions to binding data in single wpf graph for multiple xy chart plots.

~ Paul H
0 Kudos
Message 2 of 2
(3,798 Views)