Using Google Script, is it possible to read the title of a graph in google spreadsheets?
What I like to do is to place a specific graph from Google Spreadsheet into a Google Document in a specific location.
So far I can place a graph from Google Spreadsheet into a Google Document in a prespecified location. However, I do not yet control which graph comes where.
function test() {
SpreadsheetApp.flush();
var Grafieken = SpreadsheetApp.getActiveSheet().getCharts();
var targetDoc = DocumentApp.openById(DOC_id);
var DBody = targetDoc.getBody();
var Grafiek;
for (var i in Grafieken)
Grafiek = Grafieken[i];
var locatie = DBody.findText('%Grafiek'+i+'%').getElement().getParent().asParagraph().appendInlineImage(Grafiek);
}
}
For the script to work for me, I need to know which graph is which. I thought, that would be the easiest way to maintain to use the Graph Title for this. Any suggestions?