menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartAxisTickStyle - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartAxisTickStyle

    Represents a style class that can be used to customize the axis's tick.

    Inheritance
    System.Object
    ChartAxisTickStyle
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class ChartAxisTickStyle : Element, IThemeElement
    Remarks

    To customize the chart axis's tick, create an instance of ChartAxisTickStyle and set it to the MajorTickStyle property as shown in the following code sample.

    # [MainWindow.xaml](#tab/tabid-1)
        <chart:SfCartesianChart>
    
          &lt;chart:SfCartesianChart.XAxes>
              &lt;chart:NumericalAxis MinorTicksPerInterval=&quot;4&quot;>
                  &lt;chart:NumericalAxis.MajorTickStyle>
                      &lt;chart:ChartAxisTickStyle Stroke=&quot;Red&quot; StrokeWidth=&quot;1&quot;/>
                  &lt;/chart:NumericalAxis.MajorTickStyle>
              &lt;/chart:NumericalAxis>
          &lt;/chart:SfCartesianChart.XAxes>
    
          &lt;chart:SfCartesianChart.YAxes>
              &lt;chart:NumericalAxis/>
          &lt;/chart:SfCartesianChart.YAxes>
    
    &lt;/chart:SfCartesianChart></code></pre>
    
    • MainWindow.cs
        SfCartesianChart chart = new SfCartesianChart();
    
        NumericalAxis xAxis = new NumericalAxis();
        xAxis.MajorTickStyle.StrokeWidth = 1;
        xAxis.MajorTickStyle.Stroke = new SolidColorBrush(Colors.Red);
        chart.XAxes.Add(xAxis);
    
        NumericalAxis yAxis = new NumericalAxis();
        chart.YAxes.Add(yAxis)

    It provides more options to customize the chart axis title.

    TickSize - To customize the length of the axis tick, refer to this TickSize property.

    Stroke - To customize the color of the axis tick, refer to this Stroke property.

    StrokeWidth - To customize the width of the axis ticks, refer to this StrokeWidth property.

    Constructors

    ChartAxisTickStyle()

    Initializes a new instance of the ChartAxisTickStyle.

    Declaration
    public ChartAxisTickStyle()

    Fields

    StrokeProperty

    Identifies the Stroke bindable property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StrokeWidthProperty

    Identifies the StrokeWidth bindable property.

    Declaration
    public static readonly BindableProperty StrokeWidthProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    TickSizeProperty

    Identifies the TickSize bindable property.

    Declaration
    public static readonly BindableProperty TickSizeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    Stroke

    Gets or sets a value to customize the stroke color of the axis's tick.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    It accepts Microsoft.Maui.Controls.Brush values.

    StrokeWidth

    Gets or sets a value that indicates the width of the axis's tick.

    Declaration
    public double StrokeWidth { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and the defaule value is 1.

    Remarks

    The value needs to be greater than zero.

    TickSize

    Gets or sets a value that indicates the length of the axis's tick.

    Declaration
    public double TickSize { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and the defaule value is 8.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved