Articles in this section
Category / Section

How to apply gradient to the scale track in .NET MAUI Linear Gauge (SfLinearGauge)?

In the Syncfusion® .NET MAUI Linear Gauge (SfLinearGauge), you can apply gradient to the scale track. This article explains how to apply gradient to the scale track in the following demonstration.

XAML
The GradientStops property of LineStyle can be used to apply a linear gradient to the scale track, while the Fill property is used to apply a solid color. Here, the Value and Color properties help to set the value and color, respectively, where the gradient color is to be applied.

<Grid HorizontalOptions="Center" VerticalOptions="Center">
   <gauge:SfLinearGauge WidthRequest="500">
       <gauge:SfLinearGauge.LineStyle>
           <gauge:LinearLineStyle>
               <gauge:LinearLineStyle.GradientStops>
                   <gauge:GaugeGradientStop Value="0" Color="Green"/>
                   <gauge:GaugeGradientStop Value="40" Color="GreenYellow"/>
                   <gauge:GaugeGradientStop Value="100" Color="Red"/>
               </gauge:LinearLineStyle.GradientStops>
           </gauge:LinearLineStyle>
       </gauge:SfLinearGauge.LineStyle>
   </gauge:SfLinearGauge>
</Grid> 

Output:

ApplyGradient.png

Conclusion:

I hope you enjoyed learning how to apply a gradient to the scale track in .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