)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set ticks and customize its position in circular gauge

Platform: Xamarin.Forms |
Control: SfCircularGauge |
Published Date: January 11, 2018 |
Last Revised Date: June 25, 2019

This article explains the steps required to set ticks and customize its position.

You can set minor and major ticks in circular gauge by using MajorTickSettings and MinorTickSettings properties.

Tick position can be customized by using the following two ways.

  1. For Outer Scale (below image), major and minor tick’s settings can be customized by StartOffset and EndOffset properties. StartOffset is used to set where the ticks start, and EndOffset is used to set where the ticks end.

 

XAML:

<xForms:SfCircularGauge x:Name="circularGauge" BackgroundColor="White" HeightRequest="160" WidthRequest="80">
    <xForms:SfCircularGauge.Scales>
        <gauge:Scale x:Name="scale1" StartAngle="135" SweepAngle="270"
                   StartValue="0" EndValue="240" Interval="20" MinorTicksPerInterval="1" RimColor="#C62E0A"  LabelOffset="0.88" LabelColor="#C62E0A" ScaleStartOffset="0.7" ScaleEndOffset="0.69">
  <gauge:Scale.MajorTickSettings>
       <gauge:TickSettings StartOffset="0.7" EndOffset="0.77" Thickness="2" Color="#C62E0A"/>
  </gauge:Scale.MajorTickSettings>
 
  <gauge:Scale.MinorTickSettings>
         <gauge:TickSettings StartOffset="0.7" EndOffset="0.75" Thickness="2" Color="#C62E0A"/>
   </gauge:Scale.MinorTickSettings>
 
    <gauge:Scale.Pointers>
      <gauge:MarkerPointer EnableDragging="True" x:Name="pointer1" Value="120"  Color="#C62E0A" Offset="0.69" MarkerShape="InvertedTriangle" />
      </gauge:Scale.Pointers>
      </gauge:Scale>
   </xForms:SfCircularGauge.Scales>
</xForms:SfCircularGauge>

 

  1. For Inner Scale, major and minor tick’s settings can be customized by using Offset and Length properties. Offset property is used to denote where the tick can be positioned, and Length property is used to increase or decrease the length of the tick.

XAML:

       
<xForms:Scale x:Name="scale2" StartAngle="135" SweepAngle="270"
                   StartValue="0" EndValue="160" Interval="40" MinorTicksPerInterval="1" RimColor="DarkGray"  LabelOffset="0.5" LabelColor="DarkGray" ScaleStartOffset="0.65" ScaleEndOffset="0.64">
                    <xForms:Scale.MajorTickSettings>
                        <xForms:TickSettings Offset="0.64" Length=”12” Thickness="2" Color="DarkGray"/>
                    </xForms:Scale.MajorTickSettings>
                    <xForms:Scale.MinorTickSettings>
                        <xForms:TickSettings Offset="0.64" Length=”6” Thickness="2" Color="DarkGray"/>
                    </xForms:Scale.MinorTickSettings>
                    <xForms:Scale.Pointers>
                        <xForms:MarkerPointer Value="80"  Color="DarkGray" Offset="0.64" MarkerShape="Triangle" />
                    </xForms:Scale.Pointers>
                </xForms:Scale>

 

The following screenshot illustrates the Customized Tick Settings in Gauge,

 

Ticks customization using xamarin SfCircularGauge

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon