diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts index 0872d7b62a..8eacd4ca54 100644 --- a/src/chart/bar/PictorialBarView.ts +++ b/src/chart/bar/PictorialBarView.ts @@ -341,7 +341,11 @@ 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; + const isXAxis = valueDim.xy === 'x'; + const isInverse = valueAxis.inverse; + outputSymbolMeta.pxSign = (isXAxis && !isInverse) || (!isXAxis && isInverse) + ? boundingLength >= 0 ? 1 : -1 + : boundingLength > 0 ? 1 : -1; } function convertToCoordOnAxis(axis: Axis2D, value: number) { diff --git a/test/pictorial-zero-value.html b/test/pictorial-zero-value.html index 7a7b924895..aa42e541bb 100644 --- a/test/pictorial-zero-value.html +++ b/test/pictorial-zero-value.html @@ -1,3 +1,4 @@ + + - + + - - - + + + + - + + + -
+
+
+
- + + +