Change Colour in Circle Pointer

Hi there,

I have a circle pointer that I want to turn green for value 1 and red for value 2. My function is not really correct, but it shows what it is all about.

What do I have to do to make it work?

Unbenannt

Time to learn a bit about JavaScript syntax maybe

My question is more related to the transfer of the color changes for the pie chart. I think it won't work the way I do it.

The Circle pointer is unknown therm. The pie chart has no options for colors to change on fly. The seg1 and seg2 may be options for the gauge node. So your question is a bit unclear. May be it will be more clear if you share the flow.

It's not correct, but it shows what I'm getting at.

[{"id":"6d7768a7.9344f8","type":"function","z":"7438b086.86847","name":"make Var 1 global","func":"global.set(\"Var1\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":160,"wires":[["9044ab07.888a38"]]},{"id":"1b7feb56.a414b5","type":"function","z":"7438b086.86847","name":"make Var 2 global","func":"global.set(\"Var2\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":240,"wires":[["9044ab07.888a38"]]},{"id":"9044ab07.888a38","type":"function","z":"7438b086.86847","name":"Green or Red","func":"m1 = global.get(\"Var1\");\nm2 = global.get(\"Var2\");\n\nif (m1 < m2)\n{\n    msg = {ui_control:{seg1}}\n}\nelse\n{\n    msg = {ui_control:{seg2}}\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":200,"wires":[["b18ff93b.f84dc8"]]},{"id":"587c1c9e.d9adc4","type":"ui_numeric","z":"7438b086.86847","name":"","label":"Var 1","tooltip":"","group":"2f1d871c.11a448","order":0,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"100","step":1,"x":190,"y":160,"wires":[["6d7768a7.9344f8"]]},{"id":"d2745846.e08b78","type":"ui_numeric","z":"7438b086.86847","name":"","label":"Var 2","tooltip":"","group":"2f1d871c.11a448","order":0,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"100","step":1,"x":190,"y":240,"wires":[["1b7feb56.a414b5"]]},{"id":"b18ff93b.f84dc8","type":"ui_gauge","z":"7438b086.86847","name":"","group":"2f1d871c.11a448","order":2,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#ca3838","#ca3838"],"seg1":"","seg2":"","x":990,"y":200,"wires":[]},{"id":"2bf1b55d.9b85aa","type":"ui_numeric","z":"7438b086.86847","name":"","label":"Value","tooltip":"","group":"2f1d871c.11a448","order":3,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"100","step":1,"x":750,"y":300,"wires":[["b18ff93b.f84dc8"]]},{"id":"2f1d871c.11a448","type":"ui_group","name":"Default","tab":"d8883c99.f756c","order":1,"disp":true,"width":"6","collapse":false},{"id":"d8883c99.f756c","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]