Restrict number of segments in Orthogonal Link

How to restrict the number of segments,I require only two segment but by default it is coming 5.I require that label is in middle and i have segment handler so that i can move ink.

In the general case 6 points or 5 segments are required for any orthogonal link route. (I’m assuming it is not AvoidsNodes routing, which obviously could require an unlimited number of segments.)

Could you show screenshots and describe your situation, both what you have and what you want?

I am using (AvoidsNodes) routing and require only 3 segments.
Code:-segmentIndex:3,segmentFraction: 0.5

There is 5 segments but i require only 3

First, I assume you have no Diagram.layout.

Second, I do not see why that link is taking the route that it does. Are you sure there aren’t any transparent nodes right there?

It might be helpful to see a screenshot that encompasses both of the connected nodes.

Grid Layout using and please tell.These segments should be come only three.

If the link is connecting ProductName with QUARTER2 and it is orthogonal, then five segments (6 points) are required.

If you do not set Link.routing, it will have three segments (4 points).