34
Views
4
Comments
Solved
Zoomen
Question

Hello

I am trying to enlarge and reduce a window by button 

after a long search I have not found the best way to do this 

2022-05-02 13-50-49
Paulo Ritto
Solution

Hi @Alexander Eder 


If your graph is wrapped inside a container, you can zoom in/out of that container by applying javascript. You would have a ZoomIn() and ZoomOut() functions triggered on the onclick of each of your buttons, and inside you would place a javascript node with the following:


ZoomIn():

var el = document.getElementById(container.Id);

var width = el.clientWidth;

el.style.width = width + 100 + "px";


ZoomOut():

var el = document.getElementById(container.Id);

var width = el.clientWidth;

el.style.width = width - 100 + "px";


where container.Id is the Id of your container you want to zoom.


Let me know if this helps!

Kind regards,

Paulo

UserImage.jpg
Alexander Eder

Unfortunately it didn't work when I click the button the message "Maximum size of the call stack exceeded" appears. 

2020-09-21 08-42-47
Vincent Koning

This error is likey caused by recurrency. Are you sure you call the javascript actions "zoomin" and "zoomout" and not the OutSystems client actions with probably the same name?

UserImage.jpg
Alexander Eder

tat's what it was 

thanks for the help  

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.