使用echarts力导向图报TypeError Cannot read property off of undefined
在series里改配置(vue环境)
相关代码
{
// 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: { //节点样式
normal: { //表示正常展示时的样式,无鼠标悬浮时
borderColor: '#fff',
borderWidth: 1,
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.3)',
fontSize: '8px'
}
},
...
布局为none时,要为节点设置初始坐标,但是还是会报错,图形可以正常显示