From fe9725841f0fae7d175a4eaae725bb8186ce98ec Mon Sep 17 00:00:00 2001 From: luyisha Date: Thu, 7 Sep 2023 17:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=B1=E5=BD=A2=E5=9B=BE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 0fe6437..838ee76 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -235,6 +235,9 @@ }, renderChart(){ let yMax = ([...this.UpDownSta.data].sort())[this.UpDownSta.data.length-1]; + if(!yMax){ + yMax = 200; + } let interval = yMax / 5; // yMax = interval*6; let option = { @@ -249,7 +252,9 @@ // }, grid: { top: '12%', - bottom: '12%' + bottom: '12%', + left: '10%', + right: '5%' }, tooltip: {}, xAxis: { @@ -261,11 +266,12 @@ max: yMax, interval: interval }, - { - min: 0, - max: yMax, - interval: interval - }], + // { + // min: 0, + // max: yMax, + // interval: interval + // }, + ], series: [ { name: '', @@ -273,13 +279,13 @@ barMaxWidth: 30, data: this.UpDownSta.data }, - { - name: '', - type: 'line', - // data: [175, 180, 410, 208, 195, 330], - data: this.UpDownSta.data, - yAxisIndex: 1 - } + // { + // name: '', + // type: 'line', + // // data: [175, 180, 410, 208, 195, 330], + // data: this.UpDownSta.data, + // yAxisIndex: 1 + // } ] }; @@ -376,7 +382,7 @@ API.request('/adminStatistics/upAndDownStatistics', {type: type}, res=>{ this.UpDownSta = res.data; this.UpDownSta.xData = this.UpDownSta.histogram.map(item=>{ - return item.date; + return +item.date+'月'; }) this.UpDownSta.data = this.UpDownSta.histogram.map(item=>{ return item.value;