Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Scattergraph ScatterPlot plotting

I have a ScatterGraph, with my x-axis being time, and my y-axis data read from a channel(s). If I have multiple channels, I would like for them to be shown in different colors to distinguish them. I have also set up a legend to display the channel and it's point and line color. My legend displays exactly what I want - channel name with the correct line and point color. However, my data on the scattergraph is only shown in one color. Also, I only have points on the graph with no line connecting them???!! My code is below...

 

ScatterPlot _data = new ScatterPlot();

ScatterPlot _data2 = new ScatterPlot();

 

//Add data plot to the graph collection

_graph3.Plots.Add(_data);

_graph3.Plots.Add(_data2);

 

 

if (_plot3.Data[0] != null)

{

//set data point style and color and line color

_data.PointColor = Color.Red;

_data.LineStyle = LineStyle.Solid;

_data.LineColor = Color. Blue;

legendItem1.Text = _plot3.Channels[0].DisplayName;

legendItem1.Source = _data;

}

_data.PlotXYAppend(xValue, yValue);

 

if (_plot3.Data[1] != null)

{

//set data2 point style and color and line color

_data2.PointColor = Color.Orange;

_data2.LineStyle = LineStyle.Solid;

_data2.LineColor = Color. OrangeRed;

legendItem2.Text = _plot3.Channels[1].DisplayName;

legendItem2.Source = _data2;

}

_data2.PlotXYAppend(xValue, yValue);

 

//end of code

 

Thanks in advance.

 

 

 

0 Kudos
Message 1 of 1
(4,621 Views)