Chart grid not evenly spaced

A chart usually has 4 evenly spaced divisions.

If I do this, however:
node.send( {ui_control:{min:13900}} );

And later this:
node.send( {ui_control:{max:14060}} );

The chart has a non-evenly spaced grid with 5 divisions.
node-red-graph

Any help about why this is happening would be appreciated.

What happens if you put those values in explicitly in the chart setup?

Colin, If I put the values explictly in the chart setup, the same thing happens:

node-red-graph2

So nothing to do with setting via ui_control. I assume it is the way the algorithm works. It seems to put the grid lines at appropriate intervals for the range, so in this case 40 spacing and then adds the top and bottom values. If you can think of a better algorithm you could propose it. A question, what would you want to see if the range were 12345 to 13456?

Colin, What is the best way to propose an improvement to the algorithm?

It’s using the built in one in chart.is so would need to be for that. But you may be better just setting them manually yourself

The issue still happens if the values are set manually.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.