mpvue-echarts
mpvue-echarts copied to clipboard
小程序中国地图、关系图拖拽问题
小程序上无法拖拽缩放
地图配置 let option = { //左侧颜色图例 visualMap: { //地图颜色配置 type: "continuous", text: ["高", "低"], show: false, showLabel: true, seriesIndex: [0], min: 1, max: data.length > 0 ? data[0].value : 7, inRange: { //color: "#fff" color: ["#ebf5ff", "#b2dfff", "#94d0fd", "#80c8ff", "#7abcff", "#66b2fd", "#6799ff"] }, textStyle: { color: "#000" }, bottom: 30, left: 20, right: 20 }, series: [{ type: 'map', map: 'china', roam: true, zoom: 1.2, //当前视角的缩放比例 label: { normal: { formatter: function(params) { //console.log(params) //return let text = ''; if(params.data){ if(params.data.value==0){ text = '' }else if(params.data.value<1000){ text = params.data.value; }else{ text = (params.data.value / 1000).toFixed(2) + "k+"; } } return text }, show: true, //显示省份标签 textStyle: { color: "#333", fontSize: 10 } //省份标签字体颜色 } }, data: data, itemStyle: { emphasis: { areaColor: "#fff464" //鼠标悬浮在地图上的颜色 }, normal: { areaColor: '#DAFCFD', //设置地图省市背景 borderWidth: 1, //设置地图外层边框 borderColor: '#f5f5f5', } }, }], } @F-loat