01-27-2023 10:52 AM
Attached
01-27-2023 12:34 PM
Bummer that its position is included in the Bounds. I'd hoped it wouldn't be but alas 🙂
While I'm here, shameless plug for my Idea Exchange entry about this very thing...
(one of these days I'm going to break down and make a QControl to do this)
01-27-2023 01:35 PM
I have often lamented at the poor quality of the plot options in LabVIEW. Specifically for your idea exchange, I have gone so far as to build a subpanel specifically to handle plot legend in a useful and meaningful way.
But it isn't just that. LabVIEW graphs need a LOT of little tweaks and performance boosts. Just off the top of my head:
I know there's a bunch more frustrations I've had with the plots and graphs in LabVIEW, I just don't remember them all.
01-27-2023 02:51 PM - edited 01-27-2023 02:52 PM
I'll throw cursors out there as needing some work too. It's such an immensely useful concept, but I can never remember how to use them and have to play around with them for a while before I can get them to work the way I want them to.
@Bowen, how'd you manage to get the legend in a subpanel? Did you just duplicate the plot and hide the second one, just showing the legend of the second one somehow? I can imagine that working but, as we've seen with this thread, getting the sizing of the legend just right would be a pain 🙂
01-27-2023 03:12 PM
Thank you very much. Your VI does the job.
Girish
01-27-2023 03:33 PM
I tried to make a subVI out of it because I have other graphs in the main VI where I have to do the same thing. I made the XY Graph as an input to the subVI. Then I created a local variable from an XY graph in the main VI, and changed it to read. However I could not wire it to the subVI input. Hope there is a way to pass a graph to a subVI.
Thank you.
Girish
01-27-2023 03:59 PM
You don't want to pass the graph's value to the subVI, you want to pass a reference to the graph itself.
Right click on the graph and select "Create Reference". Do the same in your subVI, and right click that and select "Create Control" and wire that to the connector pane.
You will also need to disconnect the property nodes from a specific control. Right click each node and select "Disconnect from control", and you'll get a new input to the property node- a control reference. In your subVI, wire the Control Reference control that you just made to each of the property node inputs. Last, connect the reference you made to the actual main plot to the subVI instead of connecting the wire of the plot. Then your subVI will work as expected.
Conceptually, the wire on the diagram is (basically) just the value of the control. In this case, it's just the plot data- no metadata about the plot itself, like the size, colors, etc. The reference to the control is a reference to the control itself, which has all of that metadata. Your subVI needs to not operate on the data itself, but on the control, so you'll need the reference to that control.
01-28-2023 02:44 PM
I followed your steps but the I connect to the subvi in the main vi. I have connected the XY Graph reference control in the front panel to the subvi input. The front panel and block diagram of the subvi look like so
In my main VI when I try to connect I get an error. Here is how it looks
The error says Wire: Class conflict.
What am I doing wrong?
Thank you.
Girish
01-30-2023 10:47 AM
@BertMcMahan wrote:
@Bowen, how'd you manage to get the legend in a subpanel? Did you just duplicate the plot and hide the second one, just showing the legend of the second one somehow? I can imagine that working but, as we've seen with this thread, getting the sizing of the legend just right would be a pain 🙂
Lots of nonsense is how I did it. But yes, you're basically right.
End result looked like this
I'd share the code, but it isn't code that I own.
01-30-2023 12:41 PM
Sorry this is too complex for me. I will just copy paste the block diagram that works for all the graphs I have. Can you ask the owner to share the subvi?
Girish