Hi, glad to see you using ECharts for development!

I think the code shown in the screenshot you provided is almost right. If you 
want to call a function handler and pass some variables to it, you could add 
some extra properties for the `span` tag, for example, 
`data-name=”${params.name}”`, and then in the handler function, the param 
`name` can be fetched by `target.getAttribute('data-name')` or 
`target.dataset.name`.
Note that the handler function should be accessible globally, for instance, to 
mount it to `window` or your own any other global context.

Sample code is available on ECharts Gallery: 
https://gallery.echartsjs.com/editor.html?c=xir8UiRFq9&v=2

Thanks,
Zhongxiang.

On 2020/07/17 09:32:57, "908260461" <t...@qq.com> wrote: 
> 你好,我想问下 echart-饼图 -tootip-formatter点击事件,要在点击事件里面做一些操作, 请问应该怎么写呢> 


  • echart 908260461
    • Re: echart plainheart

Reply via email to