I think it's done like this:
When the player presses the mouse button, it memorizes the position in which it was clicked.
Check if the distance in current X is greater than the memorized X (+ offset), and if so, change the graph in the required rotary direction and re-memorize the current position.
Depending on whether the distance is greater or less than the original point, the graphic is changed one way or the other.