Xceed Chart for WinForms v4.4 Documentation
Welcome to Xceed Chart for WinForms v4.4 / User Guide / Axes / Axis Ticks

In This Topic
    Axis Ticks
    In This Topic

    Each axis has major and minor ticks. The position of the ticks is determined by the current axis scale object.

    Major Axis Ticks

    Major ticks are displayed on the inside and the outside of the chart, and their names define the orientation they have toward the chart center. The length of the major inner and outer ticks is controlled with the OuterTickLength and InnerTickLength properties of the Axis object, respectively. By default the inner and outer tick length is set to 0.04 Model units. The following code will increase the length of the outer ticks and decrease the length of the inner ticks of the PrimaryY  axis.

    VB.NET  

    Dim chart As Chart = CType(chartControl1.Charts(0), Chart)

    Dim axis As Axis =   chart.Axis(StandardAxis.PrimaryY)

    axis.OuterTickLength = 0.06F

    axis.InnerTickLength = 0.02F

    C#  

    Chart chart = (Chart)chartControl1.Charts[0];

    Axis axis = chart.Axis(StandardAxis.PrimaryY);

    axis.OuterTickLength = 0.06f;

    axis.InnerTickLength = 0.02f;

    Minor Axis Ticks

    Minor ticks are drawn between major ticks on the outside of the chart. Their length can be controlled with the MinorTickLength property. By default their length is set to 0.02 Model units. The following code increases the size of the minor ticks.

    VB.NET  
    axis.MinorTickLength = 0.04F
    C#  
    axis.MinorTickLength = 0.04f;

    Controlling the Appearance of Ticks

    Both kinds of ticks are rendered as simple lines. The properties of these lines can be controlled through the OuterTickLine , InnerTickLine, and MinorTickLine properties, which give access to the LineProperties objects controlling the appearance of the respective ticks. 

    The following examples apply different colors to the axis ticks:

    VB.NET  

    ' inner ticks with red color

    axis.InnerTickLine.Color = Color.Red

     

    ' outer ticks with blue color

    axis.OuterTickLine.Color = Color.Blue

     

    ' minor ticks with yellow color

    axis.MinorTickLine.Color = Color.Yellow

    C#  

    // inner ticks with red color

    axis.InnerTickLine.Color = Color.Red;

     

    // outer ticks with blue color

    axis.OuterTickLine.Color = Color.Blue;

     

    // minor ticks with yellow color

    axis.MinorTickLine.Color = Color.Yellow;

    Related Examples

    Windows Forms: Axes\General\Ticks

    See Also

    Axis | LineProperties