ClassRadRadialGaugeElement
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.
Definition
Namespace:Telerik.WinControls.UI.Gauges
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadRadialGaugeElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadRadialGaugeElement
Implements:
Inherited Members
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.
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.
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.
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.
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.
GaugeCenter
Gets the center point of the gauge as a PointF, calculated from the GaugeSize and adjusted by the CenterOffsetX and CenterOffsetY properties for precise positioning.
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.
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
LabelOffset
Gets or sets the offset distance of labels from the gauge circumference, affecting the positioning of label elements around the gauge perimeter.
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.
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.
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.
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.
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.
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
[Bindable(true)]
public float Value { get; set; }
Property Value
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
value
The value to convert to an angle position on the gauge.
rangeStart
The minimum value of the gauge range.
rangeEnd
The maximum value of the gauge range.
startAngle
The starting angle of the gauge arc in degrees.
sweepAngle
The angular extent of the gauge arc in degrees.
Returns
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
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
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
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.