Geochart tooltip display of country/region name when no data available

374 views
Skip to first unread message

Matt Nuttall

unread,
Jan 26, 2012, 11:58:53 PM1/26/12
to google-visua...@googlegroups.com
Hi Geochart folks;
When I display a country like Canada, let's say I have "temperature" values (second column) for only two of the provinces of Canada. This works fine when I set a data value. I can float over, say, Alberta and Ontario and see:
Alberta
Temperature: 5

Ontario
Temperature: 8

But what about all the other provinces that I have no data for? Let's say that British Columbia has no data at all for it. By this, I mean there has never been a temperature sample taken.
I've tried this:
setFormattedValue(x,1,null)
setValue(x,1,0)
This gives me a tooltip that looks like this:
British Columbia
Temperature:

This is okay, but the setValue(x,1,0) is  problem: the legend should show range of 5 to 8 for the two provinces with data. This hidden 0 shows up in the legend, which is misleading.

Has anybody found a way yet to have the tooltip display a region name even when there is no data to display for that region.

Thanks folks -- Matt

Viz Kid

unread,
Jan 29, 2012, 1:46:17 AM1/29/12
to google-visua...@googlegroups.com

One suggestion is to set the formatted value to "N/A" or something similar, and then you would have "Temperature: N/A" which I think convey what you want.

As for the legend changes due to this. First, I think that having 0 in the legend should not be confusing and might be a good idea in general. However, you can overcome this by either assigning these areas with the smallest value you do have in the DataTable (which is not 0) or play with the color axis parameters so it won't change the colors of the other areas. However, both of these changes would make the color of these area without a value different than what you might hoped.

I don't think we have a simple solution that result in exactly what you wanted, sorry.
  Viz Kid


--
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/-/F6Xia3_6UMgJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Reply all
Reply to author
Forward
0 new messages