Skip to content

Instantly share code, notes, and snippets.

@arjones
Created July 23, 2013 18:43
Show Gist options
  • Save arjones/6065010 to your computer and use it in GitHub Desktop.
Save arjones/6065010 to your computer and use it in GitHub Desktop.
Sample using Google Visualization GeoCharts
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawMarkersMap);
function drawMarkersMap() {
var data = google.visualization.arrayToDataTable([
['Ciudad', 'Tweets'],
['Buenos Aires', 1268],
['san miguel de tucuman', 98],
['cordoba', 23],
['la plata', 21],
['rio cuarto', 14],
['santa fe', 14],
['rosario', 5],
['mendoza', 4],
['moron', 4],
['baradero', 3],
['mar del plata', 3],
['san lorenzo', 2],
['ushuaia', 2],
['resistencia', 1],
['tigre', 1],
['lanus', 1],
['quilmes', 1],
['parana', 1]
]);
var options = {
region: 'AR',
displayMode: 'markers',
colorAxis: {colors: ['#FFCF2E', '#FF2200']}
};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
</script>
</head>
<body>
<div id="chart_div" style="width: 1024px; height: 800px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment