# Chart Y axis adjustment

**URL:** <https://discourse.nodered.org/t/chart-y-axis-adjustment/18770>\
**Category:** Dashboard\
**Created:** [3 December 2019 23:08 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770 "2019-12-03T23:08:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gee03](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@gee03](https://discourse.nodered.org/u/gee03)\
**Post date:** [3 December 2019 23:08 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/1 "2019-12-03T23:08:29Z")

</div>

Hi,

First time posting. I am trying to be able to change the YMax value of a chart from a UI input. I have got it half working however every time i enter a Y value on the UI it also plots this on the chart.

 ![y axis](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ad031097ab34c336be64ba779a476572e7a848c9.png)

---

<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:** [4 December 2019 04:43 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/2 "2019-12-04T04:43:09Z")

</div>

You should send only `msg.ui_control` and delete `msg.payload`

---

<div class="post-metadata">

**Author:** ![gee03](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@gee03](https://discourse.nodered.org/u/gee03)\
**Post date:** [4 December 2019 09:22 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/3 "2019-12-04T09:22:08Z")

</div>

Hi,

Thanks for your reply, i have corrected this however it does not change the y axis, but it has resolved the chart plotting the numbers.

I have attached a screen shot of the flow ,code and output. Do i need to put reference to the ymax in the cart options?

 ![y axis 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c6538a1aed5840f611bd56e42d27dd3ab02aa4b4.png)

---

<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:** [4 December 2019 09:57 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/4 "2019-12-04T09:57:36Z")

</div>

You forgot to delete the payload property of msg object  
And you'll need still return msg object (it is my bad explanation at first reply. sorry)  
correct will be : `msg` should carry only` ui_control` property

```auto
msg.ui_control = {control stuff here}
delete msg.payload
return msg

```

---

<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:** [4 December 2019 10:29 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/5 "2019-12-04T10:29:13Z")

</div>

If the `ymax` is only thing you'll need to change then it is reasonable to use the `change` node with `move` rule configured like this

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b2a2df83903dd6fb200f95bbd23a9101449415b6.png)

---

<div class="post-metadata">

**Author:** ![gee03](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@gee03](https://discourse.nodered.org/u/gee03)\
**Post date:** [4 December 2019 12:47 UTC](https://discourse.nodered.org/t/chart-y-axis-adjustment/18770/6 "2019-12-04T12:47:20Z")

</div>

Perfect, thank you very much for your help
