From 5d1bcb8486aff39165d4e9deb5fea234946bcfa2 Mon Sep 17 00:00:00 2001 From: junjun Date: Fri, 10 May 2024 10:20:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=90=8C=E7=8E=AF=E6=AF=94=E5=B7=AE=E5=80=BC=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E5=88=86=E6=AF=8D=E6=B2=A1=E5=8F=96=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/dataease/chart/manage/ChartDataManage.java | 2 +- .../components/editor/drag-item/components/CompareEdit.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 0a41ee598c..75e497d44a 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -673,7 +673,7 @@ public class ChartDataManage { item[dataIndex] = null; } else { item[dataIndex] = new BigDecimal(cValue) - .divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP) + .divide(new BigDecimal(lastValue).abs(), 8, RoundingMode.HALF_UP) .subtract(new BigDecimal(1)) .setScale(8, RoundingMode.HALF_UP) .toString(); diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue index f56b7e9911..1a89cd4db9 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue @@ -145,7 +145,7 @@ initCompareType() >本期数据 - 上期数据 (本期数据 / 上期数据 - 1) * 100%(本期数据 / |上期数据| - 1) * 100%