You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/05/27 04:51:46 UTC

[GitHub] [incubator-echarts] yzhang921 opened a new issue #10549: Tooltip HTML 不能调用外部函数

yzhang921 opened a new issue #10549: Tooltip HTML 不能调用外部函数
URL: https://github.com/apache/incubator-echarts/issues/10549
 
 
   本想在formatter生成的html中增加一个事件触发,调用外部函数做一些事情,发现该作用域里面调用不到任何外部函数
   
   ```
   tooltip: {
                       trigger: 'item',
                       enterable: true,
                       triggerOn: 'click',
                       formatter(params) {
                           let {name, value} = params;
                           let res = `${name}~${mainMetric} : ${value}<br/>`;
                           ...
                           let callBack = function () {
                              ....
                           };
                           res += `<span style="color:#bbe1ff;float:right;cursor:pointer" onclick="callBack">触发</span>`;
                           return res;
                       }
                   },
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org