0
我在Google電子表格中有一個圖表。選擇菜單時,內容會隨着下拉菜單而改變。一切正常,除非我無法讓圖表名稱變得靈活。將程序變量名稱設置爲Google圖表
我希望圖表名稱爲單元格A1。
我的代碼有什麼問題?
}
function expandCharts() {
var sheet = SpreadsheetApp.getActiveSheet()
// Get a list of all charts on this Sheet.
var charts = sheet.getCharts();
for (var i in charts) {
var range = sheet.getRange("A1:D4");
var chart = charts[i];
var cell = range.getCell(1,1);
var ranges = chart.getRanges();
// Returns an EmbeddedChartBuilder with this chart’s settings.
var builder = chart.modify();
for (var j in ranges) {
var range = ranges[j];
}
// Update title.
builder.setOption('title', 'Netliq ' + cell)
// Must be called to save changes.
sheet.updateChart(builder.build());
} }