Applying TreeLayout algorithm to rearrange the diagram
- Initialize a new instance of the TreeLayout class.
C#
Copy Code
|
---|
TreeLayout tl = new TreeLayout(); |
- Set Type, Direction and LinkStyle of the TreeLayout.
C#
Copy Code
|
---|
tl.Type = TreeLayoutType.Centered; tl.Direction = TreeLayoutDirection.TopToBottom; tl.LinkStyle = TreeLayoutLinkType.Cascading3; |
- Specify NodeDistance, and LevelDistance.
C#
Copy Code
|
---|
tl.NodeDistance = 8; tl.LevelDistance = 8; |
- Call the Arrange method to perform the TreeLayout algorithm.
C#
Copy Code
|
---|
tl.Arrange(DiagramView1.Diagram); |
- Execute the web application (press CTRL+F5).
After applying the TreeLayout algorithm, the diagram looks as shown below: