From bc065fd0cb9b4b2cf10e8f38e2df5d95329b731f Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 27 Aug 2024 18:26:06 +0800 Subject: [PATCH 1/3] test(pictorial): add test case when value is 0 --- test/pictorial-zero-value.html | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/test/pictorial-zero-value.html b/test/pictorial-zero-value.html index 49935bb2bb..7a7b924895 100644 --- a/test/pictorial-zero-value.html +++ b/test/pictorial-zero-value.html @@ -32,6 +32,7 @@
+
+ + + + From fd51f71d88344533934f2061167169f973231b4a Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 28 Aug 2024 14:41:09 +0800 Subject: [PATCH 2/3] fix(pictorialBar): symbol should not flip with zero data #20260 --- src/chart/bar/PictorialBarView.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts index c9460daac7..196ab078fb 100644 --- a/src/chart/bar/PictorialBarView.ts +++ b/src/chart/bar/PictorialBarView.ts @@ -278,6 +278,7 @@ function getSymbolMeta( hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), z2: itemModel.getShallow('z', true) || 0 } as SymbolMeta; + console.log(symbolMeta) prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); @@ -341,7 +342,7 @@ function prepareBarLength( // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero // and when borderWidth be settled, the actual linewidth will be NaN - outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1; + outputSymbolMeta.pxSign = boundingLength >= 0 ? 1 : -1; } function convertToCoordOnAxis(axis: Axis2D, value: number) { From 65ac3c3c9c433e117a27beed30ede63419e08208 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 28 Aug 2024 14:43:22 +0800 Subject: [PATCH 3/3] style(pictorialBar): remove console log --- src/chart/bar/PictorialBarView.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts index 196ab078fb..0872d7b62a 100644 --- a/src/chart/bar/PictorialBarView.ts +++ b/src/chart/bar/PictorialBarView.ts @@ -278,7 +278,6 @@ function getSymbolMeta( hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), z2: itemModel.getShallow('z', true) || 0 } as SymbolMeta; - console.log(symbolMeta) prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);