Articles in this section
Category / Section

How to set RangeCap to RangePointer in Xamarin.Forms SfCircularGauge

1 min read

The RangePointer of SfCircularGauge has rounded corner support to add rounded edge to the start, end, and both sides of the pointer using the RangeCap property. To set rounder corner at the start of the pointer, use RangeCap as Start, and to set rounder corner at the end of the pointer, use RangeCap as End. Similarly, set rounded corner to the both sides using the RangeCap as Both.

The following code snippet demonstrates how to set range cap for range pointer.

XAML

    <gauge:SfCircularGauge >
        <gauge:SfCircularGauge.Scales>
            <gauge:Scale>
 
                <gauge:Scale.Pointers>
                    <gauge:RangePointer Value="80" RangeStart="20" RangeCap="Both" Thickness="10"  Offset="0.75" Color="Red"/>
                </gauge:Scale.Pointers>
 
            </gauge:Scale>
        </gauge:SfCircularGauge.Scales>
    </gauge:SfCircularGauge>

 

C#

            SfCircularGauge gauge = new SfCircularGauge();
        
            Scale scale = new Scale();
 
            RangePointer rangePointer = new RangePointer();
            rangePointer.Value = 80;
            rangePointer.RangeStart = 20;
            rangePointer.RangeCap = RangeCap.Both;
            rangePointer.Thickness = 10;
            rangePointer.Offset = 0.75;
            rangePointer.Color = Color.Red;
 
            scale.Pointers.Add(rangePointer);
            gauge.Scales.Add(scale);

 

Output:

The following screenshot illustrates the result of setting range cap for range pointer at the start, end, and both sides of the pointer.

Range cap for range pointer using Xamain SfCircularGauge

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