LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text on a graph

I have a client who would like to paste text notes on his XY Waveform
Graph wherever he clicks. Is there a clever way to do this?

Bruce Mihura



Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 1 of 4
(2,139 Views)
bmihura@LCtechnology.com wrote:
>
> I have a client who would like to paste text notes on his XY Waveform
> Graph wherever he clicks. Is there a clever way to do this?
>
> Bruce Mihura
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Bruce,

There is a way of placing text on XY graph with a help of cursors. There
was a discussion in Info-LabVIEW group recently. Try to dig it.

Regards,
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
0 Kudos
Message 2 of 4
(2,139 Views)
> I have a client who would like to paste text notes on his XY Waveform
> Graph wherever he clicks. Is there a clever way to do this?
>

Several ways come to mind. First off, you can give the user a button like
Add Comment. When pressed, a dialog gets the string, or the user first
types the
string first next to the button. Then use attribute/property nodes to
add a
cursor with the text somewhere in the middle of the graph. The user can then
drag it to wherever they like. Of course with a little more LV
knowledge, they
can do all of this from the cursor palette, but the button goes a long way.

To do exactly what they asked for, you will need to place a picture control
over the graph, make it transparent, and poll its mouse property. When clicked,
read in the sc
ale info from the graph, linearly map the coordinate from the
picture mouse to the graph's scale position. Then use the property node
to make
the cursor and show the text. I think this does exactly what was asked
for, but
the downside is that when the graph updates, it will take a bit longer because
its overlapped. Not a big deal if it doesn't update often. You may
also need
to use property nodes to make sure the graph and picture stay atop each other.
This also prevents the user from moving cursors already on the graph.

I suspect the next request will be to delete or move cursors, so I think the
first approach will work out better since its easy to add other things
like a
ring of cursor comments to select from for deletion, etc.

In the future this should be even easier, but that is what can be done now.

Greg McKaskle
0 Kudos
Message 3 of 4
(2,139 Views)
GAM, you're quite good. I forgot about the Picture control's mouse
property, that will work great, as there's no scrolling in this case!

Bruce Mihura


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 4 of 4
(2,139 Views)