Getting Started

This article will walk you through the setting up of a simple RadRadialGauge.

In order to set up the gauge you need to define the elements of the gauge you want to use. You need to set the axis minimum, maximum and step, so that the values of the indicators and the ranges are within the axis range and they can be positioned properly. Normally you will need at least one indicator, but you can add as many as needed. Adding gauge ranges is not necessary but is often valuable as they help give additional information about values within that range, for example too low, too high, or normal.

Before you proceed, please, take a look at these articles and follow the instructions to setup your app:

Setting up the gauge

Below you can see an example of a RadRadialGauge with a linear axis, two indicators and three gauge ranges.

Add the following namespaces:

using Telerik.XamarinForms.Common;
using Telerik.XamarinForms.DataVisualization.Gauges;

Proceed with defining the component:

<telerikGauges:RadRadialGauge x:Name="gauge">
        <telerikGauges:GaugeLinearAxis Maximum="200"
                                       Step="25" />
        <telerikGauges:GaugeNeedleIndicator Offset="30" Value="60" />
        <telerikGauges:GaugeShapeIndicator Value="80" />
            <telerikGauges:GaugeRange Color="Green"
                                      To="150" />
            <telerikGauges:GaugeGradientRange From="150" To="200">
                <telerikCommon:RadGradientStop Offset="150" Color="Yellow" />
                <telerikCommon:RadGradientStop Offset="200" Color="Red" />
RadRadialGauge gauge = new RadRadialGauge();
gauge.Axis = new GaugeLinearAxis { Minimum = 0, Maximum = 200, Step = 25 };
gauge.Indicators.Add(new GaugeNeedleIndicator { Value = 60, Offset = 30, });
gauge.Indicators.Add(new GaugeShapeIndicator { Value = 80 });
gauge.Ranges.Ranges.Add(new GaugeRange { From = 0, To = 150, Color = Color.Green });
GaugeGradientRange gradientRange = new GaugeGradientRange { From = 150, To = 200 };
gradientRange.GradientStops.Add(new RadGradientStop { Color = Color.Yellow, Offset = 150 });
gradientRange.GradientStops.Add(new RadGradientStop { Color = Color.Red, Offset = 200 });

Here is the result:

Gauge example

You can follow this tutorial to set up also the RadVerticalGauge and RadHorizontalGauge controls which expose the same API.

Gauge types

There are 3 gauge types that you can use to display different layout - radial and linear. You can read more about this in the Gauge Types section.

SDK Browser and QSF applications contain different examples that show Gauges' main features. You can find the applications in the Examples and QSF folders of your local Telerik UI for Xamarin installation.

See Also