0
0
Tableaubi_tool~10 mins

Label display in Tableau - Interactive Code Practice

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

Complete the code to show labels on all marks in Tableau.

Tableau
worksheet.showMarksLabels([1])
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cnull
Dundefined
Attempts:
3 left
💡 Hint
Common Mistakes
Using false will hide labels instead of showing them.
Passing null or undefined causes errors.
2fill in blank
medium

Complete the code to set label font size to 12 in Tableau.

Tableau
worksheet.getMarks().forEach(mark => mark.setLabelFontSize([1]))
Drag options to blanks, or click blank then click option'
A10
B14
C12
D16
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a font size too small makes labels hard to read.
Choosing a font size too large may clutter the view.
3fill in blank
hard

Fix the error in the code to toggle label visibility correctly.

Tableau
if (worksheet.labelsVisible [1]) { worksheet.showMarksLabels(false) } else { worksheet.showMarksLabels(true) }
Drag options to blanks, or click blank then click option'
Atrue
B=== true
C== true
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using single equals = assigns value instead of comparing.
Using == works but strict equality === is better.
4fill in blank
hard

Fill both blanks to set label color and alignment in Tableau.

Tableau
worksheet.getMarks().forEach(mark => { mark.setLabelColor([1]); mark.setLabelAlignment([2]); })
Drag options to blanks, or click blank then click option'
A"#000000"
B"#FF0000"
C"center"
D"left"
Attempts:
3 left
💡 Hint
Common Mistakes
Using color codes without quotes causes errors.
Using invalid alignment strings causes labels to misalign.
5fill in blank
hard

Fill all three blanks to create a calculated field for label display condition.

Tableau
IF [1] > [2] THEN '[3]' ELSE '' END
Drag options to blanks, or click blank then click option'
A[Sales]
B1000
CShow
DProfit
Attempts:
3 left
💡 Hint
Common Mistakes
Using a dimension instead of a measure in the condition.
Putting numbers in quotes causing syntax errors.