XY Chart NET 3 Control Reference > Methods > SetCrosshairsPosition Method |
Use this method to set the crosshairs to a specific x/y location on the chart. This method is only available in the crosshairs mode (see SetCrosshairsMode).
[Visual Basic] Sub SetCrosshairsPosition(XCrossCoordinate As Double, YCrossCoordinate As Double, XScaleIndex As Integer, YScaleIndex As Integer) |
[C#] void XYChartNETCtl.SetCrosshairsPosition(double XCrossCoordinate, double YCrossCoordinate, int XScaleIndex, int YScaleIndex) |
[C++] void SetCrosshairsPosition(double, double, int, int) |
' XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form. Dim xCrossCoord As Double Dim yCrossCoord As Double Dim xScaleIdx As Integer Dim yScaleIdx As Integer xScaleIdx = 0 'X-axis scale index the crosshair's x-coord will be set against yScaleIdx = 0 'Y-axis scale index the crosshair's y-coord will be set against xCrossCoord = 24 'Vertical crosshair position yCrossCoord = 500 'Horizontal crosshair position 'Position crosshairs; a Refresh call is not required XYChartNETCtl1.SetCrosshairsMode(True) XYChartNETCtl1.SetCrosshairsPosition(xCrossCoord, yCrossCoord, xScaleIdx, yScaleIdx)