Google geochart to show continents - Javascript Google Chart

Javascript examples for Google Chart:Geo Chart

Description

Google geochart to show continents

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Geo Chart Example</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['geochart']}]}"></script> 
      <div id="regions_div" style="width: 900px; height: 500px;"></div> 
      <script type="text/javascript">
      google.setOnLoadCallback(drawRegionsMap);
      function drawRegionsMap() {
          var data = google.visualization.arrayToDataTable([
              ['Region Code', 'Continent', 'Popularity'],
              ['142', 'Asia', 200],
              ['150', 'Europe', 300],
              ['019', 'Americas', 400],
              ['009', 'Oceania', 600],
              ['002', 'Africa', 700]
          ]);//from  w w  w .j  av  a 2 s  .  c o  m
          var options = {
              resolution: 'continents'
          };
          var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
          chart.draw(data, options);
      }

      </script>  
   </body>
</html>

Related Tutorials