0
0
Excelspreadsheet~10 mins

Pie and doughnut charts in Excel - Interactive Code Practice

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

Complete the code to create a pie chart from data in cells A1 to B5.

Excel
ActiveSheet.Shapes.AddChart2(251, [1], Left:=100, Top:=50, Width:=300, Height:=300).Chart.SetSourceData Source:=Range("A1:B5")
Drag options to blanks, or click blank then click option'
AxlLine
BxlColumnClustered
CxlPie
DxlBarClustered
Attempts:
3 left
💡 Hint
Common Mistakes
Using a column or bar chart type instead of pie chart.
2fill in blank
medium

Complete the code to add a doughnut chart using the ChartType property.

Excel
Dim cht As Chart
Set cht = ActiveSheet.Shapes.AddChart2(251).Chart
cht.ChartType = [1]
Drag options to blanks, or click blank then click option'
AxlPie
BxlDoughnut
CxlArea
DxlScatter
Attempts:
3 left
💡 Hint
Common Mistakes
Using pie chart type instead of doughnut.
3fill in blank
hard

Fix the error in the code to set the chart title for a pie chart.

Excel
ActiveSheet.ChartObjects(1).Chart.ChartTitle.Text = [1]
Drag options to blanks, or click blank then click option'
ASales Data
B'Sales Data'
CSales_Data
D"Sales Data"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the string.
4fill in blank
hard

Fill both blanks to create a pie chart and set its data source to range A1:B4.

Excel
Dim chartObj As ChartObject
Set chartObj = ActiveSheet.ChartObjects.Add(Left:=100, Top:=50, Width:=300, Height:=300)
chartObj.Chart.ChartType = [1]
chartObj.Chart.SetSourceData Source:=Range([2])
Drag options to blanks, or click blank then click option'
AxlPie
BxlBarClustered
C"A1:B4"
D"A1:C4"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong chart type or incorrect range string.
5fill in blank
hard

Fill all three blanks to create a doughnut chart, set its data source, and add a chart title.

Excel
Dim chObj As ChartObject
Set chObj = ActiveSheet.ChartObjects.Add(Left:=50, Top:=50, Width:=350, Height:=350)
chObj.Chart.ChartType = [1]
chObj.Chart.SetSourceData Source:=Range([2])
chObj.Chart.ChartTitle.Text = [3]
Drag options to blanks, or click blank then click option'
AxlDoughnut
B"B1:C6"
C"Sales Overview"
DxlLine
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong chart type or missing quotes around strings.