@@ -28,7 +28,7 @@
let that = this
getWgfb().then(resp => {
// alert("网格分布")
- that.data = resp.data
+ that.data = Array.isArray(resp.data) && resp.data.length > 20 ? resp.data.splice(0,22) : resp.data
this.myEcharts()
})
},
@@ -27,7 +27,7 @@
setTimeout(() => {
getWgry().then(resp => {
- that.getWgry = resp.data
+ that.getWgry = Array.isArray(resp.data) && resp.data.length > 20 ? resp.data.splice(0,22) : resp.data
// alert("网格人员")
that.myEcharts()
@@ -52,7 +52,8 @@
var max = 0,
len = arr.length;
for (var i = 0; i < len; i++) {
- max += arr[i][key];
+ var item = arr[i][key];
+ if (max < item) max = item;
}
return max;