Quote Originally Posted by AxelP View Post
TI am not totally happy with getting the sample coresponding the the x-coordinate of the cursor.
Is there any way of getting a "snap" (besides closestPoint() ), maybe something like a closestPoint() of an smaler area of my x value?
You now find the upper index of the point corresponding to the current mouse position with a faster compare method and in O(log n) instead of O(n) - that's all.
If you like to run some local algo over maybe n points below and above the index, why not ?

F.e the curvetracker example interpolates between the adjacent points to guess a y coordinate for positions, where no sample exists.

Uwe