我想解决以下代码(主要问题是,我无法获得范围显示),我已经包含一个日志命令显示正在打印出。当我运行doGet()并转到View> Logs时,它会显示:“[16-10-07 17:31:19:145 EDT] number:Range”问题与控制台日志谷歌应用程序脚本
sheet.getRange(“H1:DE1” )是指具有日期的行的一部分。它不应该列出该行的内容吗?
function doGet() {
// The code below opens a spreadsheet using its id and logs the name for it.
// Note that the spreadsheet is NOT physically opened on the client side.
// It is opened on the server only (for modification by the script).
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1aCXXXXXXXXXXXXw61H6VuigRf6YykW8O6A0WWmG46VO7ijI/edit#gid=1673918325');
Logger.log(ss.getName());
var sheet = ss.getSheets()[1];
var range = sheet.getRange("H1:DE1");
Logger.log('number for you: %s', range);
// Calling this method with "true" sets the first line to be the title of the axes
var datatable = range.getDataTable(true);
// Note that this doesn't build an EmbeddedChart, so we can't just use
// Sheet#insertChart(). If we want to do that, we should use
// sheet.newChart().addRange() instead.
var chart = Charts.newBarChart()
.setDataTable(datatable)
.setOption("title", "Your Title Here")
.build();
var app = UiApp.createApplication();
app.add(chart);
ss.show(app);
}
有谁能提醒?