Intermediate
A chart that can shrink
Two buttons redraw the chart: 7 days and 3 days. The page starts with 5. The starter only handles growing: after 3 days it still shows the old bars.
Fix draw with a full join, so each click leaves exactly as many bars as there are values, and clicking 7 days again does not add more.
What Check tests
- The page starts with 5 bars
- After 7 days there are 7 bars
- After 3 days there are 3 bars, with the new values
- Going back to 7 days gives 7, not 10
- No attribute holds NaN
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.