YCoordinate

 

This property is only available in the crosshairs mode (see Toolbar).  Use this property to obtain the y-coordinate of the crosshairs of a specific Y-axis.  The value returned is a text string.

By default, the returned text string is formatted based on the format settings for the y-axis scale.  To obtain the y-coordinate for a specific y-axis without its format settings applied, pass False as the second argument in YCoordinate.  The second argument in YCoordinate is optional and its default value is True.   

NOTE:  This property is read-only.

                                                                                                                                                                                                                                                                     

Example

'XYChartCtl1 is the name of the XY Chart control instance placed on the form

'NumXScales = 1

'NumYScales = 5

'Y-Axis scale 1: FormatStyle=Numeric, NumericFormat="(Auto)"

'Y-Axis scale 2: FormatStyle=Numeric, NumericFormat="0.00%"

Private Sub XYChartCtl1_CrossHairsMove()             

    XLabel.Caption = XYChartCtl1.XCoordinate(1)          'Display x-coordinate of mouse cursor in label X1Label

    Y1Label.Caption = XYChartCtl1.YCoordinate(1)         'Display y-coordinate of the first Y-axis in label Y1Label

    Y2Label.Caption = XYChartCtl1.YCoordinate(2, False)  'Display y-coordinate of the second Y-axis in label Y2Label, do not format the value

    Y3Label.Caption = XYChartCtl1.YCoordinate(3)         'Display y-coordinate of the third Y-axis in label Y3Label

    Y4Label.Caption = XYChartCtl1.YCoordinate(4)         'Display y-coordinate of the fourth Y-axis in label Y4Label

    Y5Label.Caption = XYChartCtl1.YCoordinate(5)         'Display y-coordinate of the fifth Y-axis in label Y5Label

End Sub

 

See Also

Properties     XCoordinate     CrossHairsMove     NumYScales