From a2925a4e007f848c4502ec1abeb02d13158bef0c Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 15 Jun 2023 10:44:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?NEZ-2877=20=20fix=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8D=95=E4=BD=8D=E4=B8=BAnone=E6=97=B6=20=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=95=B0=E6=8D=AEnull=E6=8A=A5=E9=94=99=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/chart/chartDataFormat.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nezha-fronted/src/components/chart/chartDataFormat.js b/nezha-fronted/src/components/chart/chartDataFormat.js index 0da95f87b..3509c7b2c 100644 --- a/nezha-fronted/src/components/chart/chartDataFormat.js +++ b/nezha-fronted/src/components/chart/chartDataFormat.js @@ -10,6 +10,9 @@ function none (value, index) { if (!numberWithEConvent(scientificNotationValue)) { return scientificNotationValue } + if (isNaN(value) || value=== null) { + return value + } return keepDoubleNumber(value) } function short (value, index, type = 1, dot) { From 1007414e61b1b0af1bb52cafed6a809860127454 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 15 Jun 2023 10:50:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=EF=BC=9A=E5=A4=84=E7=90=86chart-tooltip?= =?UTF-8?q?=20=E5=8D=95=E4=BD=8D=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=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/chart/chartDataFormat.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nezha-fronted/src/components/chart/chartDataFormat.js b/nezha-fronted/src/components/chart/chartDataFormat.js index 3509c7b2c..8e5b6315e 100644 --- a/nezha-fronted/src/components/chart/chartDataFormat.js +++ b/nezha-fronted/src/components/chart/chartDataFormat.js @@ -330,6 +330,9 @@ function numberWithEConvent (num) { return num } } + if (isNaN(num) || num === null) { + return num + } return 0 } /* @@ -340,6 +343,9 @@ function numberWithEConvent (num) { * dot:保留的小数位, * */ function asciiCompute (num, ascii, units, dot = 2) { + if (isNaN(num) || num === null) { + return num + } const scientificNotationValue = formatScientificNotation(num, dot) if (!numberWithEConvent(scientificNotationValue)) { return scientificNotationValue @@ -446,6 +452,9 @@ function timeCompute (value, unit, dot = 0) { } // 保留两位有效数字 function keepDoubleNumber (num) { + if (num === null) { + return num + } const decimal = num.toString() let returnNum = '' if (num == 0) { From ed052e4f077f63ae97ae12968c3cbaf14c88a98f Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 15 Jun 2023 11:43:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?NEZ-2688=20fix=EF=BC=9AExplore=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=BF=AB=E7=85=A7=E5=90=8E=E5=8D=95=E4=BD=8D=E6=9C=89?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/dashboard/explore/exploreItemHtml.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue index 7d90dc7fd..e09068a2a 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue @@ -3,7 +3,7 @@
{{dataJson.type == 1 ? 'Metric expression' : 'Log expression'}} - +
@@ -22,7 +22,7 @@