This is a migrated thread and some comments may be shown as answers.

Margins for RadDiagramContainerShape

1 Answer 50 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Wipatel
Top achievements
Rank 1
Wipatel asked on 09 Sep 2014, 03:03 PM
Greetings!

Is it possible to add margins for container so the connections stops near or with some offset?
I've tried to:
 1) add margins to container template but then shapes that belong to container are being rendered without noticing that margin (attach 1)
 2) replace connectors for shape with increased offset from all sides but then connection looks pretty awful (attach 2)
I use OrgTreeRouter and every time something happens with container I call diagram layout with specific settings.
Is there any other way to get something like attach 3?

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 12 Sep 2014, 01:47 PM
Hi Wipatel,

As their are some dependencies between the shapes and the connection in the diagram there is not very straight forward approach to set a margin between them except the one with the Connectors of the shape. Basically you can modify the distance between a shape and its connection by changing the value of the Offset property of the shape's Connectors. 

this.shape1.Connectors["Top"].Offset = new Point(0.5, -0.1);
this.shape1.Connectors["Bottom"].Offset = new Point(0.5, 1.1);
this.shape1.Connectors["Left"].Offset = new Point(-0.1, 0.5);
this.shape1.Connectors["Right"].Offset = new Point(1.1, 0.5);

If this doesn't work for you, I think calling the diagram Layout() method is okay except in the case when you have a big number of shapes that should be rearranged.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Diagram
Asked by
Wipatel
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or