Complete the code to create a chart from data in range A1:B5.
var chart = sheet.newChart().setChartType(Charts.ChartType.LINE).addRange(sheet.getRange([1])).build();The data range for the chart is A1:B5, so the correct range string is "A1:B5".
Complete the code to move the chart to a new sheet named 'ChartSheet'.
var chartSheet = spreadsheet.[1]('ChartSheet'); chartSheet.insertChart(chart);
To create a new sheet for the chart, use insertSheet('ChartSheet').
Fix the error in the code to move the chart to a new sheet.
var newSheet = spreadsheet.insertSheet('ChartSheet'); newSheet.[1](chart);
The correct method to add a chart to a sheet is insertChart(chart).
Fill both blanks to create a chart and move it to a new sheet named 'SalesChart'.
var chart = sheet.newChart().setChartType(Charts.ChartType.COLUMN).addRange(sheet.getRange([1])).build(); var chartSheet = spreadsheet.[2]('SalesChart'); chartSheet.insertChart(chart);
The data range is A1:B10 and a new sheet is created with insertSheet('SalesChart').
Fill all three blanks to create a pie chart from range C1:D7 and move it to a new sheet named 'PieChart'.
var chart = sheet.newChart().setChartType(Charts.ChartType.[1]).addRange(sheet.getRange([2])).build(); var chartSheet = spreadsheet.[3]('PieChart'); chartSheet.insertChart(chart);
The chart type is PIE, the data range is "C1:D7", and the new sheet is created with insertSheet.