Class ChartAxisTickStyle
Represents a style class that can be used to customize the axis's tick.
Inheritance
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>
<chart:SfCartesianChart.XAxes>
<chart:NumericalAxis MinorTicksPerInterval="4">
<chart:NumericalAxis.MajorTickStyle>
<chart:ChartAxisTickStyle Stroke="Red" StrokeWidth="1"/>
</chart:NumericalAxis.MajorTickStyle>
</chart:NumericalAxis>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart></code></pre>
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. |
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. |