google.load('visualization', '1', {'packages': ['geochart']}); var chart; google.setOnLoadCallback(function() { chart = new google.visualization.GeoChart(document.getElementById('chart_div')); }); setInterval(function() { drawRegionsMap(); }, 2000); function randomInt(min,max) { return Math.floor(Math.random()*(max-(min+1))+(min+1)); } function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Country', 'Mood'], ["Algeria",randomInt(0,100)], ["Argentina",randomInt(0,100)], ["Australia",randomInt(0,100)], ["Belgium",randomInt(0,100)], ["Bosnia and Herzegovina",randomInt(0,100)], ["Brazil",randomInt(0,100)], ["Cameroon",randomInt(0,100)], ["Chile",randomInt(0,100)], ["Colombia",randomInt(0,100)], ["Costa Rica",randomInt(0,100)], ["Côte d'Ivoire",randomInt(0,100)], ["Croatia",randomInt(0,100)], ["Ecuador",randomInt(0,100)], ["United Kingdom",randomInt(0,100)], ["France",randomInt(0,100)], ["Germany",randomInt(0,100)], ["Ghana",randomInt(0,100)], ["Greece",randomInt(0,100)], ["Honduras",randomInt(0,100)], ["Iran",randomInt(0,100)], ["Italy",randomInt(0,100)], ["Japan",randomInt(0,100)], ["Korea Republic",randomInt(0,100)], ["Mexico",randomInt(0,100)], ["Netherlands",randomInt(0,100)], ["Nigeria",randomInt(0,100)], ["Portugal",randomInt(0,100)], ["Russia",randomInt(0,100)], ["Spain",randomInt(0,100)], ["Switzerland",randomInt(0,100)], ["Uruguay",randomInt(0,100)], ["USA",randomInt(0,100)] ]); var options = { minValue: 0, //displayMode: 'text', magnifyingGlass: {enable: true, zoomFactor: 0}, colors: ['#de2d26', '#2ca25f'] }; chart.draw(data, options); }