I have a chart that has no margins and so if I have a high value it shows right at the top. Is there a way to add 10 points/values to the incoming value so I get a bit of a buffer?
I tried using "msg.ui_control.ymax = msg.payload + 10" but did not work.
I have been searching throughout the internet but have not found anything specific.
Thanks. It is indeed! Chart is working fine. I just need a bit of a buffer. I'd like the height of the chart be dependent on a combination of the reading + 10 (this is the buffer)
This was helpful. I have tried implementing it but something odd happened. So the Ymin works as expected, the reading was 25 and I set the Ymin to (reading - 5) and it set the Ymin as 20. Perfect.
However, the Ymax does something strange. When I do the same, for some odd reason, NR add the number to the end of the reading, i.e. if I have 25 + 1, NR renders this as 251! See screenshots.
then as leftymuller hinted your msg.payload is probably a string "25" not a numeric 25... so "25" +1 is concatenated to "251".... One of the joys of Javascript. Use parseFloat to try to make it a number