LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Change Position of Graph Cursor Name

Solved!
Go to solution

LV 8.6.1 - Win Vista

 

I've seen this question asked before, but the answers were 4-5 years ago, and maybe things are different now.

 

I have an X-Y graph (see attached pic) where I display a cursor and use the SHOW NAME attribute.

 

Outside the graph, the user can click on various things which change the location of the cursor, and change the name.  

 

In other words, I am highlighting on the graph one of several selected points.

 

The trouble is that the name seems to only show in one position relative to the cursor itself; namely directly above.

 

As you can see in the pic, the name ( "NTE B Speed" ) is not readable.

 

I would like to apply some intelligence here, to make it more useful.  Something like:

If cursor above Y-midline

    Cursor = BELOW

else

    Cursor = ABOVE

end if

If Cursor > X midline

   Cursor = LeftSide

else

   Cursor = RightSide

end if

 

The idea is to insure that the name is completely visible in all cases.

 

However, I can find no such property.

 

Suggested solutions include adding a ghost cursor which shows the name, and which I offset by an appropriate amount, and extending the plotted scale to allow room (meaning I have to handle all the auto-scaling stuff).

 

Is there a better way?

 

Would annotations help?  I've never used them.

 

 

 


Message Edited by CoastalMaineBird on 04-13-2009 10:38 AM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 7
(6,747 Views)
Solution
Accepted by topic author CoastalMaineBird
If you look at the cursor list cluster and the cursor properties there is a label position property you can use to move them. I am not in front of my laptop so I don't have the exact name etc yet, but what you are asking for you can add. Evan
Message 2 of 7
(6,718 Views)

BINGO!

 

That must be relatively new, I just upgraded to 8.6 and hadn't seen it yet. 

 

It's not available when using properties of the ACTIVE CURSOR, it's only in the cursor list (I wonder why).

 

If you access the cursor list, then index the cursor you want, then adjust the LABEL OFFSET.X and / or Y, then it does what I need.

 

Thanks! 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 7
(6,710 Views)

Just for the record, the OFFSET values are in the same units as the graph.

By that I mean that if you take the example pic above and offset it by X = 200, the label is centered over the 1800 RPM line.

It's not measuring pixels or anything.

 

That makes left or right-justifying complicated, since I don't know how long a string is, in RPM.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 7
(6,703 Views)

CoastalMaineBird wrote:

... since I don't know how long a string is, in RPM.


 

 

 

Programming >>> Graphics & Sound >>> Picture Functions >>> Get Text Rect.vi

 

will return a cluster of the bounds of a rectangle for the text you specify with the style and font of your choosing.

 

Ben

Message Edited by Ben on 04-14-2009 03:04 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(6,691 Views)

Yes, but that returns width in pixels, and that means a whole bunch of math conversions.  It can be done, but my hopes for a simple built-in function to do it are dashed.

  

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 7
(6,685 Views)
invoke node >>> Map XY to Coordinates (or its inverse) could help.
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(6,681 Views)