在给chart添加 onPlotClick={e => this.changeToModel(e)}点击事件之前
先加一个
onGetG2Instance={g2chart => {
this.setState({
chartIns: g2chart
})
}}
changeToModel = e => {
const { chartIns } = this.state;
const { upgradeStatus, count } = chartIns.getTooltipItems({ x: e.x, y: e.y })[0].point.point;
};