Container Scaling

Ok, I have a container that contains a slider and bar chart. I’ve grouped the container, and if I change the size of it in the designer, the bar chart and slider change size accordingly.

But, if I change the size of the container at runtime through script, the bar chart and slider do not change proportionally with the container. Is this what you would expect?

What I’m trying to do is allow the user to use the slider to select the number of days of data to report, and as the days increase, the bar chart stretches.

  1. How are you resizing it?
  2. Does it act differently if it isn’t grouped?

I take the slider value and multiply it by a constant for now. I use the resize component function, and set the container size.

The only difference between grouped and ungrouped is the size of the bar chart. It works fine if I grab the handles and resize the container in the designer, and was hoping to duplicate this at runtime.

I’ve attached the window.

edit: Forgot to mention that the script for resizing the container is on the slider.
ScalingContainer.vwin (9.11 KB)

It looks like we’ve got a bug in the layout system. Currently a container, when re-sized in run-time, doesn’t redo it’s own internal layout. This means that any children components will not be able to re-size themselves properly.

The workaround for now would be to handle the re-sizing of any applicable child components yourself using the same type of script you used for the container re-sizing.

will this be fixed in an up coming release?

Yes, but it won’t make 7.5.2. Probably 7.5.3

Any updates about the bugfix? …I noticed that it didn’t make it to the current release (version 7.5.3)

I am also trying to rotate the container component. Is this possible?

Tried the folowing with Script:

  1. Container.angleDegrees (it worked for the group component)

Instead of the container component I tried the template component. The resizing works as aspected with that object. Make sure not to forget to check the “Enable Layout” propertie of the template object. Otherwise it will stretch the child components of the template rather then listening to the Layout constraints.

…I Forgot to mention that I couldn’t find a solution to make the Template Instance to Rotate.

So any help would still be welcome.

The runtime script-enabled container scaling issue is still outstanding, sorry about the delay.

Rotating a normal container or a template is simply not supported, that’s why you can’t find a way to do it.

Will it be possible in a later release?

The container scaling issue will be resolved, in an upcoming release, probably 7.7.0.

There are no plans to have containers or templates be rotate-able, however.

This has been fixed in Ignition 7.6.5.

You will find this in 7.6.6 since 7.6.5 was taken down