Rim

Scale determines the structure of a circular gauge by using the circular rim. By setting the StartAngle and SweepAngle properties, you can change the shape of the circular gauge into a full circular gauge, half circular gauge, or quarter circular gauge.

The StartValue and EndValue properties will determine the overall range of the circular rim.

  • c#
  • SFCircularGauge circularGauge = new SFCircularGauge();
                ObservableCollection<SFCircularScale> scales = new ObservableCollection<SFCircularScale>();
                SFCircularScale scale = new SFCircularScale();
                scale.StartAngle = -180;
                scale.SweepAngle = 180;
                scale.StartValue = 0;
                scale.EndValue = 360;
                scale.Interval = 20;
                scale.MinorTicksPerInterval = 0;
                scale.ShowFirstLabel = false;
                circularGauge.Scales.Add(scale);
                this.View.AddSubview(circularGauge);

    Rim customization

    The color and thickness of rim can be set by using the RimColor and RimWidth properties. To increase the RimWidth, set the RadiusFactor.

  • c#
  • SFCircularGauge circularGauge = new SFCircularGauge();
                ObservableCollection<SFCircularScale> scales = new ObservableCollection<SFCircularScale>();
                SFCircularScale scale = new SFCircularScale();
                scale.StartValue = 0;
                scale.EndValue = 100;
                scale.RadiusFactor = 1;
                scale.RimWidth = 40;
                scale.LabelOffset = 0.6f;
                scale.MajorTickSettings.Offset = 0.8f;
                scale.MinorTickSettings.Offset = 0.8f;
                scale.RimColor = UIColor.FromRGB(135,206,250);
                circularGauge.Scales.Add(scale); 
                this.View.AddSubview(circularGauge);

    Setting position for rim

    You can customize the position of Scales in the following two ways:

    1. RadiusFactor with the RimWidth property.
    2. The ScaleStartOffset and ScaleEndOffset properties.

    Setting radius factor for rim

  • c#
  • SFCircularGauge circularGauge = new SFCircularGauge();
                ObservableCollection<SFCircularScale> scales = new ObservableCollection<SFCircularScale>();
                SFCircularScale scale = new SFCircularScale();
                scale.StartValue = 0;
                scale.EndValue = 100;
                scale.RadiusFactor = 0.7f;
                scale.RimWidth = 30;
                circularGauge.Scales.Add(scale); 
                this.View.AddSubview(circularGauge);

    Setting scale start and end offsets for rim

  • c#
  • SFCircularGauge circularGauge = new SFCircularGauge();
                ObservableCollection<SFCircularScale> scales = new ObservableCollection<SFCircularScale>();
                SFCircularScale scale = new SFCircularScale();
                scale.StartValue = 0;
                scale.EndValue = 100;
                scale.ScaleStartOffset = 0.6f;
                scale.ScaleEndOffSet = 0.7f;
                circularGauge.Scales.Add(scale); 
                this.View.AddSubview(circularGauge);

    Show rim

    The ShowRim property is a Boolean property, which is used to enable or disable the rim in circular gauge.

  • c#
  • SFCircularGauge circularGauge = new SFCircularGauge();
                ObservableCollection<SFCircularScale> scales = new ObservableCollection<SFCircularScale>();
                SFCircularScale scale = new SFCircularScale();
                scale.StartValue = 0;
                scale.EndValue = 100;
                scale.ShowRim = false;
                circularGauge.Scales.Add(scale); 
                this.View.AddSubview(circularGauge);