JavaScript
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
// Create and populate the data table.
var ind = new google.visualization.DataTable(
{
cols: [
{id: 'country', label: 'Name', type: 'string'},
{id: 'population', label: 'Population', type: 'number'},
{id: 'desc', label: 'Population', type: 'string'}
],
rows: [
{c:[{v:"IN-AR"},{v: 743},{v: 'India AR'}]},
{c:[{v:"IN-AS"},{v: 835},{v: 'India AS'}]},
{c:[{v:"IN-BR"},{v: 127},{v: 'India BR'}]},
{c:[{v:"IN-CH"},{v: 565},{v: 'India CH'}]},
{c:[{v:"IN-CT"},{v: 201},{v: 'India CT'}]},
{c:[{v:"IN-DN"},{v: 366},{v: 'India DN'}]},
{c:[{v:"IN-DD"},{v: 336},{v: 'India DD'}]},
{c:[{v:"IN-DL"},{v: 706},{v: 'India DL'}]}
]
},
0.6
);
var formatter = new google.visualization.PatternFormat('{1}');
formatter.format(ind, [0, 2]); // Apply formatter to second column
var dt = new google.visualization.DataTable(
{
cols: [{id: 'country', label: 'Name', type: 'string'},
{id: 'population', label: 'Population', type: 'number'}],
rows: [{c:[{v: 'CN'}, {v: 13451}]},
{c:[{v: 'IT'}, {v: 2234}]},
{c:[{v: 'LK'}, {v: 2675}]},
{c:[{v: 'US'}, {v: 4542}]},
{c:[{v: 'UK'}, {v: 347777, f:'7.000'}]}
]
},
0.6
)
var data = google.visualization.arrayToDataTable([
['Region', 'Number'] ]);
var geochart = new google.visualization.GeoChart(
document.getElementById('visualization'));
geochart.draw(ind, {
'title': 'Impressions',
'displayMode': 'regions',
'fill': 20,
'displayExactValues': true,
'colorAxis': {colors: ['#e7711c', '#4374e0']},
...