Is it possible to run html pages with visualization API through google drive ?

12 views
Skip to first unread message

Chee Ping Chong

unread,
Aug 31, 2015, 10:40:07 AM8/31/15
to Google Visualization API
I have a testing pages that have similar data in googleVis example. 
What I have done was put the data in R, create html code through R, modify the code a bit then save as html in google drive.

However, when I tried to launch it from google drive, the map was not appeared as expected. 
Is it not possible to do it as what I described above ? 

The whole script is as below:-

+++++++++++++++++++++++++++++
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 
 <body>
    <script type="text/javascript" src="https://www.google.com/jsapi">
      google.load("visualization", "1", {packages:['geochart']});
      google.setOnLoadCallback(drawRegionsMap);

      function drawRegionsMap() {
        var data = google.visualization.arrayToDataTable([
          ['Country', 'Popularity'],
          ['Germany', 200],
          ['United States', 300],
          ['Brazil', 400],
          ['Canada', 500],
          ['France', 600],
          ['RU', 700]
        ]);

        var options = {};
        var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
        chart.draw(data, options);
      }
    </script>

    <div id="regions_div" style="width: 900px; height: 500px;"></div>
 </body>
</html>
+++++++++++++++++++++++++++++++++++++
Reply all
Reply to author
Forward
0 new messages