0
0
Google Sheetsspreadsheet~10 mins

Embedding charts in Docs and Slides in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to insert a chart from Sheets into a Google Doc.

Google Sheets
InsertChart = DocsApp.getActiveDocument().getBody().append[1](chart);
Drag options to blanks, or click blank then click option'
AcreateChart
BappendChart
CinsertChart
DaddChart
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that does not exist like appendChart or addChart.
Trying to use createChart which is for creating charts, not inserting.
2fill in blank
medium

Complete the code to link a chart from Sheets into Slides so it updates automatically.

Google Sheets
slide.insertSheetsChartAsImage(sheetChart).[1](true);
Drag options to blanks, or click blank then click option'
AlinkChart
BlinkToSpreadsheet
CsetLinked
DsetLinkToSpreadsheet
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that does not exist like linkChart or setLinked.
Forgetting to set the link to true, so the chart won't update.
3fill in blank
hard

Fix the error in the code to update a linked chart in Slides.

Google Sheets
var charts = slide.getSheetsCharts(); charts[0].[1]();
Drag options to blanks, or click blank then click option'
Aupdate
Brefresh
CrefreshChart
DupdateChart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'refresh' which is not a valid method for Sheets charts in Slides.
Using 'updateChart' which does not exist.
4fill in blank
hard

Fill both blanks to create and insert a chart from Sheets into Slides with a link.

Google Sheets
var chart = sheet.getCharts()[0]; var image = slide.insertSheetsChartAsImage(chart).[1]([2]);
Drag options to blanks, or click blank then click option'
AsetLinkToSpreadsheet
Btrue
Cfalse
DlinkChart
Attempts:
3 left
💡 Hint
Common Mistakes
Using false instead of true disables linking.
Using a non-existent method like linkChart.
5fill in blank
hard

Fill all three blanks to insert a chart into a Google Doc and update it later.

Google Sheets
var chart = sheet.getCharts()[[1]]; var docChart = doc.getBody().append[2](chart); docChart.[3]();
Drag options to blanks, or click blank then click option'
A0
BinsertChart
Crefresh
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for the first chart index.
Using refresh() instead of update() to refresh the chart.