LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drawing connected direct lines using the mouse

Hallo all,
What I want to do is, to draw connected lines on a graph using just the mouse...
First I will define min and max values for (x,y) -graph range- using the property node...
Then using the mouse I want to draw frequency ramps over time like in FMCW modulation... For example it will just draw the ramps by connecting several points marked by my mouse clicks on the graph. Moreover I need the (x,y) values that I click on the graph...
Thanks,
Ogulcan
0 Kudos
Message 1 of 7
(3,548 Views)
There are a couple of shipping examples. One is called Draw Graph and the other is Draw Graph with Events. These both use the XY Graph.
Message 2 of 7
(3,539 Views)
Alternatively, it might be more user friendly if you would simply place a few cursors on the graph. Now you can move them around at will, e.g. even nudge their positions later.

Simply read out the cursor positions whenever one of them changes position and redraw the graph accordingly. 🙂
Message 3 of 7
(3,532 Views)
Thanks for the tip... I have tried them and worked out fine...
One more question... How can I make a cursor follow my mouse? I mean is there any example file about it. The basic idea is I guess that I first read the mouse position then write it into cursor position...

Ogulcan
0 Kudos
Message 4 of 7
(3,511 Views)
Hmm, this does not sound very clear. Do you want the cursor to follow the mouse even when the mouse button is up. If you have multiple cursors, which one should be followed? What should happen if you move the mouse outside the window? How do you release the cursor from the mouse when done?

I think it is much easier if you just drag the cursors via the normal mechanism. It is most direct and intuitive. See attached LabVIEW 7.1 example. For another example of moving points, have a look at this older thread..

Message Edited by altenbach on 06-28-2005 10:13 AM

Message 5 of 7
(3,500 Views)
What I have done was taking the draw_graph_with_event.vi, creating a cursor and then make the cursor follow my mouse in order to see the coordinates I choose... It worked fine except some kind of offset between mouse position and drawing point... But I guess doing it in your way provide more precise point selection. Thanks for help...
Take care...
0 Kudos
Message 6 of 7
(3,483 Views)

Hi Ogulcan,

Could you kindly post your final vi on the subject? I am running into a similar problem. Many thanks. Bryan

0 Kudos
Message 7 of 7
(3,383 Views)