Class SfRadialGauge
Represents a radial gauge control that is used to displays numerical values on a circular scale. It has a rich set of features such as axes, ranges, pointers, and annotations that are fully customizable and extendable. Use it to create speedometers, temperature monitors, dashboards, meter gauges, multi axis clocks, watches, activity gauges, compasses, and more.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Gauges
Assembly: Syncfusion.Gauge.WinUI.dll
Syntax
public class SfRadialGauge : Control, IDisposable
Examples
The below examples shows, how to initialize the radial gauge.
<gauge:SfRadialGauge>
<gauge:SfRadialGauge.Axes>
<gauge:RadialAxis>
<gauge:RadialAxis.Pointers>
<gauge:NeedlePointer Value="60"/>
</ gauge:RadialAxis.Pointers>
<gauge:RadialAxis.Ranges>
<gauge:GaugeRange StartValue="0" EndValue="100">
<gauge:GaugeRange.GradientStops>
<gauge:GaugeGradientStop Value="0" Color="Green" />
<gauge:GaugeGradientStop Value="50" Color="Orange" />
<gauge:GaugeGradientStop Value="100" Color="Red" />
</gauge:GaugeRange.GradientStops>
</gauge:GaugeRange>
</gauge:RadialAxis.Ranges>
<gauge:RadialAxis.Annotations>
<gauge:GaugeAnnotation DirectionUnit="Angle" DirectionValue="90" PositionFactor="0.7" >
<gauge:GaugeAnnotation.Content>
<TextBlock Text="{Binding ElementName=pointer,Path=Value}" />
</ gauge:GaugeAnnotation.Content>
</gauge:GaugeAnnotation>
</gauge:RadialAxis.Annotations>
</gauge:RadialAxis>
</gauge:SfRadialGauge.Axes>
</gauge:SfRadialGauge>
Constructors
SfRadialGauge()
Initializes a new instance of the SfRadialGauge class.
Declaration
public SfRadialGauge()
Examples
The below examples shows, how to creates a radial gauge with required axis.
<gauge:SfRadialGauge>
<gauge:SfRadialGauge.Axes>
<gauge:RadialAxis />
</gauge:SfRadialGauge.Axes>
</gauge:SfRadialGauge>
Fields
AxesProperty
Identifies the Axes dependency property.
Declaration
public static readonly DependencyProperty AxesProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for Axes dependency property. |
CanScaleToFitProperty
Identifies the CanScaleToFit dependency property.
Declaration
public static readonly DependencyProperty CanScaleToFitProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for CanScaleToFit dependency property. |
Properties
Axes
Gets or sets a collection of RadialAxis.
Declaration
public ObservableCollection<RadialAxis> Axes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<RadialAxis> | The collection of axes to display multiple axis. The default value is empty collection. |
Examples
The below examples shows, how to add a collection of radial axis to the gauge and customize each axis by adding it to the axes collection.
<gauge:SfRadialGauge>
<gauge:SfRadialGauge.Axes>
<gauge:RadialAxis>
<gauge:RadialAxis.Pointers>
<gauge:NeedlePointer Value = "60" />
</ gauge:RadialAxis.Pointers>
</gauge:RadialAxis>
<gauge:RadialAxis RadiusFactor = "0.5" />
</ gauge:SfRadialGauge.Axes>
</gauge:SfRadialGauge>
CanScaleToFit
Gets or sets a value indicating whether to adjust the half or quarter gauge to fit the axis boundary. If CanScaleToFit true, the center and radius position of the axis will be modified on the basis of the angle value.
Declaration
public bool CanScaleToFit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if CanScaleToFit is enabled; otherwise, false.The default value is true. |
Examples
The below examples shows, how to set CanScaleToFit property.
<gauge:SfRadialGauge CanScaleToFit="True" />
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resource in SfRadialGauge.
Declaration
public void Dispose()
Dispose(Boolean)
Disposing linear gauge objects.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Used to indicate perform dispose or not. |
MeasureOverride(Size)
Measures the size in layout required for child elements.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Size | availableSize | This size give to child elements. |
Returns
Type | Description |
---|---|
Windows.Foundation.Size | Return child element size. |
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type |
---|
Microsoft.UI.Xaml.Automation.Peers.AutomationPeer |
OnPointerMoved(PointerRoutedEventArgs)
Called when the pointer get moved.
Declaration
protected override void OnPointerMoved(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The pointer routed event arguments. |
OnPointerPressed(PointerRoutedEventArgs)
Called when the pointer get pressed.
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The pointer routed event arguments. |
OnPointerReleased(PointerRoutedEventArgs)
Called when the pointer get released.
Declaration
protected override void OnPointerReleased(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The pointer routed event arguments. |
OnTapped(TappedRoutedEventArgs)
Called when the gauge is tapped.
Declaration
protected override void OnTapped(TappedRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.TappedRoutedEventArgs | e | The tapped routed event arguments. |