2017-01-09 31 views
1

我使用Flowchart來自http://gojs.net/latest/samples/flowchart.html,它工作正常。唯一的問題是,它不是t display the toolbar symbols which are shown in the example. Have someone used流程圖,也有同樣的問題?Javascript - GoJS流程圖

var $ = go.GraphObject.make; 

myPalette = 
        $(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element 
         { 
          "animationManager.duration": 800, // slightly longer than default (600ms) animation 
          nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram 
          model: new go.GraphLinksModel([ // specify the contents of the Palette 
           {category: "Start", text: "Start"}, 
           {text: "Step"}, 
           {text: "???", figure: "Diamond"}, 
           {category: "End", text: "End"}, 
           {category: "Comment", text: "Comment"} 
          ]) 
         }); 

問題

enter image description here

+0

你看到在你的開發者控制檯的任何錯誤? –

回答

3

我認爲你是初始化調色板中,初始化了圖及其Diagram.nodeTemplateMap之前。這實際上意味着Palette沒有使用自定義模板,因此Palette中的節點正在使用默認的節點模板。

如果你的流程圖樣品中看看源代碼,你會看到這一點:

// initialize the Palette that is on the left side of the page 
myPalette = 
    $(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element 
    { 
     "animationManager.duration": 800, // slightly longer than default (600ms) animation 
     nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram 
+0

非常感謝你,它工作得很好! – Bebop