I use a function to update charts in my presentation. This presentation needs to be shared, but will also be updated periodically. Now, I copy the presentation to keep the original presentation for updates, and unlink all charts one-by-one. I am searching for a function that will unlink all charts once I copied the presentation to be able to share it.
Is there a function that will solve this issue?
function createRefreshSheetsChartsRequests(presentation) { var objectIds = []; var slides = presentation.slides;
for (var i = 6; i < slides.length - slides.length + 9; i++) {
var slide = slides[i];
var pageElements = slide.pageElements;
for (var j = 0; j < pageElements.length; j++) {
var pageElement = pageElements[j];
if (pageElement.sheetsChart) {
objectIds.push(pageElement.objectId);
}
}
}
return objectIds.map(function(objectId) {
return {refreshSheetsChart: {objectId: objectId}};
});
}