To put nulls in your data set, use the word null without any quotes, ie: 

data.addRows([
    [0, 2],
    [1, 1],
    [2, null],
    [3, 2],
    [4, 1]
]);

To the best of my knowledge, there is no good way to distinguish between 
zero values and nulls in some charts (particularly column, bar, and pie 
charts).  Line and area charts leave gaps in the lines/areas where there is 
a null data point by default (which can be overridden by setting the 
"interpolateNulls" option to true).  Scatter and bubble charts draw points 
when a value is zero and don't when the value is null.

Hmm...with bar and column charts, if you have multiple series of data, you 
might be able to distinguish nulls by setting the "focusTarget" option to 
"category".  This will add all data points at a given axis value to the 
tooltip when you hover over any one of the bars.  Null values are excluded 
from the tooltip, but zero values are included.  See example here: 
http://jsfiddle.net/asgallant/kLURn/

On Wednesday, September 26, 2012 10:53:28 AM UTC-4, Andy Hickey wrote:
>
> A search of the forums reveals others who have grappled with null values 
> in charts with varied success, but none seem to address the issue I am 
> facing.
>
> I have data with zeroes and null data. Zeroes mean a definite zero values, 
> where as null means 'no data available'. I'm looking for a way to represent 
> this on the chart. Obviously a zero should be a bar with zero height, but 
> I'd like some kind of signifier of null data, so that those viewing the 
> chart can tell the difference between a zero value and missing data ranges.
>
> One thought I had thought of was to translate the null into a negative 
> number and somehow get the chart to refuse to display data going down, but 
> somehow else identify these ranges as being null. Rather vague I agree. 
>
> It seems strange that I should be the first to tackle this issue, so if 
> anyone has some ideas, I'd be very appreciative.
>
> Regards
> Andy
>
> nb. Just putting null data in my charts seems to be an issue for me. When 
> I place 'null' , or '_', which I've seen others use to represent NULL, 
> I occasionally get the 'data must be of the same type' error. Changing 
> nothing else other than whatever my null identifier is to a '0' or empty 
> (,,) fixes the issue- is there one definite symbol to use for NULL?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/DHZDpCpisiYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to