Skip to main content
100%

X-Value Mouseover

✓ Published0🌍 Public
Mmbostock
Last edited Mar 7, 2019
Created on Oct 16, 2012

A line chart of daily closing prices displays a tooltip on mouseover, revealing the exact price at the nearest data point. The visualization uses D3.js v3 with SVG rendering, reading data from an external TSV file. As the mouse moves over an overlay rectangle, d3.mouse and a time scale’s invert method convert screen coordinates to dates, while a d3.bisector identifies the closest entry. The focus circle and text update accordingly, showing the formatted currency value.

AI-generated description

A line chart with mouseover so that you can read the y-value based on the closest x-value. The x-value is found using d3.mouse and scale.invert. The y-value is then found by bisecting the data.

gpl-3.0 Licensed

Similar vizzes