LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot vertical line on top of intensity graph at certain x value

 
0 Kudos
Message 1 of 10
(4,171 Views)
I am not positive this is what you are looking for, but you could enable a cursor on the intesity graph and set the x position of the cursor. This could be assigned statically or dynamically using property nodes.
Message 2 of 10
(4,163 Views)
If I were to use cursors, do you know how I could create multiple ones without using the front panel. Basically I want to be able to click on my intensity graph with the mouse and have a cursor appear at that location. However I do not want there to be a limit on the number of cursors that can be created by clicking the mouse.
0 Kudos
Message 3 of 10
(4,168 Views)
The main difficulty is to calculate the X position from the click position. First, you have to find the position in the graph pane. The left position of the pane is obtained by subtracting the width of the Y scale to its left position. Then there are some basic calculations to convert the click relative position to the corresponding X value, using the scale min and max.
The second point is to create a cursor. Use the "Cursor list" attribute, which is an array of all the available cursors properties, and append a new one to the list.

Attached is a simplified version of a tool I developed some times ago with the same goal.
It answers to questions you didn't ask :
- How can I move an existing cursor without creating a new one each time I click on the graph ?
answer : the cursors are only created when you hold down the key while clicking
- How can I remove a cursor ?
answer : hold the key down while clicking close to the cursor you want to delete.

Have a look at the way the closest cursor is detected, by calculating the distance between the click position and the cursors.

Since I still have difficulties with the size of the attached documents, the vi is divided in several subs.

CC
Chilly Charly    (aka CC)
Message 4 of 10
(4,129 Views)
Subs 1 and 2 (one more to come...)
Chilly Charly    (aka CC)
0 Kudos
Message 5 of 10
(4,128 Views)
Sub 1...
Chilly Charly    (aka CC)
0 Kudos
Message 6 of 10
(4,123 Views)
Sub 2
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 10
(4,123 Views)
And sub 3...
Chilly Charly    (aka CC)
0 Kudos
Message 8 of 10
(4,123 Views)
is there any example?
0 Kudos
Message 9 of 10
(3,887 Views)


@weichengatech wrote:
is there any example?

You just replied in a thread that is over one year old and already contains several examples. What exactly are you looking for?
0 Kudos
Message 10 of 10
(3,880 Views)