Digital horizontal bar
Preconfigured gauge to display any value reading as a horizontal bar. Allows to configure value range, gradient colors, and other settings.
Who it’s for
Dashboard builders fitting a ranged reading with a danger zone into a wide, shallow tile — a rate across the top of a screen, a row of process values down the side, on a dark instrument-style board.
What it does
The Digital horizontal bar draws a reading as a glowing segmented bar filling left to right, colored green through amber to red as it climbs. The default 0–180 scale captioned MPH puts the value and unit beside the bar on a dark face, in a 6×2.5 tile that stacks cleanly with other bars.
- Built for a wide tile — a horizontal bar uses the width a dial would waste, so several stack into a compact panel.
- The green-amber-red ramp ships configured, so position against a limit is readable without the number.
- Segmented fill and a glow give the instrument-panel look on a dark board.
- Animated movement is on by default, so a rising value reads as movement.
- Minimum and maximum are printed at the bar’s ends, keeping the scale explicit.
- Units are converted, not just appended — the gauge respects the unit set on the key and converts to the unit chosen on the widget.
- The Digital horizontal bar shows one current reading: it is a styling preset of the same gauge engine as the plain Horizontal bar.
How to set up
Data keys
The Digital horizontal bar takes one datasource, one entity and one data key.
| Key | Role | Type | Description |
|---|---|---|---|
| Any numeric key | The value the bar fills to | Timeseries | Numeric only. An attribute works equally well. The key’s own units and decimals override the widget-level ones. |
Range
| Setting | Default | Effect |
|---|---|---|
| Min value | 0 | The left end of the bar |
| Max value | 180 | The right end; the default is a speed range and should be set to your own |
| Units title | MPH | The caption beside the value |
| Bar color levels | Green, amber, red | The ramp the fill moves through as the value rises |
| Label | Off | The caption above the value, off in this preset |
How to customize
- To caption the bar correctly — set Units title, which ships as
MPH. - To put the color boundaries where the limits actually are — edit the Bar color levels instead of accepting an even split.
- To match the scale to your equipment — set Min value and Max value.
- To name the measurement — turn on Label and set its text, which this preset leaves off.
- To tune the glow — set Neon glow effect brightness, or
0to remove the effect. - To change how segmented the bar looks — adjust Thickness of the stripes, or
0for a solid fill. - To make the bar heavier or lighter — adjust Relative bar width.
- To change how the value moves — set the Animation duration and easing rule.
Tips
- Stack these rather than mixing them with dials. Horizontal bars share a left edge and a length, so a column of them is compared instantly; the same values in a row of arcs have to be read one at a time.
- Give every bar in a stack the same range whenever they measure the same kind of thing. Bars are compared by length, and that comparison is only valid while the scales match.
Share Your Widget with the Community
Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.