You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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
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);
};
Current Behavior
tooltip没有消失
Expected Behavior
希望切换页面后tooltip消失
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: