Gauge Blazor API

Gauge Properties

NameTypeDefaultDescription
AnalogDisplayTypeGaugeAnalogDisplayTypeGaugeAnalogDisplayType.NeedleDetermines the type of gauge's indicator.
AnimationDurationint300Sets or gets gauge's animation duration. Applicable only when animation is not 'none'.
CoerceboolfalseWith the coerce property true, the value is set to the nearest value allowed by the interval property.
CustomIntervalboolfalseSets or gets whether custom ticks at (possibly) uneven interval will be plotted. The ticks to be plotted are defined with the property customTicks.
CustomTicksint[]new int[]{}If customInterval is enabled, sets a list of ticks to be plotted. If coerce is set to true, the value will snap to these ticks.
DateLabelFormatStringstring"d"Determines the date pattern of the labels when mode is 'date'.
DecimalSeparatorstring"".""Sets or gets the char to use as the decimal separator in numeric values.
DigitalDisplayboolfalseEnables or disables the digital display of the element.
DigitalDisplayPositionGaugeDigitalDisplayPositionGaugeDigitalDisplayPosition.BottomSets the position of the digital display inside the element.
DisabledboolfalseEnables or disables the element.
DrawNeedleobjectN/ACallback function which allows rendering of a custom needle. Applicable only to analogDisplayType needle.
EndAngleint210Sets or gets Gauge's end angle. This property specifies the end of the gauge's scale and is measured in degrees.
Intervalint1When cooerce property is true, all values coerce to the interval's value.
InvertedboolfalseSets the direction of the gauge. If true - the positions of the gauge's start and end are switched.
LabelFormatFunctionobjectN/AA callback function that can be used to format the values displayed inside the gauge labels.
LabelsVisibilityLabelsVisibilityLabelsVisibility.AllDetermines the visibility of the labels inside the element.
Localestring"en"Sets or gets the locale. Used in conjunction with the property messages.
LogarithmicScaleboolfalseEnables or disables the usage of logarithmic scale in the element.
Maxint100Determines the maximum value for the scale of the element.
MechanicalActionDragMechanicalActionDragMechanicalAction.SwitchWhileDraggingDetermines when the value of the element is updated.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
Minint0Determines the minimum value for the scale of the element.
ModeScaleModeScaleMode.NumericDetermines whether the element works with numbers or dates.
Namestring""Sets or gets the element's name, which is used as a reference when the data is submitted.
NeedlePositionGaugeNeedlePositionGaugeNeedlePosition.CenterDetermines the position of the needle when analogDisplayType is 'needle'.
PrecisionDigitsintN/ADetermines the number of digits after the decimal point. Applicable only when scaleType is 'floatingPoint'.
RangesIEnumerable<object>N/AThis property represents an array of objects. Each object is a different range. The range is a colored area with specific size.
ReadonlyboolfalseWhen the element is read only the users cannot interact with it.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. If enabled, the scale is inverted and the labels and digital display are oriented from right to left.
ScalePositionGaugeScalePositionGaugeScalePosition.InsideDetermines the position of the scale in the element.
ScaleTypeScaleTypeScaleType.FloatingPointDetermines the type of the gauge's value and scale.
ScientificNotationboolfalseEnables or disables scientific notation.
ShowRangesboolfalseThis property indicates whether the gauge ranges are visible or not.
ShowUnitboolfalseEnables or disables displaying of units.
SignificantDigitsint?N/ADetermining how many significant digits are in a number. Applicable only when scaleType is 'integer'.
SizeModeGaugeSizeModeGaugeSizeMode.CircleDetermines how the Gauge will size.
StartAngleint-30Sets or gets gauge's start angle. This property specifies the beggining of the gauge's scale and is measured in degrees.
Themestring""Sets or gets the element's visual theme.
TicksPositionTicksPositionTicksPosition.ScaleDetermines the position of the ticks in the Gauge.
TicksVisibilityTicksVisibilityTicksVisibility.MinorDetermines the visibility of the ticks.
UnfocusableboolfalseSets or gets if the element can be focused.
Unitstring"kg"Sets or gets the name of unit used for the values on the scale of the element.
ValidationValidationValidation.StrictSets the value's validation by min/max.
Valueobject0Sets or gets the value of the element. The value can be a date only when scaleType is 'date'.
WordLengthWordLengthWordLength.Int32Sets or gets the word length. Applicable only when scaleType is 'integer'.

Gauge Methods

NameTypeArgumentsDescription
GetOptimalSizeobjectN/AGets the optimal size of the element (the current width and the height based on the plotted internal elements).
GetValueAsync()Task<object>'N/A'Gets the &quot;Value&quot; property as Task&lt;object&gt;.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
Valstringobject valueGet/set the value of the gauge.Args: object value - The value to be set. If no parameter is passed, returns the current value of the gauge. The value can be a date only when <b>scaleType</b> is 'date'.
ValstringN/AGet/set the value of the gauge.
Valstringstring valueGet/set the value of the gauge.Args: string value - The value to be set. If no parameter is passed, returns the current value of the gauge. The value can be a date only when <b>scaleType</b> is 'date'.
Valstringint valueGet/set the value of the gauge.Args: int value - The value to be set. If no parameter is passed, returns the current value of the gauge. The value can be a date only when <b>scaleType</b> is 'date'.

Gauge Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered when the value of the element is changed.dynamic oldValue- The previous value of the element., dynamic value- The new value of the element.
Changedevent GaugeChangedEventHandlerThis event is triggered when the value of the element is changed.GaugeChangedEventArgs

Enums

GaugeAnalogDisplayType

GaugeAnalogDisplayType.Needle
GaugeAnalogDisplayType.Fill
GaugeAnalogDisplayType.Line

GaugeDigitalDisplayPosition

GaugeDigitalDisplayPosition.Bottom
GaugeDigitalDisplayPosition.Center
GaugeDigitalDisplayPosition.Right
GaugeDigitalDisplayPosition.Top

LabelsVisibility

LabelsVisibility.All
LabelsVisibility.EndPoints
LabelsVisibility.None

DragMechanicalAction

DragMechanicalAction.SwitchUntilReleased
DragMechanicalAction.SwitchWhenReleased
DragMechanicalAction.SwitchWhileDragging

ScaleMode

ScaleMode.Date
ScaleMode.Numeric

GaugeNeedlePosition

GaugeNeedlePosition.Center
GaugeNeedlePosition.Edge

GaugeScalePosition

GaugeScalePosition.Inside
GaugeScalePosition.Outside
GaugeScalePosition.None

ScaleType

ScaleType.FloatingPoint
ScaleType.Integer

GaugeSizeMode

GaugeSizeMode.Auto
GaugeSizeMode.Circle
GaugeSizeMode.None

TicksPosition

TicksPosition.Scale
TicksPosition.Track

TicksVisibility

TicksVisibility.Major
TicksVisibility.Minor
TicksVisibility.None

Validation

Validation.Interaction
Validation.Strict

WordLength

WordLength.Int8
WordLength.Int16
WordLength.Int32
WordLength.Int64
WordLength.Uint8
WordLength.Uint16
WordLength.Uint32
WordLength.Uint64