Xamarin.iOS Documentation | ComponentOne
Controls / Gauge / Features / Range
In This Topic
    Range
    In This Topic

    You can add multiple ranges to a single Gauge. Each range denotes a region or a state which can help the user identify the state of the Gauge's value. Every range has its Min and Max properties that specify the range's position on the Gauge, as well as Color and Thickness properties that define the range's appearance.

    The following code example demonstrates how to add ranges to a Gauge and set its properties.

    In Code

    Create new instances of type GaugeRange, set their properties and add the newly created ranges to the LinearGauge (or RadialGauge/BulletGraph).

    C#
    Copy Code
    GaugeRange low = new GaugeRange();
    GaugeRange med = new GaugeRange();
    GaugeRange high = new GaugeRange();
    
    //Customize Ranges
    low.Color = UIColor.Red;
    low.Min = 0;
    low.Max = 40;
    med.Color = UIColor.Yellow;
    med.Min = 40;
    med.Max = 80;
    high.Color = UIColor.Green;
    high.Min = 80;
    high.Max = 100;
            
    //Add Ranges to Gauge
    linearGauge.Ranges.Add(low);
    linearGauge.Ranges.Add(med);
    linearGauge.Ranges.Add(high);
    this.Add(linearGauge);
    
    See Also