Explorar el Código

统计:企业地块统计地图,根据各地市数据显示对应颜色;

chengbeibei hace 10 meses
padre
commit
d59716dbb7
Se han modificado 1 ficheros con 12 adiciones y 2 borrados
  1. 12 2
      src/views/tj/compoent/map3Data.vue

+ 12 - 2
src/views/tj/compoent/map3Data.vue

@@ -31,6 +31,7 @@ export default {
       options: {},
       myTool1_show: false,
       rangeMax: 200,
+      rangeMin: 0,
     }
   },
   mounted() {
@@ -49,7 +50,9 @@ export default {
           this.getPie()
         })
         // 获取组件允许最大值
-        this.rangeMax = Math.max.apply(Math, newVal.map(item => item.value));
+        // this.rangeMax = Math.max.apply(Math, newVal.map(item => item.value));
+        // 获取组件允许最小值
+        // this.rangeMin = Math.min.apply(Math, newVal.map(item => item.value));
 
       }
     },
@@ -60,6 +63,7 @@ export default {
           this.tem_resultMapData = oldVal
           this.getPie()
         }
+
       }
 
     }
@@ -113,6 +117,11 @@ export default {
       document.oncontextmenu = function () {
         return false;
       };
+      // 获取组件允许最大值
+      this.rangeMax = Math.max.apply(Math, this.tem_data.map(item => item.value));
+      // 获取组件允许最小值
+      this.rangeMin = Math.min.apply(Math, this.tem_data.map(item => item.value));
+
       // 显示 loading 动画
       myChart.showLoading();
       myChart.on("contextmenu", (params) => {
@@ -220,7 +229,8 @@ export default {
           text: ['高', '低'],
           showLabel: false,
           seriesIndex: [0],
-          min: 0,
+          // min: 0,
+          min: this.rangeMin,
           max: this.rangeMax,
           inRange: {
             color: ['#ADD6F1', '#26AEFB', '#0290EB'] // 渐变颜色