LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

capture mouse event(s) on XYgraph plot legend

I notice that when I move the mouse over the plot name portion of the plot legend, the mouse icon changes.  If I left-click in this portion, the entire plot name region is highlighted. What event(s) and/or properties do I use to capture this behavior.  I would like to know the size and/or location of the plot name region highlighted.  I'm using LV 2010.  I know about the Legend.Size and Legend.Position properties. 

0 Kudos
Message 1 of 8
(3,476 Views)

Faustina:

 

I'm not sure what you mean by "the entire plot name region is highlighted." Perhaps you could send a screen shot?

In LV 2010 on my machine, the legend item does not change, it just launches the menu of plot properties. I'm probably missing something, so if you could describe the behavior you're looking for, it'd help me out Robot wink

 

The properties on that menu are all accessible via a property node for the graph/chart. They are not under the "Legend" properties, as they are properties for the plots themselves.

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 2 of 8
(3,450 Views)

see enclosed file

0 Kudos
Message 3 of 8
(3,429 Views)

I don't think the file attached to that last message. Is there a chance you could re-send it?

 

Thanks!

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 4 of 8
(3,407 Views)

we'll try it again

0 Kudos
Message 5 of 8
(3,373 Views)

Faustina:

 

Thanks, got it this time. The highlighting happens when the text field (plot name) becomes editable. The equivalent property node is the "name" entry from the plot menu.

plot properties menu.png

 

You'll want to set the active plot, then set properties from the "Plot" menu, as in the following example.

Plot name change BD.png

 

When run, this code yields the following on the front panel. We've set two individual plot names using property nodes.

Plot name change FP.png

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 6 of 8
(3,352 Views)

the issue is this ... when the user clicks in the plot name region, I want to set that plot to the active plot and I want to change the name to a value I get from another control.  so what is the event that is generated when the user clicks on on the plot name of the plot legend.

0 Kudos
Message 7 of 8
(3,339 Views)

Faustina:

 

Unfortunately, there isn't an event we can latch onto when the plot within the legend is clicked on. As a workaround, we can add a radio button control beside the legend to select various plots. The radio button indices match up to the plot indices, so we can still select the active plot and rename it.

 

I've attached a small example that allows the user to select a plot, and rename it from a menu of presets. You'll probably want to adapt it to run in a state machine or event structure, but the logic for changing plot names is there.

 

change plot names fp.png

change plot names.png

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 8 of 8
(3,281 Views)