We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Perform zoom out of diagram programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

150793 Jan 20,2020 11:24 AM UTC Jan 21,2020 06:05 AM UTC React - EJ 2 1
loading
Tags: Diagram
Dominique Toussaint
Asked On January 20, 2020 11:24 AM UTC

How to perform zoom out of diagram programmatically using some of the methods of properties of the diagram? I would appreciate some sample of the code.

Best regards,
Jiway 

Shyam G [Syncfusion]
Replied On January 21, 2020 06:05 AM UTC

Hi Jiway, 

Please use the diagram zoomTo method to perform zoomIn and zoomOut operations programmatically. We have created a sample in which we have performed zoomIn and zoomOut operations at button click. Please refer to a code example and the sample below. 

Code example: 
function ZoomIn() { 
    let zoomOptions = { 
      type: "ZoomIn", 
      //Sets the factor by which we can zoom in or zoom out 
      zoomFactor: 0.5 
   
    //zoomin the diagram 
    diagramInstance.zoomTo(zoomOptions) 

function ZoomOut() { 
    let zoomOptions = { 
      type: "ZoomOut", 
      //Sets the factor by which we can zoom in or zoom out 
      zoomFactor: 0.5 
   
    //zoomout the diagram 
    diagramInstance.zoomTo(zoomOptions) 

}  



Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon