My array with null values in it is not populating the chart as expected

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Stephan on 22nd February 2014

In my yearly weather graph I have a slight problem that it seems the last value (which is a null) is not drawn properly. From the graph it looks like only 11 values are there (the marker of February isn't on the grid).

When I replace the nulls with zero's it does draw the line complete and all markers are on the correct position.

It can be seen on:


Posted by Richard on 22nd February 2014
Hi there,

That's correct behaviour. null represents "no data" which is not necessarily the same as zero. To convert them you can use the Number function:

var num = Number(num);

Or perhaps this:

var num = num || 0;


Add a reply

« Back to message list