Advanced
Timed: a tooltip on a line (15 minutes)
Interview-style task, about 15 minutes. The line shows seven days at x = 20, 80, 140, 200, 260, 320 and 380. When the pointer moves over the chart, #tip must show the nearest day and its rides, as Wed: 3,759.
A pointer left of the first point or right of the last must show the first or last day, with no error in the console.
What Check tests
- Pointing near Wednesday shows Wed: 3,759
- Pointing between Thu and Fri picks the nearer one
- Left of the first point shows Mon
- Right of the last point shows Sun, with no error
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.