YAxis Property

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

[Visual Basic]
Structure YSCALEPROP
   Grid As C_Line
   Scale As C_YScale
End Structure

Property YAxis(YAxisNumber As Integer) As YSCALEPROP
[C#]
XYChartNet.XYChartNETCtl.YSCALEPROP XYChartNETCtl.get_YAxis(int YAxisNumber)
[C++]
XYChartNet::XYChartNETCtl::YSCALEPROP XYChartNet::XYChartNETCtl::get_YAxis(int)

Parameters

YAxisNumber
The index of the y-axis to set/get.  Valid values are 0..(NumYScales - 1).

Remarks

Note   For each y-axis scale label, up to 20 characters, across two rows, can be displayed on the chart.   For example, "Speed" & Chr(13) & Chr(10) & "m/s", will display "Speed" in the label's first row and "m/s" in the label's second row.  A carriage return - Chr(13) - and a linefeed - Chr(10) - are required to indicate the text spans two rows.

Examples

XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.

[Visual Basic]
With XYChartNETCtl1
   .NumProfiles = 4
   .NumYScales = 2

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

   With .YAxis(0).Scale
      .Visible = True                   'Display scale
      .LabelVertical = "Volts"          'Set the scale's vertical label
      .LabelVerticalColor = Color.Red   'Set the color for the scale's vertical label
      .TicksColor = Color.Red           'Set the color for the scale's ticks and tick labels
   End With

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

   With .YAxis(1).Scale
      .Visible = True                   'Display scale
      .LabelVertical = "Amps"           'Set the scale's vertical label
      .LabelVerticalColor = 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
   End With

   .Refresh                             'Refresh required to update chart with changes made
End With

[C#]
XYChartNETCtl1.NumProfiles = 4;
XYChartNETCtl1.NumYScales = 2;

// Y Axis 0 Grid & Scale properties
XYChartNETCtl1.get_YAxis(0).Grid.LineOption = XYChartNet.XYChartNETCtl.LineOptions.loCustom;
XYChartNETCtl1.get_YAxis(0).Grid.LineColor = Color.Maroon;
XYChartNETCtl1.get_YAxis(0).Scale.LabelVertical = "Volts";
XYChartNETCtl1.get_YAxis(0).Scale.LabelVerticalColor = Color.Maroon;
XYChartNETCtl1.get_YAxis(0).Scale.TicksColor = Color.Maroon;

// Y Axis 1 Grid & Scale properties
XYChartNETCtl1.get_YAxis(1).Grid.LineOption = XYChartNet.XYChartNETCtl.LineOptions.loNone;
XYChartNETCtl1.get_YAxis(1).Scale.LabelVertical = "Amps";
XYChartNETCtl1.get_YAxis(1).Scale.LabelVerticalColor = Color.MidnightBlue;
XYChartNETCtl1.get_YAxis(1).Scale.TicksColor = Color.MidnightBlue;

XYChartNETCtl1.Refresh();  //Refresh required to update chart with changes made
		
[C++]
XYChartNETCtl1->NumProfiles = 4;
XYChartNETCtl1->NumYScales = 2;

// Y Axis 0 Grid & Scale properties
XYChartNETCtl1->get_YAxis(0).Grid->LineOption = XYChartNETCtl::LineOptions::loCustom;
XYChartNETCtl1->get_YAxis(0).Grid->LineColor = Color::Maroon;
XYChartNETCtl1->get_YAxis(0).Scale->LabelVertical = "Volts";
XYChartNETCtl1->get_YAxis(0).Scale->LabelVerticalColor = Color::Maroon;
XYChartNETCtl1->get_YAxis(0).Scale->TicksColor = Color::Maroon;

// Y Axis 1 Grid & Scale properties
XYChartNETCtl1->get_YAxis(1).Grid->LineOption = XYChartNETCtl::LineOptions::loNone;
XYChartNETCtl1->get_YAxis(1).Scale->LabelVertical = "Amps";
XYChartNETCtl1->get_YAxis(1).Scale->LabelVerticalColor = Color::MidnightBlue;
XYChartNETCtl1->get_YAxis(1).Scale->TicksColor = Color::MidnightBlue;

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

See Also

Properties | XAxis