1.一列点击
https://blog.csdn.net/lightpass/article/details/81457410
// echarts 点击事件
handleEcharts (params) {
let pointInPixel = [params.offsetX, params.offsetY]
if (this.$refs['lineBarChart'].chart.containPixel('grid', pointInPixel)) {
let xIndex = this.$refs['lineBarChart'].chart.convertFromPixel({ seriesIndex: 0 }, [params.offsetX, params.offsetY])[0]
let option= this.$refs['lineBarChart'].chart.getOption();
// let data=option.xAxis[0].data[xIndex];
let name=option.series[0].data[xIndex].hy;
this.$router.push({
path: "/sevdet",
query: {
name,
...this.date
},
});
}
},
网友评论