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

**URL:** <https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104>\
**Category:** Dashboard\
**Created:** [30 September 2019 18:26 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104 "2019-09-30T18:26:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [30 September 2019 18:26 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104/1 "2019-09-30T18:26:21Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cd61dd89c7428946502bbcad8c0070c4ca30a4e3.png)

Then I tryed out something like this:

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d695d0b55473f363205560ec30b9b3cd58a31791.png)

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 🙂

EDIT:

using Node-Red 1.0 12-latest (arm32v7)

---

<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:** [30 September 2019 18:45 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104/2 "2019-09-30T18:45:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [1 October 2019 15:44 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104/3 "2019-10-01T15:44:57Z")

</div>

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 🙂

I added an injectnode with a json object like this:

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

```

Then I also tested something like that:

```auto
{
    "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?

---

<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:** [1 October 2019 15:50 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104/4 "2019-10-01T15:50:12Z")

</div>

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

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [1 October 2019 15:52 UTC](https://discourse.nodered.org/t/change-y-x-axis-for-chart-with-msg-payload/16104/5 "2019-10-01T15:52:08Z")

</div>

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