Command Palette

Search for a command to run...

Hectal
Phase 8: Interaction
Data Visualization · Exercise 3 of 4 PreviousNext
Intermediate

A legend with an empty state

The three buttons hide and show their bars. When every bar is hidden the chart is blank and the reader has no clue why.

Show #empty (with the text No districts selected) when all three are hidden, and hide it again as soon as one is shown.

What Check tests

  1. At the start #empty is hidden
  2. Hiding one bar keeps #empty hidden and dims one bar
  3. Hiding all three shows No districts selected
  4. Showing one again hides the message

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.