This is awesome, and the first example sounds like you've been reading my own personal spreadsheets. :-)
Wouldn't it be easier if we could define ranges like A2:B in charts like we can in the rest of the spreadsheet? Any chance that's next on your 20% list, Kevin?
@Michael - as a warmup exercise, I actually made it possible to pass a Range object (from a Sheet) to the Chart Builder setDataTable method (this isn't very well documented). However, this simply copies the current data from the range to use as a DataTable - it won't update as the sheet's data changes. If you want that, you can either use an EmbeddedChart or set a datasourceUrl instead of a DataTable/Range: https://developers.google.com/chart/interactive/docs/spreadsheets
@Magnus Kwan, you're right, that should be getRange(...).getValues() instead of getSheetValues(...) - good catch.
This is the perfect solution for a project that just came up. This will eliminate the need for any other external software or resources.
I do have a question though. It appears that you can't access a chart that has been moved into it's own sheet. I've tried accessing them by name, etc, but it appears they don't show up in the sheet list.
I've got 2 "normal" sheets and 4 charts in their own sheets for a total of 6 sheets. However, if I do:
SpreadsheetApp.getActiveSpreadsheet().getNumSheets(); returns 2, not 6.
So, it appears that charts in their own sheet aren't accessible, or am I missing something obvious?
Hi Nathan, I'm sorry that doesn't work yet - those special sheets aren't exposed. It'll take some work to get them exposed properly (so that you can create, delete, etc them instead of just editing the chart) - I'll see what we can do.
Thanks Kevin, at least I know I'm not totally botching something.
I'll play around with it a bit, I'm sure I can figure out some sort of a workaround. I'm thinking I'll look at the configuration of each chart by copying it and then trying to duplicate it with this new API.
If I can do that, then I'll just create an actual sheet and embed the chart in it, instead of moving it to it's own sheet.
Hi Kevin! Is there a way to set DataTable Rolse roles (as in https://developers.google.com/chart/interactive/docs/roles#assigningarole). The goal is to have decent error bars coming from a cell value (min/max)...
Hi Kevin, this has been very usefull in my proyect but I'm having a problem, I'm traying to graph more than 30 arrows but it only shows 20 in the graphic. It has something to do with the code??
Hi Kevin, this has been very usefull in my proyect, but I'm having a problem, I'm traying to graph more than 30 rows but in the graphic it shows 20 only, Is it have something to do with the code?
how do you build a chart with 2 series, one on the left vertical axis and one on the right vertical axis? i just can't find any option for that, even though you can easily build it with the gui.
14 comments :
Been waiting for a feature like this to match Excel's Dynamic Charts for a while now. Thanks Google!
This is awesome, and the first example sounds like you've been reading my own personal spreadsheets. :-)
Wouldn't it be easier if we could define ranges like A2:B in charts like we can in the rest of the spreadsheet? Any chance that's next on your 20% list, Kevin?
Couldn't find the reference for function getSheetValues() in rangeShouldExpand_();
Should that be the second getRange() in https://developers.google.com/apps-script/class_sheet#getRange ?
This is awesome... thankx google.
Converage Integrated Media Solutions
@Michael - as a warmup exercise, I actually made it possible to pass a Range object (from a Sheet) to the Chart Builder setDataTable method (this isn't very well documented). However, this simply copies the current data from the range to use as a DataTable - it won't update as the sheet's data changes. If you want that, you can either use an EmbeddedChart or set a datasourceUrl instead of a DataTable/Range: https://developers.google.com/chart/interactive/docs/spreadsheets
@Magnus Kwan, you're right, that should be getRange(...).getValues() instead of getSheetValues(...) - good catch.
Thanks guys! I've been waiting over a year for this feature!
This is the perfect solution for a project that just came up. This will eliminate the need for any other external software or resources.
I do have a question though. It appears that you can't access a chart that has been moved into it's own sheet. I've tried accessing them by name, etc, but it appears they don't show up in the sheet list.
I've got 2 "normal" sheets and 4 charts in their own sheets for a total of 6 sheets. However, if I do:
SpreadsheetApp.getActiveSpreadsheet().getNumSheets(); returns 2, not 6.
So, it appears that charts in their own sheet aren't accessible, or am I missing something obvious?
Thanks for the fantastic updates!
Hi Nathan,
I'm sorry that doesn't work yet - those special sheets aren't exposed. It'll take some work to get them exposed properly (so that you can create, delete, etc them instead of just editing the chart) - I'll see what we can do.
Thanks Kevin, at least I know I'm not totally botching something.
I'll play around with it a bit, I'm sure I can figure out some sort of a workaround. I'm thinking I'll look at the configuration of each chart by copying it and then trying to duplicate it with this new API.
If I can do that, then I'll just create an actual sheet and embed the chart in it, instead of moving it to it's own sheet.
Thanks again!
Hi Kevin! Is there a way to set DataTable Rolse roles (as in https://developers.google.com/chart/interactive/docs/roles#assigningarole). The goal is to have decent error bars coming from a cell value (min/max)...
Best,
Guillermo
Hi Kevin, this has been very usefull in my proyect but I'm having a problem, I'm traying to graph more than 30 arrows but it only shows 20 in the graphic. It has something to do with the code??
Thanks
Hi Kevin, this has been very usefull in my proyect, but I'm having a problem, I'm traying to graph more than 30 rows but in the graphic it shows 20 only, Is it have something to do with the code?
Thanks
Hi Kevin,
Does any way for use Spreadsheet charts from gae Spreadsheet api?
Thanks
how do you build a chart with 2 series, one on the left vertical axis and one on the right vertical axis?
i just can't find any option for that, even though you can easily build it with the gui.
Post a Comment