在setOption的平级写点击事件,给chart添加click监听
javascript
getmapChart.setOption({
......
})
//和数据对应即可
//点击区域实现页面跳转
getmapChart.on('click',function(params){
// console.log(params);
switch(params.name){
case "xxxx":
top.location.href="/profile";
break;
case "xxxx1":
top.location.href="/profile";
break;
case "xxxx2":
top.location.href="/profile";
break;
default:
ElNotification({
title: "提示",
message: "请点击!!!",
type: "warning",
});
break;
}
})
上一篇文章,