LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

aligning and resizing plots in multiple panes

Hello,

 

I have a Spectrum & Waterfall display application that has a requirement to be able to be resized. My challenge thus far has been keeping the spectrum graph and waterfall intensity graph frequency (x-axis) aligned correctly when resizing the overall GUI. I also need both plots to resize when the horizontal splitter bar between the two is moved. I've ultimately come to the conclusion that I can't let LabVIEW do the resizing on its own and I've tried to do it programmatically. I've had limited success with the Plot Area Bounds and Plot Area Size functions but I can't seem to keep the plots aligned without affecting the control dimensions in way that makes it look horrible and un-aligned after several resizes. I've set minimum pane sizes on both the top and bottom panes as well as a minimum front panel width to prevent plot distortions from shrinking too far but that hasn't fixed the main resizing issue. Does anyone have any suggestions on how to keep the plots aligned while resizing using any method? (i.e. splitter bar in middle, vertical FP resize, horizontal FP size, maximize, and minimize.). Attached is an image of my plots for reference as well as the empty GUI shell where I've been trying to play with the resizing (LV2009 soon to upgrade to 2010).

 

Regards,

 

Tim

Tim Sileo | RF Apps Engineer | NI/Emerson | ADG Business Unit
Download All
0 Kudos
Message 1 of 5
(3,493 Views)

Tim-

 

I'm using LV 2010 and I'm not seeing the graphs being misalligned after a number of resizes.  If you could include a screen shot of what you are seeing and describe on the picture the issue and what you would want to see I may be able to help you out further.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,451 Views)

Hi Scott,

 

I've attached some example code that can replicate the issue. Once the project is opened the MAST_gui_layout_1.vi is the one that I'm using to test the resizing of the spectrum and waterall displays. I fixed some of the alignment issues by making sure that both of the control's "Position->Left" properties were at zero and then setting their "Plot Bounds->Left" properties the same. The VI is set up to "Scale all Objects with Pane" currently and if you maximize the GUI then the two plots become different widths and are slightly misaligned on the left and very misaligned on the right. I'm assuming that this is because using the "Scale all Objects with Pane" option scales the controls and not the plots within them. I could solve the issue if I were able to set both controls to the same width and then do the same for their plot bounds and size. However, as far as I know there is no way to write the control width, only the plot width.

 

Regards,

 

Tim

Tim Sileo | RF Apps Engineer | NI/Emerson | ADG Business Unit
0 Kudos
Message 3 of 5
(3,441 Views)

Hi Scott,

 

I've attached some example code that can replicate the issue. Once the project is opened the MAST_gui_layout_1.vi is the one that I'm using to test the resizing of the spectrum and waterall displays. I fixed some of the alignment issues by making sure that both of the control's "Position->Left" properties were at zero and then setting their "Plot Bounds->Left" properties the same. The VI is set up to "Scale all Objects with Pane" currently and if you maximize the GUI then the two plots become different widths and are slightly misaligned on the left and very misaligned on the right. I'm assuming that this is because using the "Scale all Objects with Pane" option scales the controls and not the plots within them. I could solve the issue if I were able to set both controls to the same width and then do the same for their plot bounds and size. However, as far as I know there is no way to write the control width, only the plot width.

 

Regards,

 

Tim

Tim Sileo | RF Apps Engineer | NI/Emerson | ADG Business Unit
0 Kudos
Message 4 of 5
(3,440 Views)

I've actually come up with a workaround of sorts. By right clicking on each of the graphs and selecting "Fit Control to Pane" I was able to get both controls the same dimensions as their respective panes. Then I manually resized both plot widths and positions until I  had them as aligned as I could. Unfortunately since plot width affects control width (but not vice versa) I had to repeat the "Fit Control to Pane", reposition plots, resize plots process several times to ensure perfect alignment and keep the controls the exact size of their panes. Now, since both plot area widths have the same ratio to their respective control widths I am able to let LabVIEW do the "Scale Object with Pane" for both and it keeps them aligned and the same widths. I've turned off all programmatic resizing in my code now.

 

I guess it just took a little better understanding of how graph controls and their plots get resized with a GUI as well as some trickery to make it work. I've attached the GUI layout for reference in case anyone else wants to look at it for reference. The good working GUI is "MAST_gui_layout_2.vi". The first gui still shows the issue that arises when the two graph controls don't have the same width and how their widths don't scale appropriately when "Scale Object with Pane" is selected.

 

 

Tim Sileo | RF Apps Engineer | NI/Emerson | ADG Business Unit
0 Kudos
Message 5 of 5
(3,417 Views)