You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/05/29 04:52:13 UTC

[GitHub] [incubator-echarts] zaiMoe opened a new issue #10033: symbolSize如何自定义hover时的大小

zaiMoe opened a new issue #10033: symbolSize如何自定义hover时的大小
URL: https://github.com/apache/incubator-echarts/issues/10033
 
 
   ### Version
   3.7.2
   
   ### Reproduction link
   [https://www.echartsjs.com/examples/editor.html?c=scatter-punchCard](https://www.echartsjs.com/examples/editor.html?c=scatter-punchCard)
   
   ### Steps to reproduce
   复制并替换成下面的代码,然后悬停在某个symbol上:
   ```
   var hours = [];
   
   var date = new Date();
   var time = date.getTime();
   
   for (var n = 0; n < 100; n++ ) {
       // hours.push(time   1000 * 60 * 60 * n);
       hours.push(n+1)
   }
   
   var days = ['Saturday', 'Friday', 'Thursday',
       'Wednesday'];
   
   var data = [];
   
   for (var i = 0; i < 4; i++) {
       for (var j = 0; j < hours.length; j++ ) {
           data.push([j, i, Math.random() * 10])
       }
   }
   
   option = {
       tooltip: {
           formatter: function (params) {
               return params.value[2];
           }
       },
       xAxis: {
           type: 'category',
           data: hours,
           boundaryGap: false,
           axisLine: {
               show: true
           }
       },
       yAxis: {
           type: 'category',
           data: days,
           axisLine: {
               show: true
           }
       },
       series: [{
           name: 'Punch Card',
           type: 'scatter',
           symbol: 'rect',
           symbolSize: function (val) {
               return [1, 20];
           },
           data: data,
           animationDelay: function (idx) {
               return idx * 5;
           }
       }]
   };
   ```
   
   ### What is expected?
   能自定义symbolSize
   
   ### What is actually happening?
   symbolSize在hover时的放大比例不受控
   
   ---
   散点图自定义了symbol:rect, symbolSize: [1, 20]
   导致hover的时候放大比例异常,目前通过设置hoverAnimation: false和itemStyle.emphasis来简单的实现hover变化,有其他更好的解决方法吗?
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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