Ich versuche, den untenstehenden Code zu beheben (das Hauptproblem ist, dass ich den Bereich nicht anzeigen kann) und ich habe einen Protokollbefehl eingefügt, um anzuzeigen, was gedruckt wird aus. Wenn ich doGet() starte und zu View> Logs gehe, heißt es: "[16-10-07 17: 31: 19: 145 EDT] Nummer für Sie: Bereich"Problem mit Konsolenprotokoll für Google Apps-Skripts
sheet.getRange ("H1: DE1") bezieht sich auf einen Teil einer Zeile mit Datumsangaben. Sollte es nicht den Inhalt der Reihe auflisten?
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);
}
Kann jemand beraten?