0

Google Spreadsheet has support for radar charts, they're under line charts.

Google Apps Script has support for most (all?) of Spreadsheet's charts. However I can't find any option on the documentation to turn a line chart into a radar one, or to create one from scratch.

Alternatively, is there any free service that will generate a radar chart image so that I can fetch it from GAS?

sker
  • 17,842
  • 8
  • 37
  • 41
  • 1
    Have you looked into the [Charts API](https://developers.google.com/chart/) to make your own [Radar Chart](https://developers.google.com/chart/image/docs/gallery/radar_charts)? – Andy Apr 09 '15 at 16:07
  • How many chart APIs does Google have? I had taken a look at other three apis, but not this one. Probably because it's deprecated. But hey, I don't discriminate, if it gets the job done. Thank you for pointing it out, I will take a look and see if it works. – sker Apr 09 '15 at 16:46

1 Answers1

0

I used the Image Charts API as pointed out by Andy. Here's how to do it:

function testRadar() {
  var url = 'https://chart.googleapis.com/chart?cht=rs&chs=500x500&chd=t:77,66,15,0,31,48,100,77%7C20,36,100,2,0,100&chco=FF0000,FF9900&chls=2.0,4.0,0.0%7C2.0,4.0,0.0&chxt=x&chxl=0:%7C0%7C45%7C90%7C135%7C180%7C225%7C270%7C315&chxr=0,0.0,360.0&chg=25.0,25.0,4.0,4.0&chm=B,FF000080,0,1.0,5.0%7CB,FF990080,1,1.0,5.0';
  var chart = UrlFetchApp.fetch(url).getBlob().getAs('image/png');
  var doc = DocumentApp.create('testRadar');
  doc.getBody().appendImage(chart);
  doc.saveAndClose();
}

Use string concatenation to build your URL, fetch it, append it, save.

Use URL encoding to prevent GAS from complaining about unexpected characters.

Community
  • 1
  • 1
sker
  • 17,842
  • 8
  • 37
  • 41