The .xaml code:
The .cs code:
This code works well to create two XY plots. How do I combine two signals on one XY plot?
C#:
<Grid Grid.Row="0" Grid.Column="0">
<Canvas x:Name="gCanvasPlot0" Width="500" Height="150" ... />
</Grid>
<Grid Grid.Row="1" Grid.Column="0">
<Canvas x:Name="gCanvasPlot1" Width="500" Height="150" ... />
</Grid>
The .cs code:
C#:
//------------------------------
...
Plot(gCanvasPlot0, gpoXY0, glistdParams0, glistPoints0);
Plot(gCanvasPlot1, gpoXY1, glistdParams1, glistPoints1);
//------------------------------
//------------------------------
private void Plot(Canvas canvas, Polyline poXY, List<double> listdParams, List<Point> listPoints)
{
int iii = 0;
int iNumOfPoints = (int)listdParams[iii++];
double dXmin = listdParams[iii++];
double dXmax = listdParams[iii++];
double dYmin = listdParams[iii++];
double dYmax = listdParams[iii++];
double dPlotWidth = dXmax - dXmin;
double dPlotHeight = dYmax - dYmin;
for (int ii = 0; ii < iNumOfPoints; ii++) {
var pointResult = new Point {
X = (listPoints[ii].X - dXmin) * canvas.Width / dPlotWidth,
Y = canvas.Height - (listPoints[ii].Y - dYmin) * canvas.Height / dPlotHeight };
poXY.Points.Add(pointResult);
}
canvas.Children.Add(poXY);
}//Plot
//------------------------------
This code works well to create two XY plots. How do I combine two signals on one XY plot?