I am creating a script with the Google Apps Script editor accessed from http://script.google.com. I would like to use the newer chart services documented at https://developers.google.com/chart/interactive/docs/quick_start. The example there includes the following lines:
[html> [head> [!--Load the AJAX API--]
[script type="text/javascript" src="https://www.google.com/jsapi"][/script]
[script type="text/javascript"]
// Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']});
(I have substitued [ and ] for < and > to keep things visible.)
Now, since I am writing a script within the script editor, I am not starting with "html" in brackets. If I enter the line:
google.load('visualization', '1.0', {'packages':['corechart']});
into my script then try to run the script, I get the message:
ReferenceError: "google" is not defined.
How can I access the Visualization API from the google Apps Script Editor?