Hi!

I'd like to know if it's possible to use visualization API in GAS, because 
i'm having some trouble doing it. Let me explain. I have a code divided in 
two parts. One part for the javascript (.gs files) and the other is the 
html code. Even using the code from Google Code Playground i get the same 
problem.

The codes are:

*main.html (from Google Code Playground)*

<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="//www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1', {packages: ['corechart']});
    </script>
    <script type="text/javascript">
      function drawVisualization() {
        // Create and populate the data table.
        var data = google.visualization.arrayToDataTable([
          ['x', 'Cats', 'Blanket 1', 'Blanket 2'],
          ['A',   1,       1,           0.5],
          ['B',   2,       0.5,         1],
          ['C',   4,       1,           0.5],
          ['N',   1,       0.5,         1]
        ]);      
        // Create and draw the visualization.
        new google.visualization.LineChart(document.getElementById(
'visualization')).
            draw(data, {curveType: "function",
                        width: 500, height: 400,
                        vAxis: {maxValue: 10}}
                );
      }
      google.setOnLoadCallback(drawVisualization);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="visualization" style="width: 500px; height: 400px;"></div>
  </body>
</html>


*program.gs*

function doGet()
{
  return HtmlService.createHtmlOutputFromFile('main');
}

*and the errors are:*

Sandbox mode: EMULATED [VM] 
592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm
 
(1171):177<https://script.google.com/a/macros/bbva.com/static/client/js/592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm>

   1. Could not create the property 'loader': [object Object] is not 
   extensible. [VM] 
   
592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm
 
   
(1171):60<https://script.google.com/a/macros/bbva.com/static/client/js/592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm>


   1. Expected property "load" to be a function, not undefined: undefined [VM] 
   
592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm
 
   
(1171):60<https://script.google.com/a/macros/bbva.com/static/client/js/592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm>


   1. Expected property "setOnLoadCallback" to be a function, not 
   undefined: undefined [VM] 
   
592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm
 
   
(1171):60<https://script.google.com/a/macros/bbva.com/static/client/js/592431788-maestro_htmlapp_bin_maestro_htmlapp.js?lib=MhtKtOYGQPhch1b9gh6T59OaoJlzzZ8rm>



I don't know where the problem is, it's seems like if <script type=
"text/javascript" src="//www.google.com/jsapi"></script> didn't work and
nothing would be loaded.

I don't want to use Import->Chart since i'm using the .gs part to make a 
lot of things before populating my chart.

Any suggestion? Thanks!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to