You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "echarts-bot[bot] (via GitHub)" <gi...@apache.org> on 2023/04/07 07:10:10 UTC

[GitHub] [echarts] echarts-bot[bot] commented on issue #18484: [Bug] tooltip采用坐标轴触发时,鼠标在图表无数据区域移动,会触发最近的数据点

echarts-bot[bot] commented on issue #18484:
URL: https://github.com/apache/echarts/issues/18484#issuecomment-1500010571

   @zhangyue0419 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] When the tooltip is triggered by an axis, the mouse moves in the dataless area of the chart to trigger the nearest data point
   
   **BODY**
   
   ### Version
   
   5.4.1
   
   ### Link to Minimal Reproduction
   
   https://segmentfault.com/q/1010000012680575?sort=created
   
   ### Steps to Reproduce
   
   ##The chart includes a line chart and a scatter chart, the x-axis is the time axis, and the data from 0:00-24:00 is displayed. The tooltip is triggered by the coordinate axis. When the mouse moves to the position where there is no data in the chart, the nearest data point will be triggered;
   ##For example: when the chart starts to have data from 10:00, the mouse moves to any position before 10:00, and the data point at 10:00 will be triggered; if the tooltip indicator line is automatically absorbed, the indicator line will always be absorbed at this time At 10:00; when the indicator line does not set automatic adsorption (snap: false), the indicator line will move with the mouse, but the data point at 10:00 will still be triggered;
   Part of the code is as follows:
   
   ### Current Behavior
   
   The chart includes a line chart and a scatter chart. The x-axis is the time axis, displaying data from 0:00-24:00. The tooltip is triggered by the coordinate axis. When the mouse moves to the position where there is no data in the chart, the nearest data point will be triggered;
   For example: when the chart has data from 10:00, moving the mouse to any position before 10:00 will trigger the data point at 10:00; if the tooltip indicator line is automatically attached, the indicator line will always be attached at 10:00 : the position of 00; when the indicator line does not set automatic adsorption (snap: false), the indicator line will move with the mouse, but the data point at 10:00 will still be triggered;
   Part of the code is as follows:
   
   ### Expected Behavior
   
   Where there is no data, it should not display or give empty data, at least give a configuration
   `tooltip:{
                  trigger: 'axis',
                  axisPointer: {
                    type:'line',
                    axis:'x',
                    lineStyle:{color:'#333',}
                  },
                  backgroundColor:'#555',
                  formatter: function (params) {
                      let tip = auth. formatterTip(params);
                      return tip;
                  },
               },`
   
   ### Environment
   
   ```markdown
   -OS:windows
   -Browser: google
   - Framework: vue3
   ```
   
   
   ### Any additional comments?
   
   No
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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