Articles in this section

How to customize the scale track using style in the .NET MAUI Linear Gauge (SfLinearGauge)?

In this article, you can learn about customizing the scale track of the Syncfusion® .NET MAUI Linear Gauge (SfLinearGauge). The following demonstration helps you to understand scale track customization with the LineStyle property.

The LineStyle property is used to customize the linear scale track. The following are LineStyle’s properties.

  • Thickness - Used to change the scale track’s thickness.
  • Fill - Used to change the color of the scale track to a solid color.
  • GradientStops - Changes the gradient color of the scale track.
  • CornerRadius - Sets the radius of the scale track edge corners.
  • CornerStyle - Sets the flat or curved scale track edge style.

XAML:

The following code example explains how to customize with Thickness, Fill, and CornerRadius properties.

<gauge:SfLinearGauge VerticalOptions="Center" WidthRequest="600">
   <gauge:SfLinearGauge.LineStyle>
       <gauge:LinearLineStyle Thickness="15" Fill="CadetBlue" CornerRadius="0,10,0,10"/>
   </gauge:SfLinearGauge.LineStyle>
</gauge:SfLinearGauge>

XAML:

The following code example explains how to customize with GradientStops and CornerStyle properties.

<gauge:SfLinearGauge.LineStyle>
   <gauge:LinearLineStyle CornerStyle="BothCurve">
       <gauge:LinearLineStyle.GradientStops>
           <gauge:GaugeGradientStop Value="0" Color="Blue"/>
           <gauge:GaugeGradientStop Value="100" Color="Red"/>
       </gauge:LinearLineStyle.GradientStops>
   </gauge:LinearLineStyle>
</gauge:SfLinearGauge.LineStyle>

Output:

Scale track customization with Thickness, Fill, and CornerRadius properties.

ScaleTrackStyle.png

Scale track customization with GradientStops and CornerStyle properties.

ScaleTrackStyleGradient.png

Conclusion:

I hope you enjoyed learning how to customize the scale track using Style in the .NET MAUI Linear Gauge (SfLinearGauge).

Refer to our .NET MAUI Linear Gauge feature tour page to learn about its 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!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied