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 13
(11,066 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 13
(11,041 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 13
(11,021 Views)

Could someone upload this VI for 8.0 ?

 

Thanks in advance!

0 Kudos
Message 4 of 13
(10,542 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 13
(10,517 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 13
(9,478 Views)

I try to use the code as a part of a program.

 

The drawing must only be active after a button is ON. But, the program freezes as soon as the cursor is over a graph when the button is OFF.

 

I am attaching the code. I don't know what causes the problem. Do you?

 

0 Kudos
Message 7 of 13
(1,100 Views)

The problem is with the Unresolved Event of Mouse Move. I do not know how to bypass the issue.

 

Therefore, I decided to create a new program without an Event Structure. I have attached the file. 

0 Kudos
Message 8 of 13
(1,082 Views)

Hi,

 

Thank you for these solutions.

I was wondering if it was also possible to draw a line, a rectangle or a circle on a graph but with transparency, so that the background graph is still visible ? 

I know it may not be straightforward, but have no idea how to do it...

 

Thank you in advance !

Sam 

0 Kudos
Message 9 of 13
(458 Views)

Hi Sam,

 


@Samdub19 wrote:

I was wondering if it was also possible to draw a line, a rectangle or a circle on a graph but with transparency, so that the background graph is still visible ? 


Which kind of graph are you talking about?

What is a "background graph"?

 

In general waveform graphs support to use "plot images" (back, middle, front) so you can draw any kind of 2DPicture and "embed" it into your graph…

(Intensity graph supports just a "front" plot image.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 13
(449 Views)