geo chart Incompatible data table error

5,409 views
Skip to first unread message

youminkim

unread,
Dec 17, 2011, 12:13:58 AM12/17/11
to Google Visualization API
hi, I am trying to draw a geo chart with four columns: Latitude
(number), Longitude (number), Value (number), and Description
(string).

But, there is an error:
"Incompatible data table: Error: Table contains more columns than
expected (Expecting 3 columns)"

this is my code:
---
function drawMarkersMap() {
var data = new google.visualization.DataTable();

data.addColumn('number', 'LATITUDE', 'Latitude');
data.addColumn('number', 'LONGITUDE', 'Longitude');
data.addColumn('number', 'VALUE','Value');
data.addColumn('string', 'DESCRIPTION','Description');
data.addRows([
[38.14660,127.31322, 10, 'hello'],
[37.88131,127.72997, 100, 'world']
]);

var options = {
region: 'KR',
height: '694',
width: '1112',
resolution: 'provinces',
displayMode: 'markers',
};

var chart = new
google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
---

and thanks for great API.

EZChart

unread,
Dec 19, 2011, 6:08:39 AM12/19/11
to google-visua...@googlegroups.com
Indeed, we do not allow a string column in this way (see detailed documentation under http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html#Data_Format).

However, we do have undocumented support for such a column. All you have to do is place the description column before the value column, and you will see the description in the tooltip when hovering over a marker (example: http://savedbythegoog.appspot.com/?id=22d60bcbfa4ebc0f79cdc697daa208b15e4e07ba).

Important note: this feature is undocumented, and we may stop supporting it at any time without notice.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
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.


NA

unread,
Jan 11, 2012, 4:55:33 PM1/11/12
to Google Visualization API
Are you saying that if we want a map using longitude and latitude
coordinates with labels, this is no longer possible? This was
possible with the GeoMap object.

Or am I misunderstanding this? I have the same issue - I'd like to
use the new map, but I need to place a label with each of the
markers. The GeoMap allowed us to provide 4 columns - first two for
longitude and latitude, 3rd for a value, and 4th for the label. It
seems like the new map only supports the first 3 columns, meaning
we've lost functionality.

What's the situation?

asgallant

unread,
Jan 12, 2012, 10:20:42 AM1/12/12
to google-visua...@googlegroups.com
I'm not sure that this will address exactly what you want, but you could try using a column of role type 'tooltip' (see http://code.google.com/apis/chart/interactive/docs/roles.html) to change the tooltips fi they're not displaying the way you want them.

NA

unread,
Jan 12, 2012, 1:21:21 PM1/12/12
to Google Visualization API
Will the roles work ? I have been avoiding for several reasons, but
also assumed that since the GeoChart documentation doesn't mention
them that they wouldn't work.

One of the reasons I'm avoiding roles is because they are described as
"experimental". That puts me in a situation no better than using the
undocumented and may-disappear-at-any-time approach described by
EZChart earlier in this thread. With the lack of version control that
has *still* not been addressed, I think it's unwise to use a feature
marked as experimental.

I'm also disappointed that the new implementation lost a feature that
the old implementation had. It also doesn't render the "zoom out"
button. From my perspective, both of those features are needed
together. The new charts are implemented in Javascript, meaning they
can be viewed on devices like an iPad. But the missing "zoom out"
button means that iPad users who can finally see the map will have a
harder time going back to the zoomed out view. Add to that the
missing tooltips, and the GeoChart component is no better or worse
than the older GeoMap component.

I'd really like to see the tooltips and zoom out features be restored
to this component in a supported way. Any plans for this?

ChartALot

unread,
Jan 16, 2012, 3:05:22 AM1/16/12
to google-visua...@googlegroups.com
Hi Guys,
Our aim is for the GeoChart to replace the GeoMap (with all its functionality). It may require some patience, and workarounds (for example, placing a zoom out button on top of the chart), but we will get there.

As for defining a custom labels for markers, we decided to support (and document) the optional label column mentioned above by EZChart. This means that you have the same functionality as the GeoMap, but the data table format looks different (the labels column appears just after the lat/lng columns). Please do not use the tooltip role (or any role) for the GeoChart, as it will used for later for different purpose.

I hope this helps.



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
Reply all
Reply to author
Forward
0 new messages