Example Code

Calculating the Position of a Mouse Click and Plotting the Position on an XY Graph

Code and Documents

Attachment

This VI shows how to calculate the position of a mouse click and then use this position to update the cursor on an XY graph. To calculate the mouse position, LabVIEW plots data on a graph. LabVIEW then compares the coordinates of the mouse click to the coordinates of this plotted data and snaps the cursor to the data point that is closest to the mouse click. After you select a data point with a mouse click, LabVIEW plots that data point on a second XY graph.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors