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
- At the start #empty is hidden
- Hiding one bar keeps #empty hidden and dims one bar
- Hiding all three shows No districts selected
- 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.