2014-01-11 50 views
0

我想建立一个谷歌UiApp图表仪表板,我有问题加载必要的库。我在第8行收到syntext错误,这是“google.load('visualization',...”)行。我从字面上复制粘贴教程中的示例,并且该行不断出现错误。 ?想法我很新的这一点,只是想按照这里的方向凑了演示:https://google-developers.appspot.com/chart/interactive/docs/basic_load_libs谷歌可视化库没有加载 - 语法错误

<!--Load the AJAX API--> 
<script type="text/javascript" src="https://www.google.com/jsapi"></script> 
<script type="text/javascript"> 

// Load the Visualization API library and the piechart library. 
google.load('visualization', '1.0', {'packages':['corechart', 'piechart']}); 
google.setOnLoadCallback(drawChart); 
    // insert charts here 

</script> 
+0

如果我没有记错,Google UiApp使用的是Apps脚本,而不是JavaScript,因此您需要使用Visualization API的Apps脚本实现。[Documentation here](https:// devel opers.google.com/apps-script/reference/charts/?csw=1) – asgallant

回答

0

这是我如何使用它,这对我的工作(例如在:http://jsfiddle.net/UT2G7/):

google.load('visualization','1.0',{'packages':['corechart']});