It says in the charts dashboard tutorial that the dashboard can be bound to a Google Spreadsheet range as a data source. But this was not demonstrated in the tutorial, nor could I find relevant info in the Apps Script docs. It seems that Datatable cannot be bound to a spreadsheet range, as the methods only provide for adding rows and columns manually.
Does anyone know how to bind the dashboard to a range from Google Spreadsheet?
In my current code, I am assuming that the dashboard can be bound to a range from Google Spreadsheet like so, but the setDataTable function call is giving me a hard time.
var ss = SpreadsheetApp.openById(spreadsheetId);
var data = ss.getRangeByName("DataWithColHeadings");
var dashboard = Charts.newDashboardPanel()
.setDataTable(data) // throws error here! I think it is expecting a DataTableBuilder
.bind([durationFilter, lineFilter], [pieChart, tableChart])
.build();