Favorite tooltip (complex version)
This interactive line chart displays a time series of stock closing prices, with a crosshair and tooltip that track the mouse to reveal the exact date and value at the nearest data point. The visualization, built with D3.js (version 3.5.17), renders the data from a CSV file as an SVG line chart. It uses D3’s time scale, linear scale, and axes, while the tooltip logic relies on a bisector to find the closest point and updates the position and text of SVG elements on mousemove events.
AI-generated descriptionThis is a follow on from the favorite simple tooltip graph used as an example in the book D3 Tips and Tricks.
It impliments a more complex example than the simple version and is designed to illustrate additional things you can do with the technique. It should be taken in context with the text of the book which can be downloaded for free from Leanpub.