Skip to content
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

[Bug] echarts的tooltip渲染模式为html的时候,在切换页面后,鼠标移动至该echarts偶尔会导致tooltip被带到其他页面,且除刷新页面以外无法消失 #20499

Open
Aweiisdead opened this issue Nov 11, 2024 · 1 comment
Labels
bug pending We are not sure about whether this is a bug/new feature.

Comments

@Aweiisdead
Copy link

Version

5.5.0

Link to Minimal Reproduction

none

Steps to Reproduce

import * as echarts from 'echarts';
import { setTooltipDom } from './index';
export const drawLine = (
dom: HTMLElement,
lineData: {
[key: number]: number | string;
}
) => {
let data = [];
Object.keys(lineData).forEach((name) => {
data.push({
name,
value: lineData[name],
});
});
dom.style.height = data.length * 210 + 'px';
const chart = echarts.init(dom);
let xArr = [];
let yArr = [];
let gridArr = [];
let seriesArr = [];
data.forEach((item, index) => {
xArr.push({
type: 'category',
gridIndex: index,
axisTick: false,
axisLabel: {
color: '#C5D8FF',
},
axisLine: {
lineStyle: {
color: 'rgba(197, 216, 255, 1)',
},
},
data: Object.keys(item.value),
});
yArr.push({
type: 'value',
gridIndex: index,
axisLabel: {
color: 'rgba(197, 216, 255, 1)',
},
splitLine: {
lineStyle: {
type: 'dashed',
color: '#E6F7FF33',
},
},
});
gridArr.push({
id: index,
height: 150,
top: 200 * index + 50,
});
seriesArr.push({
type: 'line',
name: item.name,
data: Object.values(item.value),
xAxisIndex: index,
yAxisIndex: index,
backgroundColor: 'rgb(25, 50, 92)',
});
});

let option = {
xAxis: xArr,
yAxis: yArr,
grid: gridArr,
series: seriesArr,
legend: {
show: true,
textStyle: {
color: 'rgba(197, 216, 255, 1)',
},
left: 30,
top: 10,
itemStyle: {},
},
tooltip: {
confine: false,
appendToBody: true,
trigger: 'axis',
axisPointer: {
type: 'line',
axis: 'x',
},
renderMode: 'html',
className: 'geometryTooltip',
padding: 0,
borderWidth: 0,
formatter: (val) => {
return setTooltipDom(val);
},
},
axisPointer: {
link: [
{
xAxisIndex: 'all',
},
],
},
};
chart.setOption(option);
};
bug1

Current Behavior

tooltip没有消失

Expected Behavior

希望切换页面后tooltip消失

Environment

- OS:windows11
- Browser: 130.0.6723.117
- Framework:Vue@3.4.25

Any additional comments?

No response

@Aweiisdead Aweiisdead added the bug label Nov 11, 2024
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Nov 11, 2024
Copy link

echarts-bot bot commented Nov 11, 2024

@Aweiisdead It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] When the tooltip rendering mode of echarts is set to html, moving the mouse to the echarts after switching pages will sometimes cause the tooltip to be taken to other pages, and it will not disappear except for refreshing the page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

1 participant