echarts icon indicating copy to clipboard operation
echarts copied to clipboard

tooltip采用坐标轴触发时,鼠标在图表无数据区域移动,会触发最近的数据点

Open zhang122622623 opened this issue 8 years ago • 3 comments

One-line summary [问题简述]

图表中包含折线图和散点图,x轴为时间轴,显示0:00-24:00的数据, tooltip采用坐标轴触发,鼠标移动到图表无数据位置,会触发最近的数据点; 例如:当图表从10:00开始有数据时,鼠标移动到10点之前的任意位置,都会触发10:00的这个数据点;若tooltip指示线为自动吸附时,此时指示线一直吸附在10:00的位置;指示线不设置自动吸附(snap:false)时,指示线会随着鼠标移动,但是仍然会触发10:00的数据点;

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:
  • Browser version [浏览器类型和版本]:
  • OS Version [操作系统类型和版本]:

echarts: 3.6.2; 浏览器:chrome 61; 操作系统:win7;

Expected behaviour [期望结果]

当鼠标在无数据区域移动,不触发最近的数据点;

ECharts option [ECharts配置项]

option = {
``    tooltip:{
               trigger:'axis',
               axisPointer:{
                 type:'line',
                 axis:'x',
                 lineStyle:{color:'#333',}
               },
               backgroundColor:'#555',
               formatter:function(params){
                   let tip = auth.formatterTip(params);
                   return tip ;
               },
            },
  xAxis: [{
              type: 'time',
              boundaryGap: false,
              min:new Date(this.timeSection[0]*1000),
              max:new Date(this.timeSection[1]*1000),
              interlval:0,
              axisLabel: {show:false,},
              axisLine: {lineStyle: {color: '#ccc'}},
              splitNumber: 24,
            }],
}

Other comments [其他信息]

详细信息和效果图看这:https://segmentfault.com/q/1010000012680575

zhang122622623 avatar Jan 03 '18 02:01 zhang122622623

今天遇到了相同的问题。

catscarlet avatar Aug 25 '19 08:08 catscarlet

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Sep 03 '21 21:09 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar Sep 11 '21 21:09 github-actions[bot]