Geomap us_metro config

152 views
Skip to first unread message

hjt

unread,
Aug 9, 2011, 2:04:28 AM8/9/11
to Google Visualization API
Hi,

I am using geomap to display us metros. Wondering if it is possible
to display the metro's name as the heading of the hover on, instead of
the metro code?

For example:
New York, NY
m-om: 1,000

or
501
New York, NY: 1,000

Thanks.

JT

ChartALot

unread,
Aug 10, 2011, 6:31:02 AM8/10/11
to google-visua...@googlegroups.com
Hi, this feature is not available in the GeoMap. However, it is available in our GeoChart, by setting the formatted value of the cell which contains the region id.

For example:
function drawVisualization({
  var data new google.visualization.DataTable();
  data.addColumn('string''Country');
  data.addColumn('number''Popularity');
  data.addRow([{v'501'f'New York'}100]);
  
  var geochart new google.visualization.GeoChart(
      document.getElementById('visualization'));
  geochart.draw(data{width556height347region'US'resolution'metros'});
}
You can also change the formatted value for a cell in an existing table by using the DataTable.setFormattedValue method.

HTH.


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


hjt

unread,
Aug 10, 2011, 1:18:45 PM8/10/11
to google-visua...@googlegroups.com
Thanks a lot Yinnon, it works.

One more question. How do I get the 'New York' in getSelection()?

Thank you :)

JT

Yinnon Haviv

unread,
Aug 16, 2011, 1:44:18 AM8/16/11
to google-visua...@googlegroups.com
You are welcome.
As for accessing the formatted value of a cell, that is done using DataTable.getFormattedValue(row, col) method.


Please try to use version 1.1 while developing since some issues are fixed on'



JT

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



--
Yinnon Haviv.

Reply all
Reply to author
Forward
0 new messages