Google Spreadsheet / gscript: Chart with custom data -
is possible create chart in spreadsheet data not present in sheet (calculated data)?
so instead of
chartbuilder.addrange(sheet.getrange("a2:a5"))
i want (pseudo code)
chartbuilder.addrange({0,1,2,8,15,35})
i guess need create range custom data, couldn't find solution in documentation.
i think way if used charts , ui , showed through spreadsheet so...
var data = charts.newdatatable() .addcolumn(charts.columntype.string, "month") .addcolumn(charts.columntype.number, "in store") .addcolumn(charts.columntype.number, "online") .addrow(["january", 10, 1]) .addrow(["february", 12, 1]) .addrow(["march", 20, 2]) .addrow(["april", 25, 3]) .addrow(["may", 30, 4]) .build(); var chart = charts.newareachart() .setdatatable(data) .setstacked() .setrange(0, 40) .settitle("sales per month") .build(); var uiapp = uiapp.createapplication().settitle("my chart"); uiapp.add(chart); spreadsheetapp.getactivespreadsheet().show(uiapp);
Comments
Post a Comment