You can add a SimpleScatterPlot with only one data point to the RTXYPlot, highlighting the last point.
Dim lineplot1 As New SimpleLinePlot(pTransform1, Nothing, attrib1)
lineplot1.SetFastClipMode(ChartObj.FASTCLIP_X)
rtPlot1 = New RTSimpleSingleValuePlot(pTransform1, lineplot1, inputChannel1)
chartVu.AddChartObject(rtPlot1)
Dim lineplot2 As New SimpleLinePlot(pTransform1, Nothing, attrib2)
lineplot2.SetFastClipMode(ChartObj.FASTCLIP_X)
rtPlot2 = New RTSimpleSingleValuePlot(pTransform1, lineplot2, inputChannel2)
chartVu.AddChartObject(rtPlot2)
' ADD THE FOLLOWING CODE to RTXYPLOT.InitializeGraph1
Dim scatterattrib As New ChartAttribute(Color.Green, 1, DashStyle.Solid, Color.Green)
scatterattrib.SymbolSize = 16
Dim xvalues As Double() = {0}
Dim yvalues As Double() = {0}
'scatterdataset defined global to the class as
'Dim scattterdataset As SimpleDataset = Nothing
'So that it can be accessed in update routine
scatterdataset = New SimpleDataset("Scatterdata", xvalues, yvalues)
Dim scatterplot As SimpleScatterPlot = New SimpleScatterPlot(pTransform1, scatterdataset, ChartObj.CIRCLE, scatterattrib)
chartVu.AddChartObject(scatterplot)
Then just update the single value of the scatter plot dataset with the most recent value, each time you update the display.
For i As Integer = 0 To 4
r = CDbl(counter)
x = 8 * Math.Cos(r / 8)
inputChannelValue1 = 5 * Math.Sin((r + timejitter1) / 17)
inputChannel1.SetCurrentValue(x, inputChannelValue1)
x = 5 * Math.Cos((r + 3) / 5)
inputChannelValue2 = 8 * Math.Sin((r + timejitter2) / 12)
inputChannel2.SetCurrentValue(x, inputChannelValue2)
counter += 1
Next
' ADD THE FOLLOWING CODE to InitializeData
' Update of scatter plot value
If scatterdataset IsNot Nothing Then
scatterdataset.SetDataPoint(0, New Point2D(x, inputChannelValue2))
End If
Or for C# programmers
SimpleLinePlot lineplot1 = new SimpleLinePlot(pTransform1, null, attrib1);
lineplot1.SetFastClipMode( ChartObj.FASTCLIP_X);
rtPlot1 = new RTSimpleSingleValuePlot(pTransform1,lineplot1, inputChannel1);
chartVu.AddChartObject(rtPlot1);
SimpleLinePlot lineplot2 = new SimpleLinePlot(pTransform1, null, attrib2);
lineplot2.SetFastClipMode( ChartObj.FASTCLIP_X);
rtPlot2 = new RTSimpleSingleValuePlot(pTransform1,lineplot2, inputChannel2);
chartVu.AddChartObject(rtPlot2);
// ADD THE FOLLOWING CODE to RTXYPLOT.InitializeGraph1
ChartAttribute scatterattrib = new ChartAttribute(Color.Green, 1, DashStyle.Solid, Color.Green);
scatterattrib.SymbolSize = 16;
double [] xvalues = {0};
double [] yvalues = {0};
// scatterdataset defined global to the class as
// SimpleDataset scatterdataset = null;
// So that it can be accessed in update routine
scatterdataset = new SimpleDataset("Scatterdata", xvalues, yvalues);
SimpleScatterPlot scatterplot = new SimpleScatterPlot(pTransform1, scatterdataset, ChartObj.CIRCLE, scatterattrib);
chartVu.AddChartObject(scatterplot);
Then just update the single value of the scatter plot dataset with the most recent value, each time you update the display.
for (int i=0; i < 5; i++)
{
r = (double) counter;
x = 8 * Math.Cos(r/8);
inputChannelValue1 = 5.0 * Math.Sin((r+timejitter1)/17);
inputChannel1.SetCurrentValue(x,inputChannelValue1);
x = 5 * Math.Cos((r+3)/5.0);
inputChannelValue2 = 8.0 * Math.Sin((r + timejitter2)/12);
inputChannel2.SetCurrentValue(x,inputChannelValue2);
counter++;
}
// ADD THE FOLLOWING CODE to InitializeData
// Update of scatter plot value
if (scatterdataset != null)
{
scatterdataset.SetDataPoint(0, new Point2D(x,inputChannelValue2));
}