HI,
I am using example from NodeRed examples --> node-red-node-ui-table --> ui_control table.
Current program:
"min": 0,
"max":100,
"color": ["red", "orange", "lime"],
I would like to have program like:
"color": <=70: red, >=90: green, else=orange
My main concern is about the color with specific range I set.
Thank you and hope to get solution here!
Best regards,
Wing
Hi I havent used this node in anger but I think you can do something like this...
// 0-9% 10-19% .....................60-69% 70-79% 80-89% 90-100%
"color": ["red", "red", "red", "red", "red", "red", "orange", "orange", "lime"],
Hi Steve,
Thanks for your reply. Yes I do know this way but I have 8 columns that need this function, this will make the coding even longer. Perhaps, there is one sentence code can be performed?
Thank you!
Best regards,
Wing
As I said, i dont really use this. Yuo could create a colors variable and re-use it...
// 0-9% 10-19% .....................60-69% 70-79% 80-89% 90-100%
var colours = ["red", "red", "red", "red", "red", "red", "orange", "orange", "lime"];
...
...
//later on - use it multiple times
[
{ "color": colours, } ,
{ "color": colours, } ,
{ "color": colours, } ,
{ "color": colours, } ,
{ "color": colours, } ,
]
system
Closed
21 February 2021 09:30
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.