-
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
Tooltip 能否针对不同的gridIndex或者series来决定是否显示? #5102
Comments
可以在 formatter 返回空字符串决定不显示 |
@pissang 某些情况下并不能解决问题. //echart version: 3.4.0
function fmt(p) {
//实测发现p总是长度为1的数组
if (p[0].seriesIndex !== 1) return '';
return p[0].seriesName + ': ' + p[0].value
}
option = {
tooltip: {
trigger: 'axis', //'item'时无此问题
//formatter: fmt
},
xAxis: [{max:4},{max:4}],
yAxis: [{max:3}],
series : [
{
name: 's1',
type: 'scatter',
xAxisIndex: [0],
data: [[1,1], [3,1]],
tooltip: {show: false},
//文档里没找到,但是tooltip.trigger=='item'时确实有效果
z: 1
}, {
name: 's2',
type: 'scatter',
xAxisIndex: [1],
data: [[2,2],[3,2]],
z: 999 //并没有什么卵用ㄟ( ▔, ▔ )ㄏ
}
]
}; 两坐标轴重合. 当 由于 PS: 目前已通过避免重合回避此问题, 然而为达到同样效果需要饶很多弯. 如果能正确处理上例中的情况, 复杂度, 性能及稳定性都会得到改善. 期待大牛帮忙解决 ~ |
v3.5 对这个功能已支持。参见 grid.tooltip |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
One-line summary [问题简述]
Option中有多个Grid, 其中有个grid不希望显示tooltip, 其他的grid显示tooltip, trigger方式为axis,如何实现?
Version & Environment [版本及环境]
Expected behaviour [期望结果]
tooltip 可根据gridindex 显示或者隐藏
ECharts option [ECharts配置项]
Other comments [其他信息]
The text was updated successfully, but these errors were encountered: