Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Modified from
function emailCharts(sheet,emails,emailSubject){
var charts = sheet.getCharts();
to: emails,
subject: "ERROR:"+emailSubject,
htmlBody: "No charts in the spreadsheet"});
var chartBlobs=new Array(charts.length);
var emailBody="Charts<br>";
var emailImages={};
for(var i=0;i<charts.length;i++){
var builder = charts[i].modify();
builder.setOption('vAxis.format', '#');
var newchart =;
chartBlobs[i]= newchart.getAs('image/png');
emailBody= emailBody + "<p align='center'><img src='cid:chart"+i+"'></p>";
emailImages["chart"+i]= chartBlobs[i];
to: emails,
subject: emailSubject,
htmlBody: emailBody,

This comment has been minimized.

Copy link

@akkisapra akkisapra commented Nov 9, 2016

Hi @mshawksey,
I read your article on
I am looking to mail my google chart. but i could not. Can you please help me on understanding your logic and how to use it ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment