shutterstock/rickshaw — pull request #203 by mayt (2013-02-15 00:50:44+00:00)
Title: Fix HoverDetail to hover on second to last element

Currently if you try to hover over the second to last element in a graph, it will only work if you are directly above it. If you are a pixel greater, it will snap to the last element.

This change will now snap the hover to a value closest to the data value rather than just the floor of the data value.

Eg where aI is the approximateIndex

case 1:
| i |
a1 a2
in the case it will pick a1

case 2:
| i |
a1 a2
in the case it will pick a2