Skip to main content
100%

D3 v4 X-Value Mouseover with Droplines

✓ Published0🌍 Public
MMbrownshoes
Last edited Oct 24, 2017
Created on Oct 24, 2017

This example shows a line chart of daily closing prices, displaying a crosshair and a tooltip with the precise dollar value as the mouse moves over the plot. The visualization is built with D3 v4, using the `d3.line` generator to create the path and `d3.axisBottom` and `d3.axisLeft` for the axes. A transparent `rect` overlay captures mouse events, and a `d3.bisector` function finds the nearest data point to the cursor’s x-coordinate, triggering the droplines and value label. The data is loaded from a TSV file with a date and close price per row.

AI-generated description

a D3 version 4 fork of @micahstubbs' bl.ock ES2015 X-Value Mouseover with Droplines

D3 v4 syntax cues taken from mbostock's bl.ock Line Chart 4.0

forked from <a href='http://bl.ocks.org/micahstubbs/'>micahstubbs</a>'s block: <a href='http://bl.ocks.org/micahstubbs/e4f5c830c264d26621b80b754219ae1b'>D3 v4 X-Value Mouseover with Droplines</a>

gpl-3.0 Licensed

Similar vizzes