Chart image in email from Google spreadsheet with google-apps-script returns white image

后端 未结 2 1401
春和景丽
春和景丽 2021-01-25 04:02

I\'m sending a report every night to my own gmail address. Suddenly since a week or so the image of the chart has turned blank. There is only one chart.

function         


        
相关标签:
2条回答
  • 2021-01-25 04:50

    Not sure why this would have stopped working, but you might want to try dropping the "getBlob()" part and see if that helps. Documentation suggests the below code should work.

    var areaBlob = charts[0].getAs('image/png').setName("areaBlob");
    

    https://developers.google.com/apps-script/reference/spreadsheet/embedded-chart#getAs(String)

    0 讨论(0)
  • 2021-01-25 04:57

    The blank image is due to a sharing permissions issue. Change the share settings of the spreadsheet to "Anyone who has the link can view" and the chart will then be exportable from your script.

    0 讨论(0)
提交回复
热议问题