BenoitZugmeyer opened a new issue #9116: Tooltips with the "aixs" trigger are 
closed when calling chartInstance.setOption().
URL: https://github.com/apache/incubator-echarts/issues/9116
 
 
   ### One-line summary [问题简述]
   
   When the chart shows a tooltips with `trigger: "axis"`, calling 
`chartInstance.setOption()` is closing the tooltip.
   
   ### Version & Environment [版本及环境]
   
   + ECharts version [ECharts 版本]: 4.1 or 4.2.0-rc.1
   + Browser version [浏览器类型和版本]: Firefox 62.0 and Chrome 69.0.3497.92
   + OS Version [操作系统类型和版本]: Arch Linux, up to date
   
   ### Expected behaviour [期望结果]
   
   When hovering an empty part of the chart (= not a serie), the tooltip 
configured with the `"axis"` trigger is showing. When calling `setOption()` 
when the tooltip is shown, it should still be displayed.
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   (this is a modified version of 
https://ecomfe.github.io/echarts-examples/public/editor.html?c=dynamic-data2 )
   ```javascript
   myChart = echarts.init(document.querySelector('main'))
   
   function randomData() {
     now = new Date(+now + oneDay);
     value = value + Math.random() * 21 - 10;
     return {
       name: now.toString(),
       value: [
         [now.getFullYear(), now.getMonth() + 1, now.getDate()].join("/"),
         Math.round(value)
       ]
     };
   }
   
   var data = [];
   var now = +new Date(1997, 9, 3);
   var oneDay = 24 * 3600 * 1000;
   var value = Math.random() * 1000;
   for (var i = 0; i < 1000; i++) {
     data.push(randomData());
   }
   
   option = {
     tooltip: {
       trigger: "axis",
       formatter: function(params) {
         params = params[0];
         var date = new Date(params.name);
         return date.getDate() +
           "/" +
           (date.getMonth() + 1) +
           "/" +
           date.getFullYear() +
           ":" +
           params.value[1];
       },
     },
     xAxis: {
       type: "time"
     },
     yAxis: {
       type: "value",
       boundaryGap: [0, "100%"]
     },
     series: [{
       type: "line",
       data: data
     }]
   };
   
   
   setInterval(function() {
        myChart.setOption({})
   }, 1000);
   
   myChart.setOption(option);
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   Online demo: https://jsfiddle.net/z0ok3m2f/18/ (to reproduce: hover a blank 
part of the chart, the tooltip should show up, but it will be closed after a 
bit, because `setOption` is called)
   

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