You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/03/23 05:56:08 UTC

[GitHub] [echarts] Jordon-Chen edited a comment on issue #1740: echarts的tooltip中可以放图片、超链接之类的元素吗?

Jordon-Chen edited a comment on issue #1740:
URL: https://github.com/apache/echarts/issues/1740#issuecomment-804629078


   This works well for me.
   ```
   tooltip: {
     position: function (pos, params, dom, rect, size) {
       const tooltipWidth = window.getComputedStyle(dom).width.replace('px', '')
       if (pos[0] < size.viewSize[0] / 2) {
         return [pos[0], pos[1] - 20]
       } else {
         return [pos[0] - tooltipWidth, pos[1] - 20]
       }
     }
   }
   ```
   Reproduction link
   [https://jsfiddle.net/Jordon_Chen/5uzkf1x8/15/](https://jsfiddle.net/Jordon_Chen/5uzkf1x8/15/)


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

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