# Horizontal Bar Graph

**URL:** https://discourse.nodered.org/t/horizontal-bar-graph/98000
**Category:** Dashboard
**Tags:** node-red-dashboard, uibuilder, web-components
**Created:** [7 July 2025 03:11 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000 "2025-07-07T03:11:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![donsay](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@donsay](https://discourse.nodered.org/u/donsay)
#### Post date: [7 July 2025 03:11 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/1 "2025-07-07T03:11:58Z")

</div>

I saw a few posts about horizontal bar graphs, and read about Plotly. I'd prefer to avoid an external dependency if I can.

The dashboard Chart node supports a horizontal bar graph, but it lacks two things I'm looking for:

- overlaying text on the bar
- a different scale than the bar min and max values

I have data that varies between -140 and -40. I'd like to plot that. When I plot a negative range like that, the Bar extends from right to left. It's easy enough to convert the value to a positive number, but I'd still like to display the scale from -140 to -40.

Am I overlooking something here? I know a little about html, and have used the UI template for a few really simple displays, just for formatted text.

rpi 3b+, NR ver 4.0.5

Thanks,  
Don

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [7 July 2025 09:48 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/2 "2025-07-07T09:48:15Z")

</div>

Not a Dashboard component - though it should be usable with either D1 or D2, I have an LED gauge web component if that helps. Though it does not currently allow separate setting of the LED values, I don't think it would be that hard to do, I'd be happy to try if you find the component otherwise useful.

[https://wc.totallyinformation.net/tests/live/led-gauge](https://wc.totallyinformation.net/tests/live/led-gauge)

---

<div class="post-metadata">

### Author: ![donsay](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@donsay](https://discourse.nodered.org/u/donsay)
#### Post date: [8 July 2025 05:01 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/3 "2025-07-08T05:01:53Z")

</div>

Thanks for the reply. I'll take a look.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [7 August 2025 05:02 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/4 "2025-08-07T05:02:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [21 September 2025 10:31 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/5 "2025-09-21T10:31:20Z")

</div>



---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [21 September 2025 10:34 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/6 "2025-09-21T10:34:19Z")

</div>

> [@donsay](#):
>
> I'll take a look.

In case you are still interested, you should note that all of the settings are, in fact, controllable both from node-red and from front-end JavaScript.

For example, this inject node will change the max of the gauge:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/7408a3b9c7fe04ad705704291374cae2fee058be.png)

`max`, `min`, `unit`, `value`, number of `segments` and `hide-segment-labels` are all controllable in addition to classes and styles.

LED segment colours can also be changed:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/3519f673ee5b799aadb4c08f160ddc252d913063.png)

You can even change the label text:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/f/9f838704dae48a828759c70140054df4e78cd645.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/219e09bb913bb0f738ced2de16711d28c1939915.png)

Also, clicking on a segment returns data to Node-RED.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [21 September 2025 17:15 UTC](https://discourse.nodered.org/t/horizontal-bar-graph/98000/7 "2025-09-21T17:15:12Z")

</div>

Just for fun, here is a representation of wind speeds using colours based n the beaufort scale of danger.

The Beaufort scale runs from 0-12. 12 is 73+mph, I've capped the gauge at 100mph though the highest recorded wind speed is around 250mph.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae1f5c88136c3be6e48d53236bdde46468189b74.png)

```flows
[{"id":"6d51534aa8d488cf","type":"inject","z":"2c47031326e8fd01","g":"0958c88d9e5ba8df","name":"led-gauge::led-gauge-1 - Change to wind-speed with beaufort scale colors","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"led-gauge::led-gauge-1","payload":"{\"innerText\":\"Wind Speed (Beaufort Scale, Max. 100 mph)\",\"min\":0,\"max\":100,\"colors\":{\"1\":150,\"3\":160,\"7\":170,\"12\":190,\"18\":210,\"24\":220,\"31\":50,\"38\":40,\"46\":30,\"54\":15,\"63\":0,\"72\":350,\"100\":330,\"250\":320},\"unit\":\"mph\"}","payloadType":"json","x":360,"y":840,"wires":[["e2b716427578f873"]]},{"id":"6ed93d4d08ba0502","type":"inject","z":"2c47031326e8fd01","g":"0958c88d9e5ba8df","name":"led-gauge::led-gauge-1 - set to random wind speed (0-250)","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"led-gauge::led-gauge-1","payload":"{\t \"value\": $floor($random() * 250)\t}","payloadType":"jsonata","x":310,"y":880,"wires":[["135c2057a2bdc76b"]]}]

```
