echarts 关系图graph force布局 拖动节点并固定不返回原点


myChart.on('mouseup',function(params){
var option=myChart.getOption();
option.series[0].nodes[params.dataIndex].x=params.event.offsetX;
option.series[0].nodes[params.dataIndex].y=params.event.offsetY;
option.series[0].nodes[params.dataIndex].fixed=true;
myChart.setOption(option);
});

我用的是echarts4,不是2,所以标红的地方是nodes不是data,对号入座啊

原文地址:https://www.cnblogs.com/zhaohuanhuan/p/10299621.html