Data Visualization · Exercise 4 of 4 Previous
Intermediate
The stations box, with an empty state
show(rows) should draw the stations running low into #low: at most 5, below 40% full, emptiest first, one rect per station with data-name, width share × 240.
When no station qualifies, the box must say No station is below 40% full (as text in the box) instead of staying empty. Finish show so both cases work.
What Check tests
- Five bars are drawn for the nine stations
- The order is Clock Tower, Rope Walk, West Gate, Station Road, Hill
- Widths are 48, 84, 84, 88, 88
- Chapel (41.7% full) is not drawn
- With no stations the box says No station is below 40% full
- A station with 0 docks does not break the chart
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.