09-16-2009 02:46 PM
Is there a way to change the plot visibility on an xy graph from the legend control similar to how you can click on the icon of the plot and change the color, line style, line width, etc.
There isn't a option in the drop down list for this but maybe it can be programatically added to the drop down menu?
Thanks
09-16-2009 03:29 PM
Why exactly do you want to add it to the drop down menu?
Here is how you programatically change the visibility of a plot:
(I don't know why the snippet changed the way this was linked, but you can statically link the properrty node also). You can use this with a series of checkboxes that indicate whether a plot is to be displayed or not.
Hope this helps.
Matt
09-16-2009 03:42 PM
I have used a series of checkboxes before to change the visibility through a property node but when you have alot of plots on the graph (30+), they can't all be displayed on the screen at the same time so LabVIEW puts a vertical scrollbar in the legend. It then gets hard to relate the checkboxes to the plots in the legend.
I would like to find a way to change the visibility through the legend shorcut menu because the legend shortcut menu works well for changing plot color, line style, line width, etc. when you have alot of plots in the legend and it is using the vertical scrollbar.
Thanks
09-16-2009 03:44 PM
09-16-2009 03:56 PM - edited 09-16-2009 03:57 PM
I want to be able to change the Plot.Visible? property from the shortcut menu that pops up when you left click on a graph legend. This can be done programatically as mtat76 demonstrated above, however I want to find a way to add it to the shortcut menu that comes up when you click on the legend. That way in addition to being able to change the color, line style, line width, etc. from the shortcut menu, you could also change the visibility of the plot.
The problem with just coloring it transparent is that you lose the last color that the plot was. So if a plot was red (or any other color) and you changed it to transparent to hide it, you would have to find that color again in the color palette. It is also not intuitive to the user to tell them to just color the plot transparent to hide the plot.
09-16-2009 04:11 PM
09-16-2009 05:53 PM
Hmmmm....Dennis is right (and by the way, it's Matt :manhappy:). However, there maybe a more involved solution to this - if you can define the location of the legend, maybe you could use a hotkey that, when pressed while hovering over the legend entry changes the visibility of the plot. But, like I said this is pretty involved.
30 plots, though? That makes my brain hurt. Is there some way to break the number of plots out or collapse the number of plots? From a human interaction standpoint, a graph containing 30 plots just doesn't seem very useful - it's just too many to visualize and make sense of. (And the reason I am guessing you are seeking this functionality).
Matt