LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intensity Graph : line connecting cursors

How can I draw a line connecting two cursors on an intensity graph?

It seems impossible with LabVIEW 6i.
Does LabVIEW 6.1 do better?

Thanks.
0 Kudos
Message 1 of 5
(3,245 Views)
Hi Alfred,

there's actually a way to do it.
The principle is to overlay on the graph a transparent picture on which display the connecting segment; it is important that the graph and picture have both the same dimensions.
I attach a vi that shows how to do it.
N.B. since the picture above the graph, it is not possible to move the cursors by the usual click-and-drag method, I had to place 4 sliders around the graph to move the cursors.

Hope my example will be useful, good luck,

Alberto
0 Kudos
Message 2 of 5
(3,245 Views)
"Alfred A. Manuel" wrote in message news:<3D12F14B.B472E795@physics.unige.ch>...
> How can I draw a line connecting two cursors on an intensity graph?
>
> It seems impossible with LabVIEW 6i.
> Does LabVIEW 6.1 do better?
>
> Thanks.


Hi Alfred,
this is actually incredibly difficult. I ended up using a picture
control set to transparent placed over the graph. I could then monitor
for the cursors (polling) position and knowing the graph scale min and
max, adjust for the picture size plot area, drawing a line to this.
The down side is that you are then constrained to using the cursor
legend to move the cursors, as the picture indicator whilst set to
transparent still has to be on top of the graph so you can see the
line, and hence blocks
control of the cursors on the graph plot area.
The only option then is to have a button which sets the plot on top so
you can move the cursors, and when released, it puts the picture on
top so you can display the line.
That's about as far as my thinking takes me, unless you want to start
modifying the data sent to the intensity graph in the first place,
which would require copying the original plot data, and inserting the
MAX or MIN values into the 2D array so you can draw in place in the
data. You would have to make sure you kept an original copy so you can
"erase" the old line from the data before plotting for the new cursor
position. - This is not a good plan if you're dealing with a small
amount of data on the scales, as you're line is going to be a big
series of big blocks. (i.e. 5 x 5 would look really really blocky)

Hope this helps

Sacha.
0 Kudos
Message 3 of 5
(3,245 Views)
"Alfred A. Manuel" wrote in message news:<3D12F14B.B472E795@physics.unige.ch>...
> How can I draw a line connecting two cursors on an intensity graph?
>
> It seems impossible with LabVIEW 6i.
> Does LabVIEW 6.1 do better?
>
> Thanks.


Hi Alfred,
this is actually incredibly difficult. I ended up using a picture
control set to transparent placed over the graph. I could then monitor
for the cursors (polling) position and knowing the graph scale min and
max, adjust for the picture size plot area, drawing a line to this.
The down side is that you are then constrained to using the cursor
legend to move the cursors, as the picture indicator whilst set to
transparent still has to be on top of the graph so you can see the
line, and hence blocks
control of the cursors on the graph plot area.
The only option then is to have a button which sets the plot on top so
you can move the cursors, and when released, it puts the picture on
top so you can display the line.
That's about as far as my thinking takes me, unless you want to start
modifying the data sent to the intensity graph in the first place,
which would require copying the original plot data, and inserting the
MAX or MIN values into the 2D array so you can draw in place in the
data. You would have to make sure you kept an original copy so you can
"erase" the old line from the data before plotting for the new cursor
position. - This is not a good plan if you're dealing with a small
amount of data on the scales, as you're line is going to be a big
series of big blocks. (i.e. 5 x 5 would look really really blocky)

Hope this helps

Sacha.
0 Kudos
Message 4 of 5
(3,245 Views)
The new thread under http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000008FED0000&USEARCHCONTEXT_CATEGORY_0=_49_%24_6_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
might be helpful for you...
Message 5 of 5
(3,245 Views)