Class RadRadialGaugeElement
Represents the main radial gauge element that serves as a container for all other gauge components including needles, arcs, labels, and ticks. This element provides the core functionality for displaying values in a circular gauge format with customizable ranges, angles, and positioning.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI.Gauges
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadRadialGaugeElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadRadialGaugeElement()
Initializes a new instance of the RadRadialGaugeElement class with default settings including padding, item collection configuration, and supported gauge item types.
Declaration
public RadRadialGaugeElement()
Fields
ValueProperty
Identifies the Value dependency property used for storing the current gauge value.
Declaration
public static RadProperty ValueProperty
Field Value
RadProperty
|
Properties
AxisThickness
Gets or sets the thickness of the gauge axis in pixels, which affects the spacing and visual appearance of gauge elements and their positioning relative to the gauge center.
Declaration
protected double AxisThickness { get; set; }
Property Value
System.Double
|
CenterOffsetX
Gets or sets the horizontal offset of the gauge center as a proportional value, allowing fine adjustment of the gauge positioning within its container for optimal visual balance.
Declaration
public double CenterOffsetX { get; set; }
Property Value
System.Double
|
CenterOffsetY
Gets or sets the vertical offset of the gauge center as a proportional value, allowing fine adjustment of the gauge positioning within its container for optimal visual balance.
Declaration
public double CenterOffsetY { get; set; }
Property Value
System.Double
|
EndAngle
Gets the calculated end angle of the gauge arc by adding the SweepAngle to the StartAngle, representing the final position of the gauge arc in degrees.
Declaration
public double EndAngle { get; }
Property Value
System.Double
|
GaugeCenter
Gets the center point of the gauge as a System.Drawing.PointF, calculated from the GaugeSize and adjusted by the CenterOffsetX and CenterOffsetY properties for precise positioning.
Declaration
public PointF GaugeCenter { get; }
Property Value
System.Drawing.PointF
|
GaugeSize
Gets the bounding rectangle that defines the drawable area of the gauge, calculated based on the element size, padding, label positioning, and axis thickness to ensure proper gauge rendering.
Declaration
public RectangleF GaugeSize { get; }
Property Value
System.Drawing.RectangleF
|
Items
Gets the collection of gauge items including arcs, needles, labels, ticks, single labels, and backgrounds that comprise the complete gauge visualization. The collection supports design-time editing and serialization.
Declaration
[RadEditItemsAction]
public virtual RadItemOwnerCollection Items { get; }
Property Value
RadItemOwnerCollection
|
LabelOffset
Gets or sets the offset distance of labels from the gauge circumference, affecting the positioning of label elements around the gauge perimeter.
Declaration
protected double LabelOffset { get; set; }
Property Value
System.Double
|
LabelsPositionInside
Gets or sets a value indicating whether labels are positioned inside the gauge arc or outside the gauge circumference, affecting the overall layout and readability of the gauge.
Declaration
protected bool LabelsPositionInside { get; set; }
Property Value
System.Boolean
|
RangeEnd
Gets or sets the maximum value of the gauge range, which defines the upper boundary for valid gauge values. This value must be greater than RangeStart to maintain a valid range.
Declaration
public double RangeEnd { get; set; }
Property Value
System.Double
|
RangeStart
Gets or sets the minimum value of the gauge range, which defines the lower boundary for valid gauge values. This value must be less than RangeEnd to maintain a valid range.
Declaration
public double RangeStart { get; set; }
Property Value
System.Double
|
StartAngle
Gets or sets the starting angle of the gauge arc in degrees, measured clockwise from the positive X-axis. This angle defines where the gauge range begins and is used in conjunction with SweepAngle to determine the total arc.
Declaration
public double StartAngle { get; set; }
Property Value
System.Double
|
SweepAngle
Gets or sets the angular extent of the gauge arc in degrees, measured clockwise from the StartAngle. This property determines the total arc length available for displaying the gauge range.
Declaration
public double SweepAngle { get; set; }
Property Value
System.Double
|
Value
Gets or sets the current value displayed on the gauge, which must be within the range defined by RangeStart and RangeEnd properties. Changes to this property trigger the ValueChanged event.
Declaration
public float Value { get; set; }
Property Value
System.Single
|
Methods
CalculateNeedleAngle(Double, Double, Double, Double, Double)
Calculates the needle angle in degrees based on the specified value within the given range, mapping the value proportionally to the angular range defined by the start and sweep angles.
Declaration
public double CalculateNeedleAngle(double value, double rangeStart, double rangeEnd, double startAngle, double sweepAngle)
Parameters
System.Double
value
The value to convert to an angle position on the gauge. |
System.Double
rangeStart
The minimum value of the gauge range. |
System.Double
rangeEnd
The maximum value of the gauge range. |
System.Double
startAngle
The starting angle of the gauge arc in degrees. |
System.Double
sweepAngle
The angular extent of the gauge arc in degrees. |
Returns
System.Double
The calculated needle angle in degrees, positioned proportionally within the gauge arc. |
OnNotifyPropertyChanged(String)
Notifies subscribers about property changes and invalidates the element to trigger a repaint. This method is called internally when gauge properties are modified.
Declaration
protected override void OnNotifyPropertyChanged(string propertyName)
Parameters
System.String
propertyName
The name of the property that changed. |
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Called after a property value has changed to handle post-change processing. For the ValueProperty, ensures the value remains within range and triggers appropriate notifications.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
Event arguments containing the changed property and its old and new values. |
Overrides
OnPropertyChanging(RadPropertyChangingEventArgs)
Called before a property value changes to validate the new value and potentially cancel the change. For the ValueProperty, ensures the new value falls within the valid range.
Declaration
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args)
Parameters
RadPropertyChangingEventArgs
args
Event arguments containing the property, old value, new value, and cancellation flag. |
Overrides
OnValueChanged()
Raises the ValueChanged event and tracks analytics when the gauge value changes, providing notification to subscribers about value modifications.
Declaration
protected void OnValueChanged()
Events
ValueChanged
Occurs when the Value property changes, allowing subscribers to respond to gauge value modifications.
Declaration
public event EventHandler ValueChanged
Event Type
System.EventHandler
|