A polyline (or polygonal chain) is a continuous line composed of one or more line segments. You can create such a line by specifying the end points of each segment. In your case you have a connection between two shapes which means that you have a one start point and one end point and it is expected for the connection to be straight (you have a single line segment). If you want your line not to be straight you can define more end points in your Connection's ConnectionPoints
collection. Here is an example in code:
However, you can automatically route (without using the ConnectionPoints collection) the connections so that they won't cross each other. You can do this when you set the ConnectionType
of the connection to Polyline
and set the Diagram RouteConnections
property to True
Also you can take a look at the Types section in the Connections
help article where you can find more information about the connection types and how they are used.
DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.