一
myChart.on('click', (params) => {
if (params.componentType === 'series' && params.dataIndex !== undefined) {
const months = this.month_htqd[params.dataIndex]; // 获取点击柱状图的 X 轴坐标值
alert(`点击了柱状图,值为: ${months}`);
// 根据点击的柱状图数据索引,处理跳转逻辑
this.$router.push( {
path: `/tzmanager/yueding`,
query: {
yuedTime: months
}
});
}
});
二
data () {
return {
queryParam: {
yuedTime: '' // 初始化为空,接收选择的月份值
},
},
mounted() {
this.queryParam.yuedTime =this.$route.query.yuedTime;
}
}