Default Zoom

Hi, 


I have an organisation chart (SFDIagram) with 2 nodes but when it renders it is quite small (I can pinch & zoom to make it larger).


I've tried setting minimum zoom level but the diagram is still small - what can I do to make it fill the screen?

It's the only element on the content page (no grids, stacklayout etc.) 

Thank you!


1 Reply

GR Gayathri Ramalingam Syncfusion Team February 3, 2022 02:58 PM UTC

Hi Raymond, 
 
Thank you for using the Syncfusion product. 
 
Based on your update, we assume that you have to render the node with a larger size depending on the content page. By default, the Node will take 50 in size whereas the layout initialization is not set the size of the node. So, it seems smaller in size and will not occupy based on the content page. To overcome this, you can set the node size using the BeginNodeRender event of the SfDiagram, and please find the UG documentation for the same from below, 
 
Kindly use the below code example to get this issue resolved.   
private void Diagram_BeginNodeRender(object sender, BeginNodeRenderEventArgs args) 
{ 
      Node node = args.Item; 
      node.Width = 400; 
      node.Height = 400; 
      node.Annotations.Add(new Annotation() { Content = (node.Content as Employee).Name , FontSize=40}); 
}   
 
We have prepared a sample based on your requirement and it can be downloaded from the below link,

Link:
 https://www.syncfusion.com/downloads/support/directtrac/general/ze/OrganizationalChart-2106860834
 
 
Could you please try the above-suggested solution and let us know whether it meets your requirement or not?   
 
If our understanding is different from your requirement, could you please explain briefly about your requirement? It will be useful for us to investigate further this and assist you with a better solution at the earliest.     
 
Note: The ‘MinimumZoomFactor’ property works only when you zoom the Diagram control using pinch-zoom to that value. 
 
With Regards, 
Gayathri R 
 


Loader.
Up arrow icon