-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5.x版本legend内的tooltip会继承外层的tooltip配置 #14939
Comments
Hi! We've received your issue and please be patient to get responded. 🎉 In the meanwhile, please make sure that it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so. A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster. You may also check out the API and chart option 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 question. If you are interested in the project, you may also subscribe our mailing list. Have a nice day! 🍵 |
@DaiShengQuan It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗 TRANSLATEDTITLE The tooltip in the v5.x version of the legend will inherit the outer tooltip configuration BODY Version5.0.0 Steps to reproducelegend: { What is expected?The tooltip in the legend should not inherit the formatter configuration of the outer tooltip What is actually happening?This problem will cause the tooltip to display the wrong content during the legend hover event |
That's a breaking change. option = {
legend: {
type: 'scroll',
orient: 'vertical',
// This is the formatter of legend text,
// not the formatter of legend tooltip.
formatter: function(name) {
return 'Legend ' + name;
},
tooltip: {
show: true,
// If no formatter declared, inherit the option.tooltip.formatter.
// That is the same result as in series.
},
},
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)',
},
series: {
type: 'bar',
label: {
formatter: 'label{a}{b}'
},
tooltip: {
// If no formatter declared, inherit the option.tooltip.formatter.
}
}
} @pissang Is it reasonable for this case? |
@100pah I think it's not reasonable. Component and series have different params in the formatter. They should not share one formatter config in most of the cases. We can have default formatted in the legend component. Not using the user-set tooltip formatter. |
fix: When component `tooltip.formatter` is not specified, use a specific default formatter, rather than use global `tooltip.formatter` as default. Fix #14939
Version
5.0.0
Steps to reproduce
What is expected?
legend内的tooltip不应继承外层tooltip的formatter配置
What is actually happening?
这个问题会导致图例hover事件时tooltip显示的内容错误
The text was updated successfully, but these errors were encountered: