# Gauge indications for negativ to positiv value range

**URL:** <https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444>\
**Category:** Dashboard\
**Created:** [8 April 2020 09:08 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444 "2020-04-08T09:08:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brumark](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@brumark](https://discourse.nodered.org/u/brumark)\
**Post date:** [8 April 2020 09:08 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/1 "2020-04-08T09:08:53Z")

</div>

I would like to display the charge/discharge power of my solar battery with a gauge or donut.  
To configure the gauge or donut is easy, but what is not working very well is the colouring.

As example for a value range of -3000 to +3000 I would like to have no colouring if value is 0, green from 0 to the actual positiv value and red from 0 to the actual negativ value.  
For a donut, I would like to have 0 on top (12 o'clock) and also here same colouring already described. Now 0 is at the bottom (6 o'clock) and colouring always starts at -3000.

How is it possible to achieve this behaviour?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 April 2020 09:29 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/2 "2020-04-08T09:29:32Z")

</div>

the simple gauge can be set as you desire

```auto
[{"id":"7f3d3f5e.cf73","type":"ui_slider","z":"ea593186.4918d","name":"","label":"slider","tooltip":"","group":"b10fbc0c.f705c","order":1,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","min":"-3000","max":"3000","step":"10","x":350,"y":60,"wires":[["866e68bc.d7af18","92b740aa.37a4e"]]},{"id":"866e68bc.d7af18","type":"ui_gauge","z":"ea593186.4918d","name":"","group":"b10fbc0c.f705c","order":2,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":"-3000","max":"3000","colors":["#ce0705","#505050","#01ca03"],"seg1":"-1","seg2":"1","x":590,"y":60,"wires":[]},{"id":"b10fbc0c.f705c","type":"ui_group","z":"","name":"Home","tab":"76d6a090.f21d2","disp":false,"width":"6","collapse":false},{"id":"76d6a090.f21d2","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

the donut does always start from the top - though that could be a nice option to add.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [8 April 2020 09:58 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/3 "2020-04-08T09:58:37Z")

</div>

> [@brumark](#):
>
> As example for a value range of -3000 to +3000 I would like to have no colouring if value is 0, green from 0 to the actual positiv value and red from 0 to the actual negativ value.

This is not possible with regular gauge.  
One and only gauge which has differential mode is [node-red-contrib-ui-artless-gauge](https://flows.nodered.org/node/node-red-contrib-ui-artless-gauge)

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

Of course it has different graphics and may not suit for your needs. If so, there is not much more options than you'll need to use some other JavaScript library for gauge where differential option is supported.

---

<div class="post-metadata">

**Author:** ![brumark](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@brumark](https://discourse.nodered.org/u/brumark)\
**Post date:** [8 April 2020 10:16 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/4 "2020-04-08T10:16:58Z")

</div>

> [@dceejay](#):
>
> ```auto
> [{"id":"7f3d3f5e.cf73","type":"ui_slider","z":"ea593186.4918d","name":"","label":"slider","tooltip":"","group":"b10fbc0c.f705c","order":1,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","min":"-3000","max":"3000","step":"10","x":350,"y":60,"wires":[["866e68bc.d7af18","92b740aa.37a4e"]]},{"id":"866e68bc.d7af18","type":"ui_gauge","z":"ea593186.4918d","name":"","group":"b10fbc0c.f705c","order":2,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":"-3000","max":"3000","colors":["#ce0705","#505050","#01ca03"],"seg1":"-1","seg2":"1","x":590,"y":60,"wires":[]},{"id":"b10fbc0c.f705c","type":"ui_group","z":"","name":"Home","tab":"76d6a090.f21d2","disp":false,"width":"6","collapse":false},{"id":"76d6a090.f21d2","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
> 
> ```

Thanks for your example. It is exactly how I did it, but as you can see, colouring always starts at the lowest value.  
 ![Bildschirmfoto 2020-04-08 um 12.15.50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4daa56fc2ef0e87d24c1b25fa88ed656110aa6bb.png)

---

<div class="post-metadata">

**Author:** ![brumark](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@brumark](https://discourse.nodered.org/u/brumark)\
**Post date:** [8 April 2020 10:26 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/5 "2020-04-08T10:26:11Z")

</div>

Thanks a lot for the tip to use artless-gauge. I will give it a try.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 April 2020 12:35 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/6 "2020-04-08T12:35:29Z")

</div>

And it may end up in default gauge one day - [https://github.com/toorshia/justgage/issues/345](https://github.com/toorshia/justgage/issues/345)

---

<div class="post-metadata">

**Author:** ![brumark](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@brumark](https://discourse.nodered.org/u/brumark)\
**Post date:** [8 April 2020 12:55 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/7 "2020-04-08T12:55:27Z")

</div>

That's exactly what I'm looking for. But it's sad, that there seems to be no progress until now.

There was already a discussion about it, which I didn't found during my search:  
[https://discourse.nodered.org/t/differential-gauge-node-a-proposal-for-a-new-appearance/21449/6](https://discourse.nodered.org/t/differential-gauge-node-a-proposal-for-a-new-appearance/21449/6)

---

<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:** [8 May 2020 12:56 UTC](https://discourse.nodered.org/t/gauge-indications-for-negativ-to-positiv-value-range/24444/8 "2020-05-08T12:56:37Z")

</div>

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