menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class ChartAxisTickStyle - MAUI-ToolKit 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.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.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>
                  &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
    Remarks

    The identifier for the Stroke bindable property determines the stroke color of the axis tick.

    StrokeWidthProperty

    Identifies the StrokeWidth bindable property.

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

    The identifier for the StrokeWidth bindable property determines the stroke width of the axis tick.

    TickSizeProperty

    Identifies the TickSize bindable property.

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

    The identifier for the TickSize bindable property determines the length of the axis tick.

    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 default 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 default value is 8.

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