How to customize the tick using style in the .NET MAUI Linear Gauge (SfLinearGauge)?
The Syncfusion® .NET MAUI Linear Gauge (SfLinearGauge) allows you to customize the tick. This demonstration explains how to customize the tick using style.
The .NET MAUI Linear Gauge has two types of ticks, namely major and minor ticks. The bigger ticks are referred to as major ticks, while the ones between the major ticks (smaller ticks) are called minor ticks. The MajorTickStyle and MinorTickStyle properties of a SfLinearGauge can be used to customize the major and minor ticks.
The major and minor ticks have similar properties that can be customized. The properties are as follows.
- Stroke - Allows you to change the color of the tick.
- StrokeThickness - Allows you to adjust the thickness of ticks.
- Length - Indicates the length of ticks.
- StrokeDashArray - Indicates the dash array of ticks.
XAML:
<gauge:SfLinearGauge VerticalOptions="Center" WidthRequest="600">
<gauge:SfLinearGauge.MajorTickStyle>
<gauge:LinearTickStyle Length="25"
Stroke="DarkBlue"
StrokeThickness="2"
StrokeDashArray="2,3"/>
</gauge:SfLinearGauge.MajorTickStyle>
<gauge:SfLinearGauge.MinorTickStyle>
<gauge:LinearTickStyle Length="15"
Stroke="DarkOrange"
StrokeThickness="1.5"
StrokeDashArray="2,2"/>
</gauge:SfLinearGauge.MinorTickStyle>
</gauge:SfLinearGauge>
Output:
Conclusion
I hope you enjoyed learning how to customize the tick using style in the .NET MAUI Linear Gauge (SfLinearGauge).
Refer to our .NET MAUI Linear Gauge feature tour page for other groundbreaking feature representations. You can also explore our .NET MAUI Linear Gauge documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Linear Gauge and other .NET MAUI components.
Please let us know in the comment section if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!