2017-01-03 79 views
0

我正在編輯here的digrameditor!對於我自己的項目,我需要將頂點的標籤放置在底部。我試圖通過添加後續更改,但似乎並非如此。mxGraph diagrameditor更換標籤位置

.... 
// Program starts here. The document.onLoad executes the 
// mxApplication constructor with a given configuration. 
// In the config file, the mxEditor.onInit method is 
// overridden to invoke this global function as the 
// last step in the editor constructor. 
function onInit(editor) 
{ 
    // Set align of the labels to bottom 
    mxConstants.STYLE_VERTICAL_LABEL_POSITION = mxConstants.ALIGN_BOTTOM; 
.... 

任何幫助?

謝謝。

回答

0

經過一些更多的研究,我發現它可以使用diagrameditor.xml文件位於config目錄中。您可以在123行中找到定義爲樣式單的mxStylesheet,並在其中可以找到默認的Vertex樣式。將verticalAlign屬性更改爲底部,如下所示。

... 
<add as="align" value="left"/> 
<add as="verticalAlign" value="bottom"/> 
<add as="shadow" value="0"/> 
....