Skip to content

Commit

Permalink
Merge pull request #20300 from apache/fix-pictorial-zero
Browse files Browse the repository at this point in the history
fix(pictorialBar): symbol should not flip with zero data
  • Loading branch information
Ovilia authored Sep 30, 2024
2 parents bb12cee + 65ac3c3 commit 869ec5e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/chart/bar/PictorialBarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,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) {
Expand Down
54 changes: 54 additions & 0 deletions test/pictorial-zero-value.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 869ec5e

Please sign in to comment.