How to place two edge labels on opposite sides of an edge
Applies to: yEd 2.4, yEd 2.3, yEd 2.2, yFiles 2.4, yFiles 2.3, yFiles 2.2, yFiles 2.1 print article email article

Type: Questions & Answers

Shows how to keep labels on opposite sides of an edge.

To keep labels on opposite sides of an edge you need to assign different "positions" to them. For example, the following position assignment will place EdgeLabel l1 above or left to the edge and EdgeLabel l2 below or right to the edge.
l1.setModel(EdgeLabel.SIX_POS);
l1.setPosition(EdgeLabel.HEAD);

l2.setModel(EdgeLabel.SIX_POS);
l2.setPosition(EdgeLabel.TAIL);
On the other hand, the preferredPlacement attribute of a label serves as a hint for automatic labeling algorithms, only.

Keywords: edge label placment - labeling - label position - label model - preferredPlacement

Provide feedback:
How useful was this article?    less 1 2 3 4 5 more
Email address (optional):
COPYRIGHT © 2008 yWorks · ALL RIGHTS RESERVED imprint | top | home