Rim
18 Nov 2018 / 6 minutes to read
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.
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
.
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:
-
RadiusFactor
with theRimWidth
property. - The
ScaleStartOffset
andScaleEndOffset
properties.
Setting radius factor for rim
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
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.
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);
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page