antvis/G2


The issue has been closed
设置autoFit:true,容器尺寸发生改变触发自适应后tooltip异常 #4135
liswn posted onGitHub
设置autoFit:true,容器尺寸发生改变触发自适应后tooltip异常
- 版本:4.2.7
- 引入方式:浏览器本地引用
- 问题:设置autoFit:true,容器尺寸发生改变触发自适应后tooltip不能正确的触发
<div style="width:100%;height:100%" id="demoChart"></div>
const demoChart = new MyChart("demoChart")
demoChart.changeData([{ x: '9.13', y: 1000 }])
class MyChart { constructor(domId) { this.domId = domId const chart = new G2.Chart({ container: domId, autoFit: true }); chart.scale("x", { nice: true }); chart.scale("y", { nice: true });
chart.tooltip(true);
chart.legend(true);
chart.interval().position('x*y').color('x')
this.chart = chart
}
changeData(data) {
this.chart.changeData(data)
}
}
```