鍍金池/ 問答/HTML/ 使用echarts力導向圖報TypeError Cannot read prop

使用echarts力導向圖報TypeError Cannot read property off of undefined

使用echarts力導向圖報TypeError Cannot read property off of undefined

在series里改配置(vue環(huán)境)

相關代碼

{

                    // name: 'Les Miserables',
                    type: 'graph',
                    layout: 'force',   //**將其修改為none時報錯**
                    data: this.graph.nodes,
                    links: this.graph.links,
                    categories: this.categories,
                    // draggable: true,
                    roam: true,
                    // symbolSize: 30,
                    edgeLength: [100,1000],
                    edgeSymbol: ['none', 'arrow'],       //線兩端的樣式
                    focusNodeAdjacency: true,
                    itemStyle: {                  //節(jié)點樣式
                        normal: {                  //表示正常展示時的樣式,無鼠標懸浮時
                            borderColor: '#fff',
                            borderWidth: 1,
                            shadowBlur: 10,
                            shadowColor: 'rgba(0, 0, 0, 0.3)',
                            fontSize: '8px'
                        }
                    },
                    ...

圖形沒出來,報了上述錯誤,還有給里面的一個節(jié)點定位時fixed: true,也會報上述錯誤,是不是和vue框架有關

回答
編輯回答
脾氣硬

你試試。
force: {

    edgeLength: [100,1000],

},

2017年7月21日 19:54
編輯回答
赱丅呿

布局為none時,要為節(jié)點設置初始坐標,但是還是會報錯,圖形可以正常顯示

2018年5月3日 11:45