LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw line on intensity graph with LV 8.2

Hi,
I am building an application in which the user should draw a line (or a rectangle or a point) on an intensity graph.
While I saw some threads on this subject, they dealt with LV7 and ignored the plot images:front option.
I tried using this option and the mouse down event, mouse up events, move pen (to the mouse down coordinates at the mouse down event) and draw line (to the mouse up coordinates at the mouse up event) but I get a line that always starts from the top left, is not in the exact direction, and always continues out of the intensity chart.
Does anyone have any idea how to do this?
Thanks,
Danielle
"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 1 of 6
(9,896 Views)

You should make sure that you have the correct coordinates. Here's a quick example to draw a line.

Modyfy as needed. There are a few thing that could be improved. 🙂

 

EDIT: there was a bug in the original VI (see below) and I have corrected the error in a new attachment (LabVIEW 8.2)

 

 

Message 2 of 6
(9,871 Views)

Hi,

Thank you altenbach! This is exactly what I was looking for.

Could you explain to me why you add [-8,8] to the [top, left] graph coordinates?

Thanks again,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 3 of 6
(9,851 Views)

Could someone upload this VI for 8.0 ?

 

Thanks in advance!

0 Kudos
Message 4 of 6
(9,372 Views)

Hi Christophe,

 

Here you go. Let me know if this works for you in 8.0.

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 5 of 6
(9,347 Views)

dsavir wrote:

Could you explain to me why you add [-8,8] to the [top, left] graph coordinates?


.... because my program has a bug. 😉

 

You need to reverse the two elements in the cluster when reading the plot bounds: "left" first, "top" below it.

 

Here's how it should look like:

 

0 Kudos
Message 6 of 6
(8,308 Views)