Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.


Label alignment not working

0 votes

I just added a shape node to an empty swimlane. The node is as wide as the chart and I've inserted a label that I want left justfieid, but selecting left alignment doesn't affect the label placement, see below. What's the rigt procedure to achieve this?



in Help by (200 points)

1 Answer

+1 vote

"Alignment" is relative to the label box not the node size. The label box is the rectangle shown when a label is selected or its "Border" property is set to an opaque color. By default, the label box has the size of the label text and, therefore, text alignment has no visible effect unless there are multiple lines of text of varying length. You can adjust the size of the label box to the node width / height / size in the properties view (section Label, option Size).

However, it is also possible to place a label in relation to the element the label belongs to. Use the "Placement" property towards this end.
With placement "SmartFree: Anywhere" you can select the label and drag the selected label to the desired position with the mouse.
Additionally, placements "Internal: Left", "Internal: Top Left", and "Internal: Bottom Left" are available for node labels.

Selecting a label can be done by holding down CTRL and clicking on the label with the left mouse button or by using "Tools" -> "Select Elements".


Effects of label alignment and placement:

The second label uses "Fit Node Width" as its "Size" policy.

by [yWorks] (161k points)
edited by
Many thanks!
Legal Disclosure | Privacy Policy