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/05/26 07:21:41 UTC

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

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