Skip to content

Instantly share code, notes, and snippets.

@theredpea
Created June 25, 2014 22:32
Show Gist options
  • Save theredpea/c2ee10eb0aefd2e9fd8b to your computer and use it in GitHub Desktop.
Save theredpea/c2ee10eb0aefd2e9fd8b to your computer and use it in GitHub Desktop.
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity', 'Display'],
['DE-BY', 200, 'Bavaria'],
['DE-NW', 500, 'Nordrhein-Westfalen']
]);
//http://stackoverflow.com/a/11956132/1175496
var formatter = new google.visualization.PatternFormat('{1}');
formatter.format(data, [0,2]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1]);
var viz = document.getElementById('visualization');
var geochart = new google.visualization.GeoChart(viz );
console.log(view.toDataTable().toJSON());
geochart.draw(view, {width: 556, height: 347, region: 'DE', resolution: 'provinces',
displayMode:'text',
//legend:'none',
colorAxis:{ colors:['green','green']},
sizeAxis:{minSize:12,maxSize:12}});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment