diff --git a/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue b/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue index 553837f..7176922 100644 --- a/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue +++ b/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue @@ -405,6 +405,37 @@ allData.shuizhiOption.series[i].data = lineValue[i]; allData.shuizhiOption.series[i].name = stationName[i]; } + + // 算出最大值最小值 + + let maxValues = []; + let minValues = []; + // 遍历每个数组 + for (let i = 0; i < lineValue.length; i++) { + let currentArray = lineValue[i]; + + // 计算当前数组的最大值和最小值 + let maxValue = Math.max(...currentArray); + let minValue = Math.min(...currentArray); + + // 将结果存储在 maxValues 和 minValues 数组中 + maxValues.push(maxValue); + minValues.push(minValue); + } + // 合并所有最大值和最小值数组 + let allMaxValues = [].concat(...maxValues); + let allMinValues = [].concat(...minValues); + // 计算最终的最大值和最小值 + let finalMaxValue = Math.max(...allMaxValues); + let finalMinValue = Math.min(...allMinValues); + + if((Math.floor(parseFloat(finalMinValue) * 0.95) || 0 )< 1){ + // allData.shuizhiOption.yAxis.max = Math.floor(parseFloat(finalMaxValue) * 1.65); + }else{ + allData.shuizhiOption.yAxis.max = Math.floor(parseFloat(finalMaxValue) * 1.15); + } + + allData.shuizhiOption.yAxis.min = Math.floor(parseFloat(finalMinValue) * 0.95) || 0; if (lineValue.length == 0) { allData.shuizhiOption.graphic.invisible = false; //显示暂无数据 } else { diff --git a/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue b/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue index 553837f..7176922 100644 --- a/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue +++ b/src/pages/views/WatershedOneMap/modalPart/mingquSz.vue @@ -405,6 +405,37 @@ allData.shuizhiOption.series[i].data = lineValue[i]; allData.shuizhiOption.series[i].name = stationName[i]; } + + // 算出最大值最小值 + + let maxValues = []; + let minValues = []; + // 遍历每个数组 + for (let i = 0; i < lineValue.length; i++) { + let currentArray = lineValue[i]; + + // 计算当前数组的最大值和最小值 + let maxValue = Math.max(...currentArray); + let minValue = Math.min(...currentArray); + + // 将结果存储在 maxValues 和 minValues 数组中 + maxValues.push(maxValue); + minValues.push(minValue); + } + // 合并所有最大值和最小值数组 + let allMaxValues = [].concat(...maxValues); + let allMinValues = [].concat(...minValues); + // 计算最终的最大值和最小值 + let finalMaxValue = Math.max(...allMaxValues); + let finalMinValue = Math.min(...allMinValues); + + if((Math.floor(parseFloat(finalMinValue) * 0.95) || 0 )< 1){ + // allData.shuizhiOption.yAxis.max = Math.floor(parseFloat(finalMaxValue) * 1.65); + }else{ + allData.shuizhiOption.yAxis.max = Math.floor(parseFloat(finalMaxValue) * 1.15); + } + + allData.shuizhiOption.yAxis.min = Math.floor(parseFloat(finalMinValue) * 0.95) || 0; if (lineValue.length == 0) { allData.shuizhiOption.graphic.invisible = false; //显示暂无数据 } else { diff --git a/src/pages/views/WatershedOneMap/modalPart/natureNet.vue b/src/pages/views/WatershedOneMap/modalPart/natureNet.vue index 849f752..aa11c42 100644 --- a/src/pages/views/WatershedOneMap/modalPart/natureNet.vue +++ b/src/pages/views/WatershedOneMap/modalPart/natureNet.vue @@ -11,9 +11,9 @@ - +