Null values in Line and Bar chart


« 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 Max on 27th May 2013
Hi,

I was just wondering if it was possible to have null values in a bar chart (or line chart). i.e. I'm trying to display a metric that is a monthly percentage and there are some months where there's is just no data to show. Is there any way to accomplish this ? I've already tried passing null or an empty string in my data array and it messe's up the chart. Also I don't want to remove the month all together.

Thanks in advance !
Posted by RGraph support on 28th May 2013
Hi there,

The Bar chart doesn't have great null support - as you can see:

dev.rgraph.net/fiddle/view/2fc469a29c507713a59142900ede3b62

But if you're not using above labels you might be able to get away with using 0 instead of null.



Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by RGraph support on 28th May 2013
Hi there,

FYI null support in the Bar chart will be improved in the next release.

dev.rgraph.net/fiddle/view/2fc469a29c507713a59142900ede3b62


Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Max on 29th May 2013
Ok thanks a lot for your help.
I'm actually using label above and 0s but the will be fixed in the next release will should be sufficient with the end-user !
Posted by Max on 29th May 2013
Well actually you put me on the right track. The labels chart.labels.above.specific did the trick, I just show "N/A" for empty values ...

Thanks for your help.
Posted by Jason Tan Boon Teck on 11th December 2013
I am interested to draw a line chart, also with some data points being null.

When I replaced the value with null, that segment of the line disappeared instead. Is there a way to render, such that the lines join from the other data points that have values?

I have taken codes from www.rgraph.net/docs/integration-with-server-side-scripting.html

I modified

     $myData = join(',', array(78,16,26,23,25,"null",34,64,84,84));

Is there any documentation/example that I can refer to?

Posted by RGraph support on 11th December 2013
Hi there,

With the Line chart null means "no data" so the line disappears to represent that. If you want to show a value you could use zero or take the value from either side of the null value and show an average value.





Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by Jason Tan Boon Teck on 12th December 2013
Thank you for the reply. I was hoping for an easy way out as Google Charts seems able to plot the line even when some data points are null.

Anyway, I have resolved the issue by using scatter graphs instead of line graphs.

Posted by RGraph support on 12th December 2013
Hi there,

I see what you mean now - you could pre-process your data before you pass it to RGraph - converting any null values to an average of the values either side.

Cheers.




Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website. Thanks!

Add a reply

 




« Back to message list
RGraph on social media