Spreadsheet pie chart into a text document preserving its style?

75 Views Asked by At

I am embedding a pie chart from a spreadsheet into a text document using a google apps-script.

The point is the chart style is significantly modified.

The script is quite simple: get the first chart in the active sheet, open text document and append it in the body.

const s = SpreadsheetApp.getActiveSheet();
const chart = s.getCharts()[0];
const doc = DocumentApp.openById("XXXXXX-YYYYYY .... myID");
doc.getBody().appendImage(chart);

The expected result is the spreadsheet chart into the document with the original appearance, which looks like shown in the next image. Note that I'm able to get the exact look in the document doing copy&paste manually, my concern is doing it by script.

enter image description here

The chart I'm able to get in the document:

enter image description here

0

There are 0 best solutions below