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.

X-Y Example.png

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....

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

Comments
Exovede
Member
Member
on

Can't load this vi in LabVIEW 2009.  Error says that this vi is from LabVIEW 2010.

GerdW
Knight of NI Knight of NI
Knight of NI
on

VI converted to LV2009 can be found here:

http://forums.ni.com/t5/LabVIEW/Downconvert-VI-Requests/m-p/1318263/highlight/false#M539830

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
aveo
Member
Member
on

Hi All,

I was going through the block diagram to understand the program. I see that there is a property node of the XY graph called PlotAreaPos used inside the event- "Initial Data":Mouse Up. I searched for the same property node but could not find it anywhere. Where to find it?

jgoss
Member
Member
on

Hello everyone! 

Although the topic is pretty old I have made some effort to resolve 2 issues and make the program working on LabVIEW 2015.

So you should do the following:

1. "OldCrsrList" replace by "CrsrList" 

2. "PlotAreaPos" replace by "PlotBounds->Left/Right"

The rest seems the same

Contributors