LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Move graph palette programmatically

Solved!
Go to solution

Hello everyone,
I have an issue with graph resize.
When I resize a graph I want my palette graph to be aligned with the graph bordure, as shown below.
But when I reduce my window too much, this palette just go to the left and don't ever come back to the right, even when I make the windows bigger.
So I want to manipulate this palette but I just can't find a property nor method node to manage it.

TenJigoku77_0-1662371333060.png

There is only 1 solution for me but it takes time --> Replacing the palette with a new control wich does the exact same things that the palette and then resize it.

Did you ever encounter this problem ? Do you have an idea to explore ?

Thanks and see you !

0 Kudos
Message 1 of 16
(1,571 Views)

@TenJigoku77 wrote:

There is only 1 solution for me but it takes time --> Replacing the palette with a new control wich does the exact same things that the palette and then resize it.


Sadly, that is the only solution I've found.

 

There are ways to get a reference to the graph palette, but I wouldn't use them in production code.

 

Automatic scaling in general is primitive and flawed.

 

Scaling of graphs (manual or automatic) is primitive and flawed.

 

Scaling of graphs is a challenge.

Message 2 of 16
(1,562 Views)

This is quite an old thread, but I still do it the same as described there. For me it is a good workaround.

 

https://forums.ni.com/t5/LabVIEW/How-to-fix-control-s-position-in-front-panel-pane/m-p/1010975

 

Read all first three posts...

Greets, Dave
0 Kudos
Message 3 of 16
(1,536 Views)
Solution
Accepted by topic author TenJigoku77

Another note: Set the min-size of the pane to a value where the graph palette always does as expected

Greets, Dave
0 Kudos
Message 4 of 16
(1,532 Views)

@daveTW wrote:

This is quite an old thread, but I still do it the same as described there. For me it is a good workaround.

 

https://forums.ni.com/t5/LabVIEW/How-to-fix-control-s-position-in-front-panel-pane/m-p/1010975

 

Read all first three posts...


Doesn't the Plots control block the scale?

 

Anyway, most often the graph controls don't what I want, so I end up re-making all functionality anyway (plots, graph, cursor...). And since the scaling doesn't do what I want, I re-make that also 😁.

0 Kudos
Message 5 of 16
(1,526 Views)

wiebe@CARYA wrote:

@TenJigoku77 wrote:

There is only 1 solution for me but it takes time --> Replacing the palette with a new control wich does the exact same things that the palette and then resize it.


Sadly, that is the only solution I've found.

 

There are ways to get a reference to the graph palette, but I wouldn't use them in production code.

 


Really?  What are those ways?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 16
(1,475 Views)

I have found that autosizing a graph (including the palette location) works if, and only if, it's the only control in that panel. Try using splitter bars to create a place for the palette, then size the palette to fill that panel, and set that panel to Scale Objects While Resizing. Generally this hasn't been a problem for me. This also works when you make the graph really small and then larger.

 

The problem is, of course, that you can't have other buttons or items in this frame. I attached a demo, give it a go. It's not a full solution to your problem but it might help.

0 Kudos
Message 7 of 16
(1,468 Views)

@BertMcMahan wrote:

I have found that autosizing a graph (including the palette location) works if, and only if, it's the only control in that panel. Try using splitter bars to create a place for the palette, then size the palette to fill that panel, and set that panel to Scale Objects While Resizing. Generally this hasn't been a problem for me. This also works when you make the graph really small and then larger.

 

The problem is, of course, that you can't have other buttons or items in this frame. I attached a demo, give it a go. It's not a full solution to your problem but it might help.


This solution kind of works for special cases. (Like when palette is at the edge of a plot.) Using your VI in LabVIEW 2020, I did the following:

  1. Move Palette to center
  2. Make Plot Small
  3. Make Plot Large

Palette is no longer at center. This is my biggest pet peeve about LabVIEW, besides the move to SAAS. A graphical programming language should have better UI tools.

Start with palette in centerStart with palette in centerMake plot small.Make plot small.Make plot larger. Palette no longer in center. :(Make plot larger. Palette no longer in center. 😞

0 Kudos
Message 8 of 16
(1,462 Views)

@mcduff wrote:

This is my biggest pet peeve about LabVIEW, besides the move to SAAS. A graphical programming language should have better UI tools.

 


Couldn't agree more. Yes it is unfortunate that my method only works with edge cases (😉) but it's literally the only way I've found to have resizeable graphs. Regarding the "centering" option, it's hard to say if you want it to stick with its relative location (i.e., centered) or its absolute location (i.e., 45 pixels inset from the left side) so I can sort of see why it doesn't work that way.

 

Ideally we'd get some more full featured tools to better handle the UI, but at the very least it would be nice to be able to manipulate the various plot tools from the plot itself. (like in my Idea Exchange post).

0 Kudos
Message 9 of 16
(1,448 Views)

@BertMcMahan wrote:

@mcduff wrote:

This is my biggest pet peeve about LabVIEW, besides the move to SAAS. A graphical programming language should have better UI tools.

 


Couldn't agree more. Yes it is unfortunate that my method only works with edge cases (😉) but it's literally the only way I've found to have resizeable graphs. Regarding the "centering" option, it's hard to say if you want it to stick with its relative location (i.e., centered) or its absolute location (i.e., 45 pixels inset from the left side) so I can sort of see why it doesn't work that way.

 

Ideally we'd get some more full featured tools to better handle the UI, but at the very least it would be nice to be able to manipulate the various plot tools from the plot itself. (like in my Idea Exchange post).


I use the same method myself, and given a kudo to your idea in the past. (When I clicked a kudo disappeared then when a re-clicked it came back.) 

Message 10 of 16
(1,443 Views)