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 email@example.com http://acs.levsha.ru
> 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.