EmbeddedChart and Adwords Script

I am trying to create a chart in Google Spreadsheet using Adwords Script (from the Adwords platform). I used this code to create a chart:

var range2 = sheet.getRange("A1:C7"); ssNew.setActiveRange(range2); var chart = sheet.newChart() .setPosition(5, 6, 5, 5) .setChartType(Charts.ChartType.COLUMN) .addRange(sheet.getActiveRange()) .build(); sheet.insertChart(chart); 

This code works when I run it from the Script editor, but it does not happen when I run it from Adwords Script. An error has occurred:

ReferenceError: "Charts" are not defined. (line XX)

thanks

+4
source share
2 answers

It seems like graphics have now been added to AdWords scripts, give it another shot!

0
source

The charting service is part of Google Apps Script, and when you run the code in the Script editor, you have access to all the services provided by this service.

The Adwords IDE looks similar, but does not have access to these services. That's why you see the error - there is no javascript library that you can enable that will give you direct access to your table through Script Services.

However, you can use spreadsheets as the data source for your Adwords Script through the SpreadsheetApp interface so you can write the data you want in the spreadsheet from Adwords. The chart itself will be defined in the spreadsheet, of course.

0
source

All Articles