You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "xiaofan10 (via GitHub)" <gi...@apache.org> on 2023/05/26 07:21:37 UTC

[GitHub] [echarts] xiaofan10 opened a new issue, #18672: [Bug] echarts 中 highlight 事件的触发条件

xiaofan10 opened a new issue, #18672:
URL: https://github.com/apache/echarts/issues/18672

   ### Version
   
   5.4.4
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?c=bar-background
   
   ### Steps to Reproduce
   
   使用的官方示例https://echarts.apache.org/examples/zh/editor.html?c=bar-background
   
   ### Current Behavior
   
   我的理解是当鼠标划入图形(如:柱状图、饼图),划入的部分会高亮,那么此时是不是应该触发高亮事件。
   事实是柱状图我需要配置如下:
   `import * as echarts from 'echarts';
   
   var chartDom = document.getElementById('main');
   var myChart = echarts.init(chartDom);
   var option;
   
   option = {
     // tooltip: {
     //   show: true,
     //   trigger: 'axis'
     // },
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
       axisPointer: {
         show: true,
         type: 'shadow'
       }
     },
     yAxis: {
       type: 'value'
     },
     series: [
       {
         data: [120, 200, 150, 80, 70, 110, 130],
         type: 'bar',
         showBackground: true,
         backgroundStyle: {
           color: 'rgba(180, 180, 180, 0.2)'
         }
       }
     ]
   };
   
   myChart.on('highlight', function (e) {
     console.log('高亮拉', e);
   });
   
   option && myChart.setOption(option);`
   必须配置axisPointer才能触发高亮事件,饼图、地图如何触发没试出来
   我不清楚是bug还是就是这样设计的,或者是我理解错了
   
   
   ### Expected Behavior
   
   无需其他配置,当鼠标划入元素,触发对应的高亮事件
   
   ### Environment
   
   ```markdown
   - OS:windows 11
   - Browser:chrome的任何版本
   - Framework:Vue2 或者小程序
   ```
   
   
   ### Any additional comments?
   
   初学者,如有不对的地方,请谅解!


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #18672: [Bug] echarts 中 highlight 事件的触发条件

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #18672:
URL: https://github.com/apache/echarts/issues/18672#issuecomment-1563924072

   @xiaofan10 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] The trigger condition of the highlight event in echarts
   
   **BODY**
   
   ### Version
   
   5.4.4
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?c=bar-background
   
   ### Steps to Reproduce
   
   Official example using https://echarts.apache.org/examples/zh/editor.html?c=bar-background
   
   ### Current Behavior
   
   My understanding is that when the mouse enters a graph (such as a histogram, pie chart), the inserted part will be highlighted, so should the highlight event be triggered at this time?
   The fact is that the histogram I need to configure as follows:
   `import * as echarts from 'echarts';
   
   var chartDom = document. getElementById('main');
   var myChart = echarts.init(chartDom);
   var option;
   
   option = {
     // tooltip: {
     // show: true,
     // trigger: 'axis'
     // },
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
       axisPointer: {
         show: true,
         type: 'shadow'
       }
     },
     yAxis: {
       type: 'value'
     },
     series: [
       {
         data: [120, 200, 150, 80, 70, 110, 130],
         type: 'bar',
         showBackground: true,
         backgroundStyle: {
           color: 'rgba(180, 180, 180, 0.2)'
         }
       }
     ]
   };
   
   myChart.on('highlight', function (e) {
     console.log('highlight pull', e);
   });
   
   option && myChart.setOption(option);`
   The axisPointer must be configured to trigger the highlight event. How to trigger the pie chart and the map has not been tried.
   I don't know if it's a bug or it's designed like this, or I understand it wrong
   
   
   ### Expected Behavior
   
   No other configuration is required, when the mouse enters the element, the corresponding highlight event is triggered
   
   ### Environment
   
   ```markdown
   - OS: windows 11
   - Browser: any version of chrome
   - Framework: Vue2 or applet
   ```
   
   
   ### Any additional comments?
   
   Beginners, if there is something wrong, please forgive me!
   </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