且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mxGraph:如何将边标签定位在底部

更新时间:2022-10-21 09:53:15

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.