LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fit graph or chart to pane after changing legend's visibility

Highlighted

Hello fellow LabVIEW folks,

 

I want to be able to use a property node to change a graph or chart's legend's scrollbar's visibility. And after that I would like to invoke the Fit Control to Pane method so the graph nicely adjusts its size.

 

But for some reason, the calling the method does not have any effect. And after having changed the scrollbar visibility through the property node, I can't even fit the control by right-clicking on it and select fit to pane from the contextual menu. I'd need to hide and show again the scrollbar from the right-click menu.

 

Running Windows 7 64bit, LabVIEW 32bit SP1

 

The following gif explains the problem:

 

Fit graph to frame after changing scroll bar visibility.gif.gif

 

Looks like a bug to me, but I'm maybe doing something wrong. What do you think?

 

 

 

LabVIEW 2013 SP1
Windows 7 64bit
Windows Server 2012 64 bit
Windows 8.1 32 bit
0 Kudos
Message 1 of 11
(1,329 Views)
Highlighted

Hello Baobob,

 

I replicated this on my computer and both the invoke and property node function correctly. The difference in my VI vs. your GIF demonstration is that I placed them in a while loop and ran the program. I was able to toggle the Bool constant to see the scroll bar on then off based on it being True or False.

David H.
National Instruments
0 Kudos
Message 2 of 11
(1,298 Views)
Highlighted

Hi David, thank you for your answer,

 

Here's what I get when I put the code in a while loop:

 

Scrollbar and fit in while loop.gif

 

I have no problem showing and hiding the scrollbar. My issue is that after I show the scrollbar, the legend's width increases (you can see that the lefthand part of the legend goes outside the limit of the pane). So I invoke the fit to pane method in order to resize the graph control. But invoking the method does not work for me.

 

Thanks.

LabVIEW 2013 SP1
Windows 7 64bit
Windows Server 2012 64 bit
Windows 8.1 32 bit
0 Kudos
Message 3 of 11
(1,294 Views)
Highlighted

What version of LabVIEW are you using?

David H.
National Instruments
0 Kudos
Message 4 of 11
(1,273 Views)
Highlighted

Sorry, I forgot to specify the year in my first post: 2013 (SP1).

 

You are not able to reproduce the behavior in the GIF?

LabVIEW 2013 SP1
Windows 7 64bit
Windows Server 2012 64 bit
Windows 8.1 32 bit
0 Kudos
Message 5 of 11
(1,270 Views)
Highlighted

I was able to replicate but this looks like expected behavior.

David H.
National Instruments
0 Kudos
Message 6 of 11
(1,251 Views)
Highlighted

@David-H wrote:

this looks like expected behavior.


Mh? Can you elaborate?

 

When a control is larger than the pane (which is the case when I show the legend's scrollbar), I expect that the fit control to pane method resizes the control so it fits the pane.

 

Besides:

  1. put a graph on a blank VI
  2. right-click the graph to fit it to the pane
  3. right click the legend to display the legend's scrollbar
  4. and right click on the graph to fit it to the pane again
  5. the graph does resize. Why can't I do this programmatically?

Thanks.

LabVIEW 2013 SP1
Windows 7 64bit
Windows Server 2012 64 bit
Windows 8.1 32 bit
0 Kudos
Message 7 of 11
(1,246 Views)
Highlighted

I see what you're saying. It doesn't seem to work pragmatically. Still looking into this.

David H.
National Instruments
0 Kudos
Message 8 of 11
(1,228 Views)
Highlighted

Hello David, how is the investigation going?

LabVIEW 2013 SP1
Windows 7 64bit
Windows Server 2012 64 bit
Windows 8.1 32 bit
0 Kudos
Message 9 of 11
(1,191 Views)
Highlighted

I'll be able to look at it either late this afternoon or tomorrow. I'm able to replicate on my computer and at first glance seems like a bug.

David H.
National Instruments
0 Kudos
Message 10 of 11
(1,188 Views)