XCoordinate

 

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

By default, the returned text string is formatted based on the format settings for the x-axis scale.  To obtain the x-coordinate for a specific x-axis without its format settings applied, pass False as the second argument in XCoordinate.  The second argument in XCoordinate 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 = 2

'NumYScales = 5

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

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

Private Sub XYChartCtl1_CrossHairsMove()             

    X1Label.Caption = XYChartCtl1.XCoordinate(1)         'Display x-coordinate of the first X-axis in label X1Label

    X2Label.Caption = XYChartCtl1.XCoordinate(2, False)  'Display x-coordinate of the second X-axis in label X2Label, do not format the value

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

    Y2Label.Caption = XYChartCtl1.YCoordinate(2)         'Display y-coordinate of the second Y-axis in label Y2Label

    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     YCoordinate     CrossHairsMove