Closest point tooltip


Sometimes the tooltip shouldn't wait for the user to hover an exact marker. It should follow the cursor and display the closest data point at any x. The canonical use case is a line chart.

Same pattern as the previous lesson, with one new trick: finding the nearest point efficiently using d3.bisector.

Members only
12 minutes read

Oh no! ๐Ÿ˜ฑ

This lesson isnโ€™t available just yet.

Take a look at the status badges next to each lesson in the sidebar to see when itโ€™s coming out.

Thanks for your patience! ๐Ÿ™