antvis/G2





The issue has been closed
Tooltip is not displayed for the second view. #6130
peaceps posted onGitHub
问题描述
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
width: 928,
height: 320,
paddingLeft: 90,
paddingBottom: 60,
});
const data = [
[
{ x: 1, y: 2},
{ x: 2, y: 6},
{ x: 3, y: 4},
{ x: 4, y: 9}
],
[
{ x: 1, y: 3},
{ x: 2, y: 6},
{ x: 3, y: 7},
{ x: 4, y: 9}
]
];
const spaceFlex = chart.spaceFlex();
for (let i = 0; i < data.length; i++) {
const view = spaceFlex.view();
view.data(data[i])
.axis({
x: {
title: 'X',
line: true,
lineLineWidth: 1,
grid: false
},
y: {
title: 'Y',
line: true,
lineLineWidth: 1,
grid: true,
gridLineWidth: 2
}
})
.line()
.encode('x', 'x')
.encode('y', 'y')
.tooltip();
}
chart.render();
重现链接
No response
重现步骤
No response
预期行为
No response
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
屏幕截图或视频(可选)
No response
补充说明(可选)
No response