If I understood correctly, you want to drag something visually along a given line? I suggest taking the mouse coordinates input and approximate the closest value on the curve, to display the mouse cursor there. For example, if the curve would be a straight horizontal line, just display the cursor on the x value of the mouse position and the y value of the line.