Articles in this section

How to Set the Current Zoom Value to a Specific Value in Vue Diagram?

This article explains how to set the current zoom value to a specific value in Vue Diagram.

You can set the current zoom value to a specific value by calculating the required zoom factor. The zoom factor determines how much the diagram should be zoomed in or out. It can be calculated by dividing the specific value by the current zoom value of the diagram. You can use the zoomTo() method to apply the zoom. This method adjusts the zoom level of the diagram based on the calculated zoom factor, effectively zooming the diagram to the desired value.

The below code snippet demonstrating how to set the current zoom value to a specific value:

   zoom: function() {
     const diagramInstance = this.$refs.diagram.ej2Instances;
     let zoomOption = {};
     //You can set any specific value as the target
     let target =0.3143011474609375 ;
     zoomOption.zoomFactor =
     target /  diagramInstance.scrollSettings.currentZoom - 1;
       diagramInstance.zoomTo(zoomOption);
       diagramInstance.dataBind();
   },

Refer to the working sample for additional details and implementation: Sample

Conclusion

We hope you enjoyed learning about how to set the current zoom value to a specific value in Vue Diagram.

You can refer to our Vue Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Vue Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied