Is there a way to take the Title Text from the Google Sheets cell?
So whenever I change the cell string then it should appear in the Chart automatically.
For example: I have May - 2021 in cell A1. Can I reference this in Title Text, like using =A1 or =Sheet1!A1? But it does not work.
I got this code, but how do I reference the cell into the code?
function onOpen() {
SpreadsheetApp.getUi().createMenu('Charts').addItem('Update', 'myFunction').addToUi();
}
function myFunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var chart = sheet.getCharts()[0];
chart = chart.modify()
.setOption('Summary!Q123', sheet.getActiveCell().getValue() || 'Summary!Q123')
.build();
sheet.updateChart(chart);
}


