jiayuu commented on issue #9511: 关于force图表相关问题
URL: 
https://github.com/apache/incubator-echarts/issues/9511#issuecomment-444339792
 
 
   - 目前拖拽是这样解决的 但是节点少的时候有点问题。
   ```c
   myChart.on('mouseup', function (params) {  
         if (params.dataType === 'node') {
           let option = myChart.getOption();
           if (option.series[0].data.length > 1) {
             option.series[0].data[params.dataIndex].x = params.event.offsetX;
             option.series[0].data[params.dataIndex].y = params.event.offsetY;
             option.series[0].data[params.dataIndex].fixed = true;
             myChart.setOption(option);
           }
         }
       });
   ```
   >  
我还有一个扩展的需求,就是在某点扩展出来跟他有关系的,目前的实现方案是setOption追加data,感觉这个不是最佳方案,因为setOption会重新绘图,节点的位置又都变了,我已经不知道在什么地方扩展的了。希望作者或者各位大佬帮忙解决下我的问题

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to