XY Chart NET 3 Control Reference
XCoordinate Property

Use this property to obtain the x-coordinate of the crosshairs for a specific X-axis.

This property is only available in the crosshairs mode (see Toolbar).

Syntax
[Visual Basic]
ReadOnly Property XCoordinate(XAxisNumber As Integer, [bFormatted As Boolean = True]) As String
[C#]
string XYChartNETCtl.get_XCoordinate(int XAxisNumber, bool bFormatted)
[C++]
property System::String ^ XYChartNet::XYChartNETCtl::XCoordinate[int, bool]
       
Parameters
XAxisNumber
The x-axis index to obtain the crosshair's x-coordinate.  Valid values are 0..(NumXScales - 1).
bFormatted
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 in False.
Example
' XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.
' NumXScales = 2
' NumYScales = 5
' X-Axis scale 0: FormatStyle=Numeric, NumericFormat="(Auto)"
' X-Axis scale 1: FormatStyle=Numeric, NumericFormat="0.00%"

Private Sub XYChartNETCtl1_CrossHairsMove() Handles XYChartNETCtl1.CrossHairsMove
   With XYChartNETCtl1
      X0Label.Text = .XCoordinate(0)        'Display crosshair's x-coord for x-axis 0 in X0Label
      X1Label.Text = .XCoordinate(1, False) 'Display crosshair's x-coord for x-axis 1 in X1Label;
                                            'do not format the value
      Y0Label.Text = .YCoordinate(0)        'Display crosshair's y-coord for y-axis 0 in Y0Label
      Y1Label.Text = .YCoordinate(1)        'Display crosshair's y-coord for y-axis 1 in Y1Label
      Y2Label.Text = .YCoordinate(2)        'Display crosshair's y-coord for y-axis 2 in Y2Label
      Y3Label.Text = .YCoordinate(3)        'Display crosshair's y-coord for y-axis 3 in Y3Label
      Y4Label.Text = .YCoordinate(4)        'Display crosshair's y-coord for y-axis 4 in Y4Label
   End With
End Sub
// XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.
// NumXScales = 2
// NumYScales = 5
// X-Axis scale 0: FormatStyle=Numeric, NumericFormat="(Auto)"
// X-Axis scale 1: FormatStyle=Numeric, NumericFormat="0.00%"

private void XYChartNETCtl1_CrossHairsMove()
{
    X0Label.Text = XYChartNETCtl1.get_XCoordinate(0, true);   //Display crosshair's x-coord for x-axis 0 in X0Label
    X1Label.Text = XYChartNETCtl1.get_XCoordinate(1, false);  //Display crosshair's x-coord for x-axis 1 in X1Label;
                                                              //do not format the value
    Y0Label.Text = XYChartNETCtl1.get_YCoordinate(0, true);   //Display crosshair's y-coord for y-axis 0 in Y0Label
    Y1Label.Text = XYChartNETCtl1.get_YCoordinate(1, true);   //Display crosshair's y-coord for y-axis 1 in Y1Label
    Y2Label.Text = XYChartNETCtl1.get_YCoordinate(2, true);   //Display crosshair's y-coord for y-axis 2 in Y2Label
    Y3Label.Text = XYChartNETCtl1.get_YCoordinate(3, true);   //Display crosshair's y-coord for y-axis 3 in Y3Label
    Y4Label.Text = XYChartNETCtl1.get_YCoordinate(4, true);   //Display crosshair's y-coord for y-axis 4 in Y4Label
}
// XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.
// NumXScales = 2
// NumYScales = 5
// X-Axis scale 0: FormatStyle=Numeric, NumericFormat="(Auto)"
// X-Axis scale 1: FormatStyle=Numeric, NumericFormat="0.00%"

private: System::Void XYChartNETCtl1_CrossHairsMove()
    {
        X0Label.Text = XYChartNETCtl1->XCoordinate[0, true];   //Display crosshair's x-coord for x-axis 0 in X0Label
        X1Label.Text = XYChartNETCtl1->XCoordinate[1, false];  //Display crosshair's x-coord for x-axis 1 in X1Label;
                                                               //do not format the value
        Y0Label.Text = XYChartNETCtl1->YCoordinate[0, true];   //Display crosshair's y-coord for y-axis 0 in Y0Label
        Y1Label.Text = XYChartNETCtl1->YCoordinate[1, true];   //Display crosshair's y-coord for y-axis 1 in Y1Label
        Y2Label.Text = XYChartNETCtl1->YCoordinate[2, true];   //Display crosshair's y-coord for y-axis 2 in Y2Label
        Y3Label.Text = XYChartNETCtl1->YCoordinate[3, true];   //Display crosshair's y-coord for y-axis 3 in Y3Label
        Y4Label.Text = XYChartNETCtl1->YCoordinate[4, true];   //Display crosshair's y-coord for y-axis 4 in Y4Label
    }
See Also

 

 


© 2003 - 2013 ControlEng Corporation. All rights reserved.