X-Value Mouseover
A line chart visualizes the closing price of a stock over time, sorted from December 2011 to May 2012. Moving the mouse over the chart displays a small circle and a text label showing the exact price at the nearest data point. The interaction uses `d3.mouse` and the x-scale’s `invert` method to map the cursor’s x-coordinate back to a date, then `d3.bisector` finds the closest data point. The visualization is rendered as an SVG using `d3.svg.line` for the path and `d3.svg.axis` for the axes, with price data loaded from a TSV file.
AI-generated descriptionA 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>