Skip to main content
100%

X-Value Mouseover

✓ Published0🌍 Public
AAndresAnayaIsaza
Last edited Feb 4, 2017
Created on Feb 4, 2017

A line chart plots daily closing prices over time. Users hover over the chart to display a tooltip showing the exact monetary value for the nearest data point. The visualization uses D3.js version 3, with a time-scaled x-axis and a linear y-axis. The code employs `d3.mouse` and `scale.invert` to translate the mouse position into an x-value, and `d3.bisector` to locate the closest date in the provided TSV data.

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.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3902569'>X-Value Mouseover</a>

gpl-3.0 Licensed

Similar vizzes