I have a chart in vision that I am trying to make larger by using a button click. When the button is clicked I want to change the charts size and position. It does work, but when the button is clicked again, I want the chart to return to its original size and position. This is where the problem lies. I cannot get the chart to return to is original position every time. The original position of the chart is on the right side but if vision is full screen then instead of the chart returning to the right side, it is in the middle. I have placed the script that I am using in the button click below. Please let me know what I can do to get the chart to return to its original position.
window = system.gui.getParentWindow(event)
chart = window.getRootContainer().getComponent('chart')
buttonText = event.source.text
if buttonText == 'Increase Chart Size':
#large
x = 8
y = 8
width = 1106
height = 568
event.source.text = 'Decrease Chart Size'
else:
#small
x = 548
y = 105
width = 566
height = 471
event.source.text = 'Increase Chart Size'
system.gui.transform(component=chart, newWidth=width, newHeight=height, newX = x, newY = y)