Skip to main content
100%

Favorite tooltip (complex version) v7

✓ Published0🌍 Public
Dd3noob
Last edited Jun 19, 2021
Created on Jun 19, 2021

A line chart displays stock closing prices over time, with a crosshair and tooltip that follow the mouse cursor. The visualization uses D3 v7 to render an SVG chart, reading CSV data with `d3.csv` and parsing dates via `d3.timeParse`. A `d3.bisector` finds the nearest data point, while `d3.pointer` locates the cursor position. The tooltip shows the exact date and value, with dashed guide lines and a highlighted circle, using `d3.scaleTime`, `d3.scaleLinear`, and `d3.axisBottom`/`d3.axisLeft`.

AI-generated description

This is a follow on from the simple tooltip graph written with d3.js v7.

It extends a tooltip technique which I find particularly neat.

This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 7 of d3.js.

mit Licensed

Similar vizzes