Chart - line not displayed if same value as x-axis

If I specify a y-axis min of -1, I see;

...note that you can see the value line along the x-axis up to the current time.

However, if I leave the y-axis blank, or set it min = 0 & max = 4, I see;


...and the value line is not being displayed when it is at zero..

  • Node-RED version: v0.20.5
  • Dashboard version 2.15.4
  • Viewed on Windows Chrome Version 74.0.3729.169 (Official Build) (64-bit)

On Android mobile I can see the value line but it is very thin, and not as thick as values above zero.
It seems that the y-axis is cut-off below zero (as it should) BUT it halves the width of the value line.

Did you try it in raw chart.js ?

I'm sorry, you've lost me there.

The chart is using the angular-chart.js wrapper of the chart.js library - we don't do anything special re axis - so I was wondering if the underlying library has the same issue.

I've no idea how to load data direct into the underlying library to test, I only use chart.js through node-RED.

Hmm, odd for me I see
which indeed is cut in half - but is at least visible. So would seem to be the default behaviour.

My experiments suggest that what is happening is that it is drawing the line at 0 with half above and half below the axis, but then clipping it so that it does not draw outside the box. That is not what you are seeing however. Have you checked that the values going in are exactly zero and not slightly negativ? Feed the incoming data into a debug node and check.

Definitely zero, I have checked that.
As I said above, on mobile browser I see what Dave has observed - a half width value line.

Try it on the PC with this, does it show it? It works ok for me in Chrome on Ubuntu


Don't know about versions in use but seems to be fixed at Chart.js side

Sadly we use angular-chartjs which pre-reqs chart.js 2.3.x - so we can't get that fix that is in 2.8.0

More sadly it seems to living its life at very low maintenance rate. :roll_eyes:

@Colin problem exists as described with your flow. I've also injected number '1's so that you can see the difference.


@hotNipi Good spot! Yes that appears to be the same issue.

Tried setting the y-axis to min = -1 & max = 10 which of course displays the line, but the scale looks untidy.


Can you try size=auto ?

It may help if you define limits with manner that odd lines are not needed. Like from -5 to +15 or similar.

1 Like