Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Echart tooltip with a hyper link

Tags:

echarts

I am trying to put a clickable hyper link on echart tooltip.

  tooltip: {
    appendToBody: true,
    hideDelay: 3000,
    formatter: function (o) { return "<a href="http://google.com">test</a>" ; }
  }

Tooltip is rendered with underlined test text, but the link doesn't work (it is not clickable).

SVG/Canvas driver doesn't make situation better. Echart version is 5.4.2

like image 960
Daniil Iaitskov Avatar asked Jul 27 '26 18:07

Daniil Iaitskov


1 Answers

frist, you must use HTTPS, and then you can check tooltip css attribute. it have pointer-events: none. you can chanel it. you can use

 tooltip: {
   appendToBody: true,
   hideDelay: 3000,
   extraCssText: 'pointer-events: auto!important',
   formatter: function (o) { return "<a href="https://google.com">test</a>" ;}
}
like image 58
littleforest Avatar answered Jul 30 '26 08:07

littleforest