how to get the Y value on the curve using flot js
Using the flot js graphing library, you can get the (x,y) position of th开发者_JAVA百科e mouse. Given a curve represented by plot values, how can you get the interpolated Y value on the curve for the given mouse position?
There's a crosshair/tracking demo on their pages. It has an updateLegend
method which simply takes the nearest x values at the crosshair line and does some linear interpolation.
精彩评论