mxGraph: How to position edge labels a the bottom

2.9k views Asked by At

I'm using the mxGraph library to render some diagrams, can someone help me to position the edge labels at the bottom instead of the middle?

Thanks in advance!

1

There are 1 answers

3
Vsevolod Golovanov On

In a stylesheet for relevant edges do

<add as="verticalAlign" value="top" />
<add as="verticalLabelPosition" value="bottom" />

Or do it inline when inserting an edge

graph.insertEdge(..., 'defaultEdge;verticalAlign=top;verticalLabelPosition=bottom');

"defaultEdge" is there to keep the rest of default styles, not override them completely.

This positions label bounds on the bottom of an edge, and positions labels at the top of their bounds.