Make a map with clickable countries - Javascript Google Chart

Javascript examples for Google Chart:Map

Description

Make a map with clickable countries

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
      <script type="text/javascript">
      google.charts.load('current', {'packages':['geochart']});
      google.charts.setOnLoadCallback(drawRegionsMap);
      function drawRegionsMap() {
        var data = google.visualization.arrayToDataTable([
          ['Country', 'Popularity'],
          ['Germany', 200],
          ['United States', 300],
          ['Brazil', 400],
          ['Canada', 500],
          ['France', 600],
          ['RU', 700]
        ]);//from  w ww .  j  a v a2 s . c o m
        var options = {};
        var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
        chart.draw(data, options);
      }
      </script> 
   </head> 
   <body> 
      <div id="regions_div" style="width: 900px; height: 500px;"></div>  
   </body>
</html>

Related Tutorials