Adding Columns of data on geochart

905 views
Skip to first unread message

Corbin

unread,
Jun 24, 2011, 10:35:25 AM6/24/11
to Google Visualization API
I'm using the geoChart (US, resolution:metro), and have it working
with two columns of data (string(region), and number. I wanted to add
a third column of data (string), but it's not showing in the mouseover
tooltip like the others. The geochart example says the string (region)
is required, and there are two optional. I'm wondering why my 2nd
optional isn't showing, and is there really a 2 extra column limit to
each entry?

asgallant

unread,
Jun 27, 2011, 8:53:53 AM6/27/11
to google-visua...@googlegroups.com
I think that's a typo in the documentation.  AFAIK, the geo charts only support 2 columns.

ChartALot

unread,
Jun 27, 2011, 10:06:29 AM6/27/11
to google-visua...@googlegroups.com
Indeed, that is a typo.
Note that you can change how  regions are named in the tooltip by setting the formatted value of the cell which holds the region name (dataTable.setFormattedValue(row, col, formattedValue)).
The same is true for your values. For example:

    function drawVisualization({
      var data new google.visualization.DataTable();
      data.addRows(6);
      data.addColumn('string''Country');
      data.addColumn('number''Popularity');
      data.setValue(00'Germany');
      data.setValue(01200);
      data.setValue(10'United States');
      data.setValue(11300);
      data.setValue(20'Brazil');
      data.setValue(21400);
      data.setValue(30'Canada');
      data.setValue(31500);
      data.setValue(40'France');
      data.setValue(41600);
      data.setValue(50'RU');
      data.setValue(51700);
      data.setFormattedValue(50"Russia");
      data.setFormattedValue(51"A lot");
      var geochart new google.visualization.GeoChart(
          document.getElementById('visualization'));
      geochart.draw(data{width556height347});
    }


On Mon, Jun 27, 2011 at 3:53 PM, asgallant <drew_g...@abtassoc.com> wrote:
I think that's a typo in the documentation.  AFAIK, the geo charts only support 2 columns.

--
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/-/h7KSlH6L8QIJ.

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