XY Chart NET 3 Control Reference
XAxis Property

Use this property to return/set values that determines the grid and scale characteristics for a specific x-axis.   XAxis is an array from 0 to (NumXScales - 1) and it uses the Line Class set of properties for its Grid characteristics and the Scale Class set of properties for its Scale characteristics.

Syntax
[Visual Basic]
Property XAxis(XAxisNumber As Integer) As C_XSCALEPROP
[C#]
C_XSCALEPROP XYChartNETCtl.get_XAxis(int XAxisNumber)
[C++]
property XYChartNet::XYChartNETCtl::C_XSCALEPROP ^ XYChartNet::XYChartNETCtl::XAxis[int]
       
Parameters
XAxisNumber
The index of the x-axis to set/get.  Valid values are 0..(NumXScales - 1).
Remarks
Default Label for XAxis Scale property is "Time (s)".
Example
' XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.

Dim tmpColor as Color
Dim sLabel as String

XYChartNETCtl1.NumProfiles = 4
XYChartNETCtl1.NumXScales = 2

If XYChartNETCtl1.XAxis(0).Scale.Visible Then
   sLabel = XYChartNETCtl1.XAxis(0).Scale.Label         'Return the scale label for x-axis 0
   tmpColor = XYChartNETCtl1.XAxis(0).Scale.LabelColor  'Return the scale color for x-axis 0
End If

XYChartNETCtl1.XAxis(1).Scale.Visible = False           'Do not display x-axis 1 scale

With XYChartNETCtl1
   With .XAxis(0).Grid
      .LineOption = loCustom    'Display axis' horizontal grid lines
      .LineStyle = soDash       'Set line style to use Dashes
      .LineWidth = woOnePoint   'Set line width
      .LineColor = Color.Red    'Set line color to Blue
   End With

   With .XAxis(0).Scale
      .Visible = True           'Display scale
      .Label = "Distance"       'Set the scale's label
      .LabelColor = Color.Red   'Set the color for the scale's label
      .ScaleMode = smManual     'Set the scale mode to Manual
      .ScaleManualMin = -5      'Set the scale's min value
      .ScaleManualMax = 5       'Set the scale's max value
      .TicksColor = Color.Red   'Set the color for the scale's ticks and tick labels
   End With

   With .XAxis(1).Grid
      .LineOption = loNone      'Do not display axis' horizontal grid lines
   End With

   With .XAxis(1).Scale
      .Visible = True           'Display scale
      .Label = "Speed"          'Set the scale's vertical label
      .LabelColor = Color.Blue  'Set the color for the scale's vertical label
      .TicksColor = Color.Blue  'Set the color for the scale's ticks and tick labels
      .TickLabelSpacing = 2     'Set the tick label spacing
   End With

   .Refresh                     'Refresh required to update chart with changes made
End With
// XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.

Font my14Font = new Font("Arial", 14, FontStyle.Bold);
Font my10Font = new Font("Arial", 10, FontStyle.Bold);

XYChartNETCtl1.NumProfiles = 2;
XYChartNETCtl1.NumXScales = 2;

// X Axis 0 Grid & Scale properties
XYChartNETCtl1.get_XAxis(0).Grid.LineOption = XYChartNet.XYChartNETCtl.LineOptions.loCustom;
XYChartNETCtl1.get_XAxis(0).Grid.LineColor = Color.Maroon;
XYChartNETCtl1.get_XAxis(0).Scale.Label = "Distance";
XYChartNETCtl1.get_XAxis(0).Scale.LabelColor = Color.Maroon;
XYChartNETCtl1.get_XAxis(0).Scale.TicksColor = Color.Maroon;
XYChartNETCtl1.get_XAxis(0).Scale.TicksFont = my14Font;

// X Axis 1 Grid & Scale properties
XYChartNETCtl1.get_XAxis(1).Grid.LineOption = XYChartNet.XYChartNETCtl.LineOptions.loNone;
XYChartNETCtl1.get_XAxis(1).Scale.Label = "Speed";
XYChartNETCtl1.get_XAxis(1).Scale.LabelColor = Color.MidnightBlue;
XYChartNETCtl1.get_XAxis(1).Scale.TicksColor = Color.MidnightBlue;
XYChartNETCtl1.get_XAxis(1).Scale.TicksFont = my10Font;

XYChartNETCtl1.Refresh();  //Refresh required to update chart with changes made
// XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.

System::Drawing::Font* my14Font = new Drawing::Font("Arial", 14, Drawing::FontStyle::Bold);
System::Drawing::Font* my10Font = new Drawing::Font("Arial", 10, Drawing::FontStyle::Bold);

XYChartNETCtl1->NumProfiles = 2;
XYChartNETCtl1->NumXScales = 2;

// X Axis 0 Grid & Scale properties
XYChartNETCtl1->XAxis[0]->Grid->LineOption = XYChartNETCtl::LineOptions::loCustom;
XYChartNETCtl1->XAxis[0]->Grid->LineColor = Color::Maroon;
XYChartNETCtl1->XAxis[0]->Scale->Label = "Distance";
XYChartNETCtl1->XAxis[0]->Scale->LabelColor = Color::Maroon;
XYChartNETCtl1->XAxis[0]->Scale->TicksColor = Color::Maroon;
XYChartNETCtl1->XAxis[0]->Scale->TicksFont = my14Font;

// X Axis 1 Grid & Scale properties
XYChartNETCtl1->XAxis[1]->Grid->LineOption = XYChartNETCtl::LineOptions::loNone;
XYChartNETCtl1->XAxis[1]->Scale->Label = "Speed";
XYChartNETCtl1->XAxis[1]->Scale->LabelColor = Color::MidnightBlue;
XYChartNETCtl1->XAxis[1]->Scale->TicksColor = Color::MidnightBlue;
XYChartNETCtl1->XAxis[1]->Scale->TicksFont = my10Font;

XYChartNETCtl1->Refresh();  //Refresh required to update chart with changes made
See Also

 

 


© 2003 - 2013 ControlEng Corporation. All rights reserved.