// this.charts.getZr().on('click', params =>{
// this.$emit('click', params)
// })
this.charts.getZr().on('click', params => {
const pointInPixel = [
params.offsetX,
params.offsetY,
];
if (this.charts.containPixel('grid', pointInPixel)) {
const index = this.charts.convertFromPixel({seriesIndex: 0}, pointInPixel)[0];
const op = this.charts.getOption();
const name = op.xAxis[0].data[index ];
this.$emit('click', {
name
})
}
})
柱状图点击传参 点击阴影部分
最新推荐文章于 2024-09-06 10:08:11 发布