Articles in this section
Category / Section

How to set ticks and customize its position in circular gauge

1 min read

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

 

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