From b417a3f3b1bd629875c75c1c40d9e090ad14abe8 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 24 Sep 2020 14:49:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E5=B0=8F=E6=95=B0=E9=83=A8=E5=88=86=E7=9A=84=20Y?= =?UTF-8?q?=E8=BD=B4=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chartDataFormat.js | 3 ++- nezha-fronted/src/components/charts/line-chart-block.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js index 2d183d1fa..e89e917da 100644 --- a/nezha-fronted/src/components/charts/chartDataFormat.js +++ b/nezha-fronted/src/components/charts/chartDataFormat.js @@ -651,6 +651,7 @@ export default { value=value*10; console.log(value); } + console.log( Math.floor(value+1)/Math.pow(10,pow)); return Math.floor(value+1)/Math.pow(10,pow); } if(type ==='Time'){ @@ -711,7 +712,7 @@ export default { case 5: return 5; case 6: return 3; case 7: return 7; - case 8: return 8; + case 8: return 4; case 9: return 3; case 10: return 5; } diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index cec3ebdf1..aa36acaba 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -1688,7 +1688,7 @@ oldValue=oldValue*10; dot++; } - maxValue=Math.ceil(oldValue)/Math.pow(10,dot); + maxValue=Math.floor(oldValue)/Math.pow(10,dot); dot++; } let copies=chartDataFormat.copies(oldValue,unit.type);