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 2020/03/27 04:24:06 UTC
[GitHub] [incubator-echarts] dfc12315 opened a new issue #12338: The
callback function of toolip formatter will be executed multiple times
dfc12315 opened a new issue #12338: The callback function of toolip formatter will be executed multiple times
URL: https://github.com/apache/incubator-echarts/issues/12338
### Version
4.7.0
### Reproduction link
[https://gallery.echartsjs.com/editor.html?c=xqr_p2-TB8&v=1](https://gallery.echartsjs.com/editor.html?c=xqr_p2-TB8&v=1)
### Steps to reproduce
如案例打开控制台界面,移动鼠标到对应的 one 块上面,日志打印输出会执行很多次, 同样在这里调用 网络请求也会被执行很多次
### What is expected?
鼠标移入到 one、two 等上面只执行一次请求
### What is actually happening?
执行了很多次请求
<!-- 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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] dfc12315 commented on issue #12338: The
callback function of toolip formatter will be executed multiple times
Posted by GitBox <gi...@apache.org>.
dfc12315 commented on issue #12338: The callback function of toolip formatter will be executed multiple times
URL: https://github.com/apache/incubator-echarts/issues/12338#issuecomment-604817909
谢谢,没有看到那个,抱歉
----------------------------------------------------------------
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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] susiwen8 commented on issue #12338: The
callback function of toolip formatter will be executed multiple times
Posted by GitBox <gi...@apache.org>.
susiwen8 commented on issue #12338: The callback function of toolip formatter will be executed multiple times
URL: https://github.com/apache/incubator-echarts/issues/12338#issuecomment-604808711
tooltip 展示是根据鼠标移动而更新的
----------------------------------------------------------------
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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12338: The
callback function of toolip formatter will be executed multiple times
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12338: The callback function of toolip formatter will be executed multiple times
URL: https://github.com/apache/incubator-echarts/issues/12338#issuecomment-604807597
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
Have a nice day! 🍵
----------------------------------------------------------------
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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] susiwen8 commented on issue #12338: The
callback function of toolip formatter will be executed multiple times
Posted by GitBox <gi...@apache.org>.
susiwen8 commented on issue #12338: The callback function of toolip formatter will be executed multiple times
URL: https://github.com/apache/incubator-echarts/issues/12338#issuecomment-604808564
Related to https://github.com/apache/incubator-echarts/issues/10215
----------------------------------------------------------------
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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] wf123537200 commented on issue #12338: The callback function of toolip formatter will be executed multiple times
Posted by GitBox <gi...@apache.org>.
wf123537200 commented on issue #12338:
URL: https://github.com/apache/incubator-echarts/issues/12338#issuecomment-619523390
Is it possible to make a layer of cache? If you have already called fomatter on the same tooltip, it will not be called again. It should be what you can try (you can see if the unique key here uses this)
是不是可以做一层缓存,如果已经对同一个tooltip调用过fomatter,就不再调用,试了下应该是你可以的(这里的唯一key是否用这个可以大家再看看)
```
// incubator-echarts/src/component/tooltip/TooltipView.js :Line 579
else if (typeof formatter === 'function') {
// cache object
this._toopTipFormatterCache = this._toopTipFormatterCache || {}
var key = params[0].seriesId + params[0].name
var callback = bind(function (cbTicket, html) {
if (cbTicket === this._ticket) {
tooltipContent.setContent(html, markers, tooltipModel);
this._updatePosition(
tooltipModel, positionExpr, x, y, tooltipContent, params, el
);
}
}, this);
this._ticket = asyncTicket;
html = this._toopTipFormatterCache[key] || formatter(params, asyncTicket, callback);
// cache
this._toopTipFormatterCache[key] = html;
}
```
result as follow:
结果如下:

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