You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/28 03:21:46 UTC

[GitHub] [incubator-echarts] yuanzhou3118 commented on issue #12261: 在graph关系图中,文字无法缩放。鼠标移入节点的鼠标样式无法更改。

yuanzhou3118 commented on issue #12261:
URL: https://github.com/apache/incubator-echarts/issues/12261#issuecomment-650683375


   已通过graphRoam实现:
   
        // 鼠标滚轮监听放大缩小
        myECharts.on('graphRoam', function(e) {
           const option = that.echartsGraph.getOption(); // 获得当前option.series的zoom
           const textPercent = (option.series[0].zoom - 0.8) / 0.8; // 计算比例,我设置zoom的初始值是0.8
           option.series[0].label.fontSize = 9 + 9 * textPercent // 等比例计算fontSize
           that.echartsGraph.setOption(option); // setOption
         });
   同理可以加在toolbox内的自定义的“放大”和“缩小”按钮上
   
   希望可以帮助到其他同学 😝


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org