I'm trying to prevent a chart Y axis being too 'short'. Ideally there would be a 'minimum range' value for the Y axis, but absent being able to set that I need to ensure that ymax less ymin is not less than say, 10.
I have a function node to do this, but I'd like to be able to revert. to auto-scaling with the logic
If maximum_value - minimum_value < 10
Set axis values with function node
Else
Set axis values to auto-scale
So how do I return a chart to auto-scale the Y axis after using 'msg.ui_control', please?
I am sending
msg.ui_control = {"suggestedMax":scale_max,"suggestedMin":scale_min};
where scale_max = 7 and scale_min = 2
But the chart is auto-scaling from 0 to 6.
I thought that scale minimum would be "Math.min(dataMin, suggestedMin)" and that scale maximum would be "Math.max(dataMax, suggestedMax)" but clearly I'm missing something about how this is supposed to work.