From bc43f04c1a4b28f99afd0b2cb6ad08e9e3f0e88e Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Wed, 2 Sep 2020 18:36:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dline-chart=20=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=87=8D=E5=A4=8D=E8=AE=A1=E7=AE=97=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 1 + nezha-fronted/src/components/charts/line-chart-block.vue | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index fc6dfc3e4..1b4aba928 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -849,6 +849,7 @@ startTime = this.filter.start_time; endTime = this.filter.end_time; } + let step = bus.getStep(startTime, endTime); this.$nextTick(() => { const axiosArr = chartItem.elements.map((ele) => { diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index f22c10b73..5aeeb8f3c 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -539,7 +539,7 @@ let tip=legend[item.seriesIndex]; let color = self.bgColorList[item.seriesIndex]; if(i===0){ - let value=bus.computeTimezone(item.data[0]); + let value=item.data[0]; let t_date = new Date(value); str += [t_date.getFullYear(), t_date.getMonth() + 1, t_date.getDate()].join('-') + " " + [t_date.getHours(), t_date.getMinutes(),t_date.getSeconds()].join(':'); @@ -640,7 +640,7 @@ show:true, fontSize: 10, formatter: function (value) { - value = bus.computeTimezone(value); + value = value; let t_date = new Date(value); let hour = t_date.getHours(); hour=hour>9?hour:"0"+hour; //加0补充为两位数字 @@ -793,7 +793,7 @@ params.forEach((item, i) => {let tip=legend[item.seriesIndex]; let color = self.bgColorList[item.seriesIndex]; if(i===0){ - let value=bus.computeTimezone(item.data[0]); + let value=item.data[0]; let t_date = new Date(value); str += [t_date.getFullYear(), t_date.getMonth() + 1, t_date.getDate()].join('-') + " " + [t_date.getHours(), t_date.getMinutes(),t_date.getSeconds()].join(':'); @@ -926,7 +926,7 @@ params.forEach((item, i) => {let tip=legend[item.seriesIndex]; let color = self.bgColorList[item.seriesIndex]; if(i===0){ - let value=bus.computeTimezone(item.data[0]); + let value=item.data[0]; let t_date = new Date(value); str += [t_date.getFullYear(), t_date.getMonth() + 1, t_date.getDate()].join('-') + " " + [t_date.getHours(), t_date.getMinutes(),t_date.getSeconds()].join(':');