google.load and google apps script
google.load and google apps script
我正在尝试使用谷歌应用脚本向谷歌网站添加可视化效果,但尽管直接从谷歌图表的开发人员页面复制了文件"代码",但我仍然收到文件"代码"的语法错误。 代码如下。 是线 google.load('visualization', '1', {'packages':['motionchart']}(;那一直在打破。 我假设它没有找到库,但我无法弄清楚如何解决它。 我可以在应用程序脚本中使用它吗?
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['motionchart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Fruit');
data.addColumn('date', 'Date');
data.addColumn('number', 'Sales');
data.addColumn('number', 'Expenses');
data.addColumn('string', 'Location');
data.addRows([
['Apples', new Date (1988,0,1), 1000, 300, 'East'],
['Oranges', new Date (1988,0,1), 1150, 200, 'West'],
['Bananas', new Date (1988,0,1), 300, 250, 'West'],
['Apples', new Date (1989,6,1), 1200, 400, 'East'],
['Oranges', new Date (1989,6,1), 750, 150, 'West'],
['Bananas', new Date (1989,6,1), 788, 617, 'West']
]);
var chart = new
google.visualization.MotionChart(document.getElementById('chart_div'));
chart.draw(data, {width: 600, height:300});
}
</script>
</head>
<body>
<div id="chart_div" style="width: 600px; height: 300px;"></div>
</body>
</html>
由于与 caja 相关的问题,您无法在应用程序脚本中使用这些库。如果您查看应用程序脚本问题页面,您将看到更多信息,因为那里记录了一个问题。见 https://code.google.com/p/google-apps-script-issues/issues/detail?id=2949
这个例子现在确实有效。
看起来它是在 3 月中旬之后的某个时候逐渐推出的,基于 Google Apps Unscripted - 2014 年 3 月大约 50 分钟所说的内容。
相关文章:
- Google Script HtmlService,通过多个选项卡复制URL变量
- Google Script var获取未定义的值
- 将Javascript变量传递给Google Script函数(Google Sheets)
- 在HTML下载列表中获取一个带有Selected Option的var到Google Script Spreadshee
- google.script.run.withSuccessHandler(onSuccess).onSuccess 在构
- Google script/JavaScript:这在对象后面做什么:(对象名称||{});.
- google.script.run independent usage
- ReplaceAll Google script
- Google Script-合并运算符语法在IF语句中不起作用
- 参数列表Google Script后缺少)
- 当Google Script检测到后台的更改(如cron)时,它是如何发送电子邮件的
- 编写一个Google Script来生成Google Drive的变更日志
- Google Script Invalid Assignment left-hand side
- Google-Script GetRange乘法而不是加法
- Google Script: TypeError: Cannot call method "createEve
- 仅当表单完成时才运行.google.script
- 在Google Script If语句中运行RegEx
- Google Script解析JSON -下面的路径是什么?
- Google Script '带范围的函数
- Google Script外部API访问403s“速率限制”