Range cursor

The cursor in the below figure has only data for the x axis assigned to it.

The integral between the cursor minimum and maximum is dynamically calculated whenever the cursor position is moved by a user.

The essential part of the code is shown in the following. For the full code, please refer to the source code of this page.