Hi -
I'm trying to add a cursor and plot for each series I'm given. Below is the code that adds the plot and the cursor; this code is only called if the request is not a postback. I can come to the page initially, but any sort of postback results in an error: XYCursor.Plot and XYCursor do not belong to the same graph. Is there something else I need to do to avoid that error?
Thanks!
Terry
Private Function AddPlot(ByVal s As Series, ByVal plotNumber As Integer) As NationalInstruments.UI.ScatterPlot
If s.YAxisIndex > 0 And Not m_secondAxisEnabled Then
AddSecondAxis()
End If
Dim p As New NationalInstruments.UI.ScatterPlot(Graph.XAxes(0), Graph.YAxes(s.YAxisIndex))
p.LineWidth = 2
p.PlotXY(m_presenter.GetXValues(), m_presenter.GetSeriesDataPoints(s))
p.LineColor = GetColor(plotNumber)
Graph.Plots.Add(p)
Dim c As New XYCursor(p)
c.VerticalCrosshairMode = CursorCrosshairMode.FullLength
c.HorizontalCrosshairMode = CursorCrosshairMode.FullLength
c.SnapMode = CursorSnapMode.NearestPoint
Graph.Cursors.Add(c)
Return p
End Function