LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative cursor legend controls

I wanted to be able to programmatically move waveform and XY graph cursor legends so that my users can move the legend out of the way when they plot data.  I provide this for the plot legend and it works great since I don't want the legends taking up space outside the plot area.

 

Alas, for some odd reason, LabView simply doesn't allow it.  There are no properties exposed for interacting with the cursor legend.  Ideas have made it to the exchange, but those were declined due to lack of interest.

 

There are workarounds like:

 

https://forums.ni.com/t5/Example-Programs/Moving-a-Graph-Cursor-Legend-Programmatically/ta-p/3502530

 

But this is at the expense of the functionality of the built in cursor legend control.  So, are there alternatives to the cursor legend control that mimic the functionality of that control while providing property based interaction?  Or is there any hidden way to control the position and vertical size that has evaded my Google searches?

 

Thanks,


XL600

0 Kudos
Message 1 of 7
(3,457 Views)

I'm afraid it's "use the build in functionality", or do it all yourself.

 

The workaround that is shown only implements a few features. Potentially, everything that the build in cursor legend does, can be done through properties. It is annoying that you have to do that though...

 

0 Kudos
Message 2 of 7
(3,410 Views)

That’s for sure.  I was thinking if there might be a way to use the cursor legend visible property to alter the graph vi size.  Place the cursor legend outside the graph, but when the user turns it on, alter the vi so the legend is visible.  I’ll have to experiment with that since right now I have the graph set to scale with the pane.  That would have to be disabled and manually controlled since there would be two conditions for the scaling (showing the cursor legend and not showing).

 

btw... this particular graph vi is reentrant and meant to pop up with many potential graphs displaying at the same time.  So total vi size needs to be compact but yet showing the maximum amount of plot area possible per graph (hence only showing cursors and the cursor legend on particular instances the user chooses to add them to). This cursor legend property limitation makes that a very difficult task.

0 Kudos
Message 3 of 7
(3,405 Views)

@xl600 wrote:

This cursor legend property limitation makes that a very difficult task.


I feel your pain. The plot legend is no peach either.

0 Kudos
Message 4 of 7
(3,401 Views)

1 thought...

 

Add another graph with the same data but size the pot area down to minimal and move cursor legend over top of the plot area. You can then position hide/show the new graph and then use events to keep the two graphs sync-ed up with each other.

 

Still requires some coding but you do get to functionality of the cursor legend.

 

Ben

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
(3,386 Views)

@Ben wrote:

 

Add another graph with the same data but size the pot area down to minimal and move cursor legend over top of the plot area. You can then position hide/show the new graph and then use events to keep the two graphs sync-ed up with each other.


I typed exactly that answer (same context anyway). Then I found out there are no events... Mouse up works, but Key up doesn't. Polling seems to be the only way to keep them synchronised.

Message 6 of 7
(3,382 Views)

Here's a concept I'm working on at the moment, to get around the limitation.  I figure, since my user's aren't going to use cursors very often, showing them only on the graph they've activated cursors on, but not on others, is reasonable.

 

To use it, just right click on the graph and show the cursor legend.

Download All
0 Kudos
Message 7 of 7
(3,372 Views)