Skip to content

Adds a Gauge Chart to your Dashboard. This can be configured with custom types (half, 3/4), styles (rounded, needle) and segmentation with examples detailed below.

Screenshot showing each gauge type side-by-sideScreenshot showing each gauge type side-by-side

Input

Values for the gauges can be set by sending a numerical value in msg.payload. The gauge will then update to reflect this value.

Properties

PropDynamicDescription
GroupDefines which group of the UI Dashboard this widget will render in.
SizeControls the width of the dropdown with respect to the parent group. Maximum value is the width of the group.
TypeDefines the shape of the gauge, "Tile", "Battery", "Water Tank", "Half Gauge" or "3/4 Gauge"
StyleDefines the style of arc rendered, "Needle" or "Rounded". (only applicable to for 3/4 and Half gauges)
Range (min)The smallest value that can be shown on the gauge
Range (max)The largest value that can be shown on the gauge
SegmentsDefines the barriers by which the arc is color coded. These segments can also be shown on the gauge.
LabelText shown above the gauge, labelling what the gauge is showing.
PrefixText to be added _before_ the value in the middle of the gauge. (only applicable to for 3/4 and Half gauges)
SuffixText to be shown _after_ the value in the middle of the gauge. (only applicable to for 3/4 and Half gauges)
UnitsSmall text to be shown below the value in the middle of the gauge. (only applicable to for 3/4 and Half gauges)
IconIcon to be shown below the value in the middle of the gauge. Uses Material Designs Icon, no need to include the mdi- prefix. (only applicable to for 3/4 and Half gauges)
Sizes (Gauge)(px) How thick the arc and backdrop of the gauge are rendered.
Sizes (Gap)(px) How big the gap/padding is between the Gauge and the "Segments"
Sizes (Segments)(px) How thick the segments are rendered.

Dynamic Properties

Dynamic properties are those that can be overriden at runtime by sending a particular msg to the node.

Where appropriate, the underlying values set within Node-RED will be overriden by the values set in the received messages.

PropPayloadStructuresExample Values
Labelmsg.ui_update.labelString
Iconmsg.ui_update.iconString
Typemsg.ui_update.gtypeString
gauge-tile|gauge-battery|gauge-tank|gauge-half|gauge-34
Stylemsg.ui_update.gstyleString
Minmsg.ui_update.minNumber
Maxmsg.ui_update.maxNumber
Segmentsmsg.ui_update.segmentsArray<{color: String, from: Number}>
Prefixmsg.ui_update.prefixString
Suffixmsg.ui_update.suffixString
Unitsmsg.ui_update.unitsString

Controls

msg.ExampleDescription
enabledtrue | falseAllow control over whether or not the number-input is enabled

Examples

Half Gauge - Rounded

TypeStyleSize (Gauge)Size (Gap)Size (Segments)
Half GaugeRounded1628

Example of a Half Gauge, showing a rounded arcExample of a Half Gauge, showing a rounded arc.

Half Gauge - Needle

TypeStyleSuffixSize (Gauge)Size (Gap)Size (Segments)
Half GaugeNeedle%0032

Example of a Half Gauge, showing a needle with segments-onlyExample of a Half Gauge, showing a needle with segments-only.

3/4 Gauge - Rounded

TypeStyleSize (Gauge)Size (Gap)Size (Segments)
3/4 GaugeRounded1600

Example of a 3/4 Gauge, showing a rounded arc with no segmentsExample of a 3/4 Gauge, showing a rounded arc with no segments.

3/4 Gauge - Needle

TypeStyleSize (Gauge)Size (Gap)Size (Segments)
3/4 GaugeNeedle3226

Example of a 3/4 Gauge, showing a needle with segments and an arcExample of a 3/4 Gauge, showing a needle with segments and an arc.

Tile

TypeLabel
TileMy Tile

Examples of some Tile GaugesExamples of some Tile Gauges

Battery Added In: v1.15.0

Type
Battery

Examples of some horizontal Battery GaugesExamples of some horizontal Battery Gauges

Water Tank Added In: v1.15.0

Type
Water Tank

Examples of some Water Tank gaugesExamples of some Water Tank gauges

When switching to a "Water Tank" type, the segments will be overridden with the following values:

js
[{
    color: '#A8F5FF',
    from: 0
}, {
    color: '#55DBEC',
    from: 15
}, {
    color: '#53B4FD',
    from: 35
}, {
    color: '#2397D1',
    from: 50
}]

Overriding CSS

The gauge can be styled further by adding custom CSS to the ui_template node. Some useful classes that are available for styling include:

  • .nrdb-ui-gauge-value span - The value in the middle of the gauge
  • .nrdb-ui-gauge-value label - The unit label
  • .nrdb-ui-gauge-value i - The icon
  • .nrdb-ui-gauge-icon-only i - Available when a gauge has an icon but no "unit" label
  • .nrdb-ui-gauge #limits - The containing <g> element that wraps min/max <text> elements