echart 页面跳转_echarts3地图实现点击某省市区域跳转到相应页面
myEcharts.on('click', function(params) {//設(shè)置點擊事件
var province = params.name;//獲取選中省市的省市名稱
switch(province) {
case '新疆':
location.href = 'http://www.baidu.com';//測試效果:選中新疆并觸發(fā)點擊事件后跳轉(zhuǎn)到百度首頁
break;
case '西藏':
location.href = '';
break;
case '云南':
location.href = '';
break;
case '廣西':
location.href = '';
break;
case '廣東':
location.href = '';
break;
case '海南':
location.href = '';
break;
case '澳門':
location.href = '';
break;
case '香港':
location.href = '';
break;
case '臺灣':
location.href = '';
break;
case '福建':
location.href = '';
break;
case '浙江':
location.href = '';
break;
case '上海':
location.href = '';
break;
case '江蘇':
location.href = '';
break;
case '山東':
location.href = '';
break;
case '天津':
location.href = '';
break;
case '北京':
location.href = '';
break;
case '遼寧':
location.href = '';
break;
case '吉林':
location.href = '';
break;
case '黑龍江':
location.href = '';
break;
case '內(nèi)蒙古':
location.href = '';
break;
case '寧夏':
location.href = '';
break;
case '青海':
location.href = '';
break;
case '甘肅':
location.href = '';
break;
case '四川':
location.href = '';
break;
case '重慶':
location.href = '';
break;
case '貴州':
location.href = '';
break;
case '湖南':
location.href = '';
break;
case '湖北':
location.href = '';
break;
case '河南':
location.href = '';
break;
case '陜西':
location.href = '';
break;
case '山西':
location.href = '';
break;
case '河北':
location.href = '';
break;
case '安徽':
location.href = '';
break;
default:
break;
}
});
ps:當(dāng)選項較多時使用switch-case 比 if-else快
總結(jié)
以上是生活随笔為你收集整理的echart 页面跳转_echarts3地图实现点击某省市区域跳转到相应页面的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 汇编语言---大小写字母转换
- 下一篇: 中国农业大学的计算机科学与技术,孙瑞志谈