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
close icon

Enable Zooming in a Sync Fusion Diagram

Hi,

 

How is it possible to enable zooming in a Diagram control?  I have it working within a page as follows:

 

<syncfusion:SfDiagram HorizontalAlignment="Left" VerticalAlignment="Top"                               Tool="SingleSelect"

                            ScrollViewer.ZoomMode="Enabled"

                            ManipulationMode="None" 

                            x:Name="radialDiagram"

                           AllowDrop="True"

                            Height="500"/>

 

And when I drag nodes in the diagram beyond the visible screen I get automatic scrollbars (which is fine), but I also want to enable some kind of zoom/pinch to zoom behavior and setting the ScrollViewer.ZoomMode propery isn't working.. is there anything else I need to do?

 

Many thanks in advance


4 Replies

MF Marc Francois NO LONGER WITH COMPANY December 5, 2013 10:41 AM UTC

**EDIT** 

 

I forgot to add, that if I wrap the actual sync fusion diagram in a scrollviewer control itself, then zooming works by default but then the whole ScrollViewer + Diagram shrinks/grows (i.e. you can see the horizontal and vertical scroll bars at the edges of the diagram change size accordingly, which isn't what I want)


RT Ramya Thirugnanam Syncfusion Team December 5, 2013 11:05 AM UTC

Hi Marc,

Regarding to “Enable Zooming in a Sync Fusion Diagram”, Zooming/Panning operation over SfDiagram is working fine with your provided code snippet. We have created a simple sample to represent this. Please refer to the sample from the attachment.

By default, Zooming/Panning is enabled for SfDiagram using Constraints Property. The constraints can be manipulated using bitwise operations.

Code Snippet:

The following code snippet illustrates how to enable Zooming in SfDiagram and how to use Bitwise operations.

[C#]

sfdiagram.Constraints = sfdiagram.Constraints | GraphConstraints.Zoomable;


Note:

Tool property of SfDiagram is used to operate any one of the multiple functionalities at any particular time(Pan/MultipleSelection/DrawingTool).

 

For more details about SfDiagram Tools , GraphConstraints and bitwise operations, please refer to the following online help documentation link.

 

Tools Link: http://help.syncfusion.com/UG/winrt/Documents/tool.htm

 

Graph Constraints Link: http://help.syncfusion.com/UG/winrt/Documents/graphconstraints.htm

 

Bitwise Operation Link: http://help.syncfusion.com/UG/winrt/Documents/bitwiseoperations.htm

Please let us know if you have any concerns,
Regards,
Ramya



114715_196d1442.zip


MF Marc Francois NO LONGER WITH COMPANY December 9, 2013 02:59 PM UTC

Thanks for that.. got it working finally!  Didn't see your reply until just now as my post seemed to have been deleted last week for some reason :)


SN Sathya N Syncfusion Team December 11, 2013 08:50 AM UTC

Hi Marc,
We regret for the inconvenience caused. Due to some internal server problem the forum has been deleted. We have restored the post again.
Please let us know if you need any further assistance.
Regards,
Sathya. N

Loader.
Live Chat Icon For mobile
Up arrow icon