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 2018/10/25 08:14:52 UTC

[GitHub] lightColour opened a new issue #9279: 动态设置 markline, symbol 高亮效果 失效

lightColour opened a new issue #9279: 动态设置 markline, symbol 高亮效果 失效
URL: https://github.com/apache/incubator-echarts/issues/9279
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   动态设置 markline, tooltip trigger: 'axis', 曲线图 symbol hover 高亮效果失效,见下面 demo:
   http://gallery.echartsjs.com/editor.html?c=xMXp4_uZps&v=5
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:
   + Browser version [浏览器类型和版本]:
   + OS Version [操作系统类型和版本]:
   见demo: http://gallery.echartsjs.com/editor.html?c=xMXp4_uZps&v=5
   
   
   
   
   ### Expected behaviour [期望结果]
   正常显示 hover 高亮效果, 或者看下有没有补救的办法。
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   option = {
     tooltip: {
           trigger: 'axis',
           formatter: function(param) {
               var oldOption = myChart.getOption();
               for (var k = 0; k < param.length; k++) {
                   oldOption.series[k].markLine = {
                     animation: true,
                     opacity: 0.3,
                     silent: true,
                     symbol: 'none',
                     data:[{
                       name: '',
                       yAxis: param[k].value
                     }
                   ]};
               }
               setTimeout(function() {
                   // 注释这里对比前后高亮效果
                   myChart.setOption(oldOption,false,false,true);
               })   
           }
       },
       xAxis: {
           type: 'category',
           boundaryGap: false,
           data: ["00:00", "02:00", "04:00", "06:00", "08:00", "10:00", "12:00", "14:00", "16:00", "18:00", "20:00", "22:00"],
       },
       yAxis: {
           type: 'value',
           show: false
       },
       series: [{
           name: '当日账户下降',
           data: [3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8],
           type: 'line',
           smooth: true,
           symbol: 'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7',
           symbolSize: 8,
           showSymbol: true,
           itemStyle: {
               normal: {
                   color: "#16D9F0"
               },
           },
           lineStyle: {
               normal: {
                   width: 5
               }
           },
       }, {
           name: '当日账户活跃',
           data: [13, 18, 13, 18, 13, 18, 13, 18, 13, 18, 13, 18],
           type: 'line',
           smooth: true,
           symbol: 'circle',
           symbolSize: 8,
           showSymbol: true,
           itemStyle: {
               normal: {
                   color: "#BEB7FB"
               },
           },
           lineStyle: {
               normal: {
                   width: 5
               }
           },
       }, {
           name: '当日总消耗',
           data: [23, 28, 23, 28, 23, 28, 23, 28, 23, 28, 23, 28],
           type: 'line',
           smooth: true,
           symbol: 'circle',
           symbolSize: 8,
           showSymbol: true,
           itemStyle: {
               normal: {
                   color: "#F6E518"
               },
           },
           lineStyle: {
               normal: {
                   width: 5
               }
           },
       }]
   }
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   http://gallery.echartsjs.com/editor.html?c=xMXp4_uZps&v=5
   

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