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

[GitHub] [echarts] pjxxcc opened a new issue, #18620: [Bug] toolTip 设置中禁用自动触发后,通过 dispatchAction 触发 showTip 无效

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

   ### Version
   
   5.4.2
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?code=G4QwTgBAJiAuIQLwQNoF0DcAoUkbwGEB7AVwDtYkIBGABm1wgGd4xYAVASwFsBTKgNRleAdwgAROLwAUASgbgIAYykBzImE68mVFAHIVsXurABPAIJ6ANBANqNpgELXbh4w4J7MORbFMAHbV0sCAgAbwgyED4ALlsAKQBlCAAJXhB_FyUiABsNOL0AYgB2ACMATiVeaj0IAF8rEPDI6N4C8SIlEj4KJizc_NtC0qgANjGlWoamiKjY2wA5IihtfrywApKAVigADmKAFinG0NnWgoAZThZeYTA-m2z1zd5aUqVi3eOZlvm9AHEAAoAVQgAFleNwHGtBkUoB9ivDvqdfm1bEDgTCNkNigAmUoAZlGuKmWG8AHpyRB_rdeGApBAoUoANbQOAgLBuExaJgAOgAZhoAKIgJQAC2k_PISlgnCIZAg0i5DhsnDIKwAHrJwk1GKUQExeFw-FQWOAODxeNhQoLINJGJwqPQII6ADxswikCgYF0CATasJNUKMPyBACSRm4VFD2hQYLgYt5YC9UGk8dgifp6qI3DkEAAVIqY3ycrdVBmIABaGiyWTeULBxRQEj02XyqjpzMptMJpMgbO57WFui0UfyIMekC8_wkJgSwMNhtzNExiOQ3nLk6LiCgHIkNEoNWamz6w3G3g2aSno2WiACZDN1tysiyGyPuDPtBbxecSOJPylnEC7bqEZAaNwIA5EBE4gU8gyrpGvJwWAMENnUqHoYudTjou17nneyCdkm3ZEVmUA5nmha4qOtA4fUWDYdgUpkDKz4QGAtwrGAa65v44DREwNgZJwAa6ooypmGG6q8BqVDCbyu77tItHW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mTKsmXWQDFZBAA
   
   ### Steps to Reproduce
   
   1. 将 toolTip 设置中的 trigger 设置为 'none' 禁用自动触发;
   2. 监听 mouseover 事件,此时再调用 dispatchAction 触发 showTip,无效;
   
   这么做的目的其实是为了在 mouseover 事件中判定用户同时按住 Ctrl 键的情况下才显示 toolTip。
   
   ### Current Behavior
   
   为了在 mouseover 事件中判定用户同时按住 Ctrl 键的情况下才显示 toolTip
   
   ### Expected Behavior
   
   trigger 设置为 'none' 禁用自动触发 toolTip 后,在 mouseover 事件中调用 dispatchAction 触发 showTip,无效
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
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] pjxxcc commented on issue #18620: [Bug] toolTip 设置中禁用自动触发后,通过 dispatchAction 触发 showTip 无效

Posted by "pjxxcc (via GitHub)" <gi...@apache.org>.
pjxxcc commented on issue #18620:
URL: https://github.com/apache/echarts/issues/18620#issuecomment-1546603277

   > Instead of dispatching, why not set a boolean flag in the formatter?
   > 
   > ```
   > ctrl = false;
   > option = {
   >   tooltip: {
   >     trigger: 'item',
   >     formatter: function (params) {
   >       if (ctrl) return params.marker + params.name + ': ' + params.value[3] + ' ms';
   >     }
   >   }, ...
   > ```
   > 
   > Then of course you need to monitor the CTRL key and update the _ctrl_ flag.
   yeah, it works! [see here](https://echarts.apache.org/examples/zh/editor.html?code=G4QwTgBAJiAuIQLwQNoF0DcAoUkbwGEB7AVwDtYkIBGABm1wgGd4xYAVASwFsBTKgNRleAdwgAROLwAUASgbgIAYykBzImE68mVFAHIVsXurABPAIJ6ANBANqNpgELX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AADJuYdND8wKdnrDI2ll1yydjTifQjxarxodlwI4nZznAgVpC0RyjW5Dp0Jtwooh_El6d-YgWAHJySd_Bw09aXS1QRQKeDIRF08Ayw2AjGxUTxJZ7GgfUtDOFZU0AEIaTpRlmXtRnmdsDDlFpHJQ70MjY7AE1_ZVLCwElEVGLJnHzwLvQCgLrPIqfXgUAJNAS_FPpzNCKj6jvSdYGQ03QiMG1Sb0QEy1ZThKVd4dKVZPuqgoEVU-bu98BAAAtBzuGlubRYCNE9CYIaZNHt3h69sFli3kR0klelD5nhXtSIERJHgTmoDvuJ2U5XhofN62IAOTdoaZUovAGSYTgF7Aos9yInR-t3TeTsyC5RWPvYcQ9LYimPisAoZ8QAXyvmACBzcmhrVCN1c6NthwkziASTcTQvoQBtOYG01wyGhG4FaTaXoAInSYCoTutJnwnRAIwpgFwQCAJyMw5BIDPaOwgD7Y2ppHyBzQpJKkccOJYRtKZGwj5brLQAvaAQtgG56CbuRXWrcmgWCERIhecQtJKhoXeLkmhtBr2-hvJWrhDzm24Eg0IUldKyRzMraSIo5LQ2dtwRCphO7QOHIbLU8FYbVV2JRaGtxsgYK7veP65UbC4iIco5JaSyK2N3OYtAQlsBYG4KYAgzU2DKmNNIAwQ0pQuF4MALKAA-U2EcGRMhZMgcOSco6qC
 aPyaAvBSgkFUA7UioRJm1PqV6ZUUBrgKVgDqcwvtpCoUmTAzx29b4iC4JkO8BzmAiiVAlPSV0unKmcTcnyFyBShAXrcv6nTYBrNlJ8iZAoaJCVkEAA)
   
   Thank you.
   but i still hopping know why it doesn't work for dispath 'showTip'
   


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


[GitHub] [echarts] helgasoft commented on issue #18620: [Bug] toolTip 设置中禁用自动触发后,通过 dispatchAction 触发 showTip 无效

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #18620:
URL: https://github.com/apache/echarts/issues/18620#issuecomment-1546041199

   Instead of dispatching, why not set a boolean flag in the formatter?
   ```
   ctrl = false;
   option = {
     tooltip: {
       trigger: 'item',
       formatter: function (params) {
         if (ctrl) return params.marker + params.name + ': ' + params.value[3] + ' ms';
       }
     }, ...
   ```
   Then of course you need to monitor the CTRL key and update the _ctrl_ flag.


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


[GitHub] [echarts] helgasoft commented on issue #18620: [Bug] toolTip 设置中禁用自动触发后,通过 dispatchAction 触发 showTip 无效

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #18620:
URL: https://github.com/apache/echarts/issues/18620#issuecomment-1546729722

   > but i still hopping know why it doesn't work for dispath 'showTip'
   
   It works, just uncomment the dispatch command in your code and test.
   However dispatching _showTip_ on _mouseover_ or _click_ does not make sense since the tooltip has already been activated by _mouseover_.


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #18620: [Bug] toolTip 设置中禁用自动触发后,通过 dispatchAction 触发 showTip 无效

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

   @pjxxcc 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] After automatic triggering is disabled in the toolTip settings, triggering showTip via dispatchAction has no effect
   </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