yzhang921 opened a new issue #10550: Tooltip HTML 不能调用外部函数
URL: https://github.com/apache/incubator-echarts/issues/10550
 
 
   ### What problem does this feature solve?
   本想在formatter生成的html中增加一个事件触发,调用外部函数做一些事情,发现该作用域里面调用不到任何外部函数; 
   该功能可以模拟做简单类似conextMenu菜单
   
   ### What does the proposed API look like?
   ```javascript
   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 issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to