Change y/x Axis for Chart with msg.payload?

Hey guys,

I'm interested in changing the min and max values for the line charts.
I set up a payload object like this:

grafik

Then I tryed out something like this:

grafik

But that didn't change anything. Can't find anything in the information node or on the official github page for the charts. Maybe I missed something or it isn't possible?

Thx in advance :slight_smile:

EDIT:

using Node-Red 1.0 12-latest (arm32v7)

see - https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md

1 Like

Hey dceejay,

thank you very much, got a bit time to test around but can't figure out how to use it proper.

Just small example with a switch (yeah I know my main question is about x/y axis on a chart) because it is a bit easier for me to understand I hope :slight_smile:

I added an injectnode with a json object like this:

{
    "ui_control.oncolor": "lime",
    "ui_control.offcolor": "red"
}

Then I also tested something like that:

{
    "ui_switch.ui_control.oncolor": "lime",
    "ui_switch.ui_control.offcolor": "red"
}

Or even vise versa, but that doesn't make any change on the color of my standard switch after I pressed the button on the inject node (refreshed browser with CTRL + F5).

What am I doing wrong?

For ui switch the format of ui control message should be like this

msg.ui_control = {onicon:"fa-fire",oncolor:"orange",officon:"fa-fire",offcolor:"yellow"}

You can do same thing using the change node of course if you like

[{"id":"df1d2c5e.9f663","type":"ui_switch","z":"37e0d918.b92d36","name":"","label":"switch","tooltip":"","group":"bbab2560.6f8948","order":11,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":560,"y":700,"wires":[[]]},{"id":"787bb327.3e3b9c","type":"function","z":"37e0d918.b92d36","name":"change switch options","func":"msg.ui_control = {onicon:\"fa-fire\",oncolor:\"orange\",officon:\"fa-fire\",offcolor:\"yellow\"}\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":700,"wires":[["df1d2c5e.9f663"]]},{"id":"451b15c5.b6970c","type":"inject","z":"37e0d918.b92d36","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":700,"wires":[["787bb327.3e3b9c"]]},{"id":"e06fcac2.7d4f88","type":"change","z":"37e0d918.b92d36","name":"","rules":[{"t":"set","p":"ui_control.onicon","pt":"msg","to":"fa-stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":760,"wires":[["df1d2c5e.9f663"]]},{"id":"11816068.99879","type":"inject","z":"37e0d918.b92d36","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":760,"wires":[["e06fcac2.7d4f88"]]},{"id":"bbab2560.6f8948","type":"ui_group","z":"","name":"G1","tab":"13731dc0.622ff2","disp":true,"width":"10","collapse":false},{"id":"13731dc0.622ff2","type":"ui_tab","z":"","name":"HOME","icon":"dashboard","disabled":false,"hidden":false}]

Could it be, that this isn't working with standard switch icon?