Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WPF Using a graphs datasource and accessing the line colors

I have some code I am converting to WPF from windows forms. I used to use the ScatterPlot. It appears in WPF there is on a graph component and that I need to use the datasource to get the equivalent functionality. I am able to send that data to the graph using WPF however how do I access the line properties once the data is in there? The plots collection is null because I used the datasource instead... There is a data collection but not many accessible properties. 

 

 

 

List<System.Windows.Point[]> lsp = newList<System.Windows.Point[]>();

.

.

.

//Add data to lsp

.

.

.

Graph.DataSource = lsp;

 

 

 

 

0 Kudos
Message 1 of 2
(4,042 Views)

Hi FoxGrove,

 

You should still be able to use plot renderers even though you are using a DataSource to plot your data.  Take a look at the Help Document, How to: Plot and Chart with the Measurement Studio WPF Graph Control for more information.  The code you will need to use in your XAML file is below:

 

<ni:Graph.Plots>
  <ni:Plot Name="Plot1">
    <ni:LinePlotRenderer Stroke="Red" />
    </ni:Plot>
</ni:Graph.Plots>

If you are still having trouble, you should also check out one of the shipped Measurement Studio examples, TemperatureSystem.  Navigate to Measurement Studio>>Measurement Studio Examples, then DotNET\Examples\WPF\Professional\TemperatureSystem to find the example, then go to line 190 of MainWindow.xaml to see where the line color is defined.

 

Myriam

Message 2 of 2
(4,015 Views)