admin管理员组文章数量:1399942
I'm trying to follow the instructions from this post: How to dynamically adjust a Google Sheets chart vertical (y) axis minimum and maximum value to data set? but I'm getting an access exception. I've added a test to verify that I can access cells on the sheet and that works but the call to updateChart(chart) fails saying:
Exception: Service Spreadsheets failed while accessing document with id <my sheet's iD>. at updateChart(Code:14:9)
The "Hello" and values for min/max do correctly appear in D46:D48. I have no known (to me) permissions set on the sheet or on any ranges within.
Any idea why I'm getting this exception?
function updateChart(){
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('NetWorth Dashboard');
sheet.getRange('d46').setValue("HELLO");
var nw_max = sheet.getRange("nw_dev_chart_max").getValue();
var nw_min = sheet.getRange("nw_dev_chart_min").getValue();
sheet.getRange('d47').setValue(nw_min);
sheet.getRange('d48').setValue(nw_max);
var chart = sheet.getCharts()[0];
chart = chart.modify()
.setOption('vAxes.0.viewWindow.max', nw_max)
.setOption('vAxes.0.viewWindow.min', nw_min)
.build();
sheet.updateChart(chart);
}
I reverted the script's setOption lines and created an example spreadsheet: #gid=906716897
本文标签: google sheetsProblem with dynamic setting of v axis rangeStack Overflow
版权声明:本文标题:google sheets - Problem with dynamic setting of v axis range - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744222499a2595936.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论