From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I fill the whole two pane panel with one graph?

Solved!
Go to solution

I'm trying to build in the ability to show either one or both of these graphs.  They're set to fit to their respective pane.  I can't move the splitter to the right far enough to not show the right graph.  I've tried programmatically moving the graph out of the pane view, making it not visible, resetting the minimum pane size, but to no avail.  This is just a small example; I'm actually trying to do this with four and eight graphs, but the same vertical splitter principle applies.  Is there any way of filling the whole panel with just one of these graphs?  Any ideas?

 

Fill Panel.png

Robert Mortensen
CLA, CLED, LabVIEW Champion, Principal Systems Engineer, Testeract
0 Kudos
Message 1 of 8
(2,876 Views)

I can't open your Vi to take a look, so I don't really understand.  Do you really need the splitter?  Would tabs work?  Could you put all the data into 1 graph instead of using 2 graphs?

0 Kudos
Message 2 of 8
(2,868 Views)

Thanks for replying.

 

The VI was in 2011, I've saved it back to 8.0 and reattached.

 

The panel can be resized by the user and I need the resizing that the splitters provide.  My customer wants to see the data on different graphs for scaling purposes, all at the same time.

Robert Mortensen
CLA, CLED, LabVIEW Champion, Principal Systems Engineer, Testeract
0 Kudos
Message 3 of 8
(2,865 Views)

You can do something like in the attached vi. Note that you cannot make a graph completely disappear since the minimum panel width for a graph is 97px. I set it to 100 in the attached vi. You can use a custom menu instead of boolean controls.

 

Ben64

0 Kudos
Message 4 of 8
(2,851 Views)

The minimum panel width for the graph is exactly the problem I'm trying to overcome.  It seems silly to me that the pane cannot be resized smaller than this even if the graph is not visible (hidden) or off the screen.  Does anyone know a way around this?

Robert Mortensen
CLA, CLED, LabVIEW Champion, Principal Systems Engineer, Testeract
0 Kudos
Message 5 of 8
(2,848 Views)
Solution
Accepted by topic author FlamingYawn

Robert,

 

By the looks of things we're checking to see that panes don't get smaller than the minimal useful size of the controls that are set to scale with pane.  

 

We should look into whether this is a bug or not (it wouldn't surprise me if we designed it this way) but in the meantime there is a workaround that may work for you.  Disable the "Scale Object with Pane" option and programmatically resize the graphs yourself whenever the pane size changes.  I've attached a functioning demo (LV 2011 format, snippet here for those with older versions).

 

It's obviously a workaround and not quite as clean as your intended solution but it should work unless there was some other reason why you needed the automatic scale with pane.

 

 

Two Graphs One Splitter (shogg).png

[The event structure is capturing the Pane Resize event for both panes]

 

Hope this helps,

 

Simon

Message 6 of 8
(2,835 Views)

I can't try Simon solution because I have LV2009 but another possible workaround (that may not be very practical) would be to use a sub panel and to load different subVI for 1 or 2 graphs display. Attached is a draft. (It use relative path so you can run it from the extracted folder).

 

Ben64

 

note: I was a bit lazy doing this so dataflow is not always respected, also there should be a minimum size set for the main window.

0 Kudos
Message 7 of 8
(2,828 Views)

Setting the PlotAreaSize to 0,0 was key for me.  That let me completely minimize the right pane.  I still leave the scaling on when I'm showing the right pane, so I don't have to monitor pane resizes.  Thanks, Simon.

Robert Mortensen
CLA, CLED, LabVIEW Champion, Principal Systems Engineer, Testeract
0 Kudos
Message 8 of 8
(2,815 Views)