gregg
unread,Feb 2, 2012, 9:45:24 AM2/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Visualization API
Hello-
I've been trying to figure this out and I'm guessing there's not a
way, but hoping there is.
Since my GeoChart (displayMode: markers) is going to consist of a lot
of data points and I can generate the Lat / Long values it makes
populating the map very quick. The problem is that the tooltip
displays the lat/long and who cares about that? It's not even
formatted in a decent way. Ideally I'd like to have it display City/
State, City/Country or whatever I provide.
I've tried a few things, and was hopeful for something like
[{v:41.8776,f:'City, ST'}, -87.6272, 169],
but didn't change anything.
Thanks!
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'Latitude');
data.addColumn('number', 'Longitude');
data.addColumn('number', 'Mystery Shoppers);
data.addRows([
[41.8776, -87.6272, 169],
[39.97919999999999, 116.29919999999998, 3],
[56.0, 10.0, 440],
[62.0, 15.0, 1],
[39.9289, 116.38830000000002, 86],
[30.66669999999999, 104.06670000000003, 1],
[35.685, 139.7514, 409],
[29.75229999999999, -95.367, 9],
[55.75219999999999, 37.6156, 2],
[39.1422, 117.17669999999998, 41],
[33.61189999999999, -111.8906, 8],
[36.14429999999999, -115.183, 5],
[35.0, 105.0, 1],
[40.40299999999999, -75.5975, 2],
[42.83330000000001, 12.833300000000008, 1],
[3.1666999999999916, 101.69999999999999, 2],
[51.0, 9.0, 10],
[37.899699999999996, 112.18720000000002, 15],
[34.668499999999995, -86.5576, 1],
[57.0, 25.0, 10],
[27.78139999999999, 120.62830000000002, 6],
[38.0, -97.0, 7],
[37.0, 127.5, 49]
// data truncated for posting
]);
var options = {
displayMode: 'markers',
height: 700,
colorAxis: {colors: ['green', 'blue']}
};
visualization = document.createElement('div');
document.body.appendChild( visualization );
var geochart = new google.visualization.GeoChart(visualization);
geochart.draw(data, options );
}