Gauge
The Gauge control displays a numerical value using a speedometer style indicator. Its value is typically set by commands received from a connected device. You can attach up to four labels to the gauge which can be used to display units and status information. The first label can display the current gauge value as a number. Parts of the gauge scale can be marked using colored bands to indicate target or out-of-range values on the scale.
The gauge value is a floating point number.
Properties
The gauge control has many properties, which are tabulated below. The diagram illustrates the key measurements that control the scale layout. Values are scaled up or down to fit the control Size
when GaugeAutoScale
is true
.
Property | Access | Type | Method | Description |
---|---|---|---|---|
Center | Design-only | Point | — | Sets the center position of the gauge when GaugeAutoSize is true . |
GaugeAutoSize | Design-only | bool | – | When true, the gauge automatically resizes to fit the control rectangle |
GaugeLabels | Design-only | Collection | – | A collection of labels attached to the gauge |
Label0, Label1, Label2, Label3 | Read/Write | string | SetGaugeLabel | Get/set the current value a gauge label for serial commands, if the label is present in the GaugeLabels collection. |
GaugeRanges | Design-only | Collection | – | A collection of colored bands attached to the scale |
BaseArcColor | Design-only | Color | — | Color of the gauge ring |
NeedleColor1 | Design-only | Color | — | Color for needle highlight lines |
NeedleColor2 | Design-only | Color | — | Color for needle fill |
ScaleLinesInterColor | Design-only | Color | — | Color for significant tick marks between labeled tick marks |
ScaleLinesMajorColor | Design-only | Color | — | Color for labeled tick marks |
ScaleLinesMinorColor | Design-only | Color | — | Color for minor tick marks |
ScaleNumbersColor | Design-only | Color | — | Color for tick labels |
ScaleNumbersFormat | Design-only | String | – | The format for numbers shown on the scale |
ScaleNumbersRadius | Design-only | Number | — | Radius of the circle that numbers are drawn just inside. |
ScaleNumbersRotation | Design-only | Number | — | Angle to draw scale numbers relative to the base arc. 0 draws numbers horizontally; 1 draws them around the inside of the number arc. |
ScaleNumbersStartScaleLine | Design-only | Number | — | The tick number (starting from 1) where the first tick label should be drawn. |
NeedleRadius | Design-only | Number | — | The radius of the needle. |
NeedleType | Design-only | Advance | Simple | — | The shape of the needle drawn. |
NeedleWidth | Design-only | Number | — | Width of the needle. |
BaseArcRadius | Design-only | Integer | – | Radius of the arc surrounding the gauge. |
BaseArcStart | Design-only | Integer | – | The angle where the scale begins. Relative to an analog clock, 0 would be at 3 o’clock; 90 would be at 6 o’clock; 180 would be at 9 o’clock and 270 would be at 12 o’clock. |
BaseArcSweep | Design-only | Integer | – | The length of the scale arc, in degrees. 180° is half a circle; 270° is three-quarters of a circle |
BaseArcWidth | Design-only | Integer | – | Width of the base arc line. |
ScaleLinesInterInnerRadius | Design-only | Single | – | The inner radius of intermediate tick marks. |
ScaleLinesInterOuterRadius | Design-only | Single | – | The outer radius of intermediate tick marks. |
ScaleLinesInterWidth | Design-only | Single | – | The width lines drawn for intermediate tick marks. |
ScaleLinesMajorInnerRadius | Design-only | Single | – | The inner radius of major tick marks. |
ScaleLinesMajorOuterRadius | Design-only | Single | – | The outer radius of major tick marks. |
ScaleLinesMajorWidth | Design-only | Single | – | The width lines drawn for major tick marks. |
ScaleLinesMajorStepValue | Design-only | Single | – | The interval between numbered major-ticks on the scale |
ScaleLinesMinorInnerRadius | Design-only | Single | – | The inner radius of minor tick marks. |
ScaleLinesMinorOuterRadius | Design-only | Single | – | The outer radius of minor tick marks. |
ScaleLinesMinorWidth | Design-only | Single | – | The width lines drawn for minor tick marks. |
ScaleLinesMinorTicks | Design-only | Single | – | The number of unnumbered ticks between numbered major-ticks on the scale |
MinValue | Design-only | Single | SetMinimum | The minimum value shown on the gauge scale |
MaxValue | Design-only | Single | SetMaximum | The maximum value shown on the gauge scale |
Name | Read only | string | – | The name of the control |
DisplayValueOnLabel | Design-only | bool | – | When true, the gauges current value is displayed on the first label |
Value | Read/write | float | SetNumber | The current value |
This control also supports all the common control properties.
Gauge labels
Labels can be included to display text on the gauge. Labels can be static (showing units, for example) or dynamically display the current gauge value. They can also be changed by sending serial commands to the interface panel from your Arduino sketch.
Use the ellipsis control (…) on the GaugeLabels
property to open the label collection editor. The collection editor lets you add, remove and edit the labels attached to the gauge. Each label is positioned relative to the center of the gauge with positive values moving the label down and to the right.
The first label shows the current gauge value when the gauge control’s DisplayValueOnLabel
is true. You must still create and position at least one gauge label to display the gauge value when DidsplayValueOnLabel
is true.
Use SetGaugeLabel(ControlName, LabelIndex, LabelText)
to change the label text from your Arduino sketch.
Gauge Ranges
Gauge ranges provide a way to highlight different regions of the gauge scale with different colors. These regions could indicate normal and abnormal ranges for the measurement shown.
Use the ellipsis control(…) on the GaugeRanges
property to open the range collection editor. The collection editor lets you add, remove and edit the colored range bars attached to the gauge scale. Each band includes a Color
property and Start
and End
properties which set the portion of the scale that is colored.