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. Image for the cookie policy date

Center Diagram

Hello Team,

how to center diagram and overview after dataSource loaded.

I want to center the overview and the diagram every time the dataSource is updated, centering from the root node and some nodes below, any idea how to do it?


regards!


1 Reply

BM Balasubramanian Manikandan Syncfusion Team February 6, 2023 10:05 AM UTC

By using fitToPage method we can able to center the elements in the diagram as well as in the overview panel. Refer to the below mentioned code example and sample.


Code Snippet

created={(args) => {

          diagramInstance.fitToPage();

        }}


Sample

https://stackblitz.com/edit/react-aj5jht?file=index.js


Loader.
Live Chat Icon For mobile
Up arrow icon