Using EmbeddedChartBuilder and "getting columns outside borders"

This is my short function that keeps getting "These columns are out of bounds"

function myFunction() {
var  sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getDataRange();
var chartBuilder = sheet.newChart();
chartBuilder.addRange(range).setChartType(Charts.ChartType.LINE).setOption('title', 'My Line Chart!');
sheet.insertChart(chartBuilder.build());
}

I have tried sheet.getRange("A1:B6").

The first column is dates, and the second column is int. The standard Paste GUI can use the data as is.

Has anyone had success with the new EmbeddedGraph classes? thank

+5
source share
1 answer

, , . . setPosition chartBuilder, , . , 1, 1, , , , , .

sheet.insertChart(chartBuilder.setPosition(7, 1, 1, 1).build());

setPosition : int Row, int Col, , .

+9

All Articles