From 99a3e5e38cdc3aaf03fb5b0ef5ccd7ba118c63ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E4=B8=BD=E5=90=9B?= <664953382@qq.com> Date: Mon, 24 Jan 2022 15:40:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97spc=E5=B9=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=9C=80=E5=B0=8F=E5=80=BC=E5=92=8C=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/qualityManage/center2.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/views/bigScreen/qualityManage/center2.vue b/src/views/bigScreen/qualityManage/center2.vue index 3118d6c..f7b46cd 100644 --- a/src/views/bigScreen/qualityManage/center2.vue +++ b/src/views/bigScreen/qualityManage/center2.vue @@ -85,6 +85,8 @@ export default { productName.push(item.productName); realValue.push(item.realValue); } + const dataMin = Math.min.apply(Math, realValue); + const dataMax = Math.max.apply(Math, realValue); this.chart.setOption({ tooltip: { trigger: "axis", @@ -113,9 +115,16 @@ export default { yAxis: { type: "value", name: "", - min: resData.spc.lowerLimit - 50, - // max: 250, - // interval: 50, + min: + (dataMin < resData.spc.lowerLimit + ? dataMin + : resData.spc.lowerLimit) - 50, + max: + (dataMax > resData.spc.upperLimit + ? dataMax + : resData.spc.upperLimit) - + 0 + + 50, axisLabel: { formatter: "{value}", },