diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 54cc6ec72e..063870e51b 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -99,7 +99,7 @@ function getClipArea(coord: CoordSysOfBar, data: SeriesData) { // When boundaryGap is false or using time axis. bar may exceed the grid. // We should not clip this part. // See test/bar2.html - if (baseAxis.type !== 'category' || !baseAxis.onBand) { + if (baseAxis.type === 'category' && !baseAxis.onBand) { const expandWidth = data.getLayout('bandWidth'); if (baseAxis.isHorizontal()) { (coordSysClipArea as CartesianCoordArea).x -= expandWidth; diff --git a/test/bar-clip.html b/test/bar-clip.html new file mode 100644 index 0000000000..1ee8b1100e --- /dev/null +++ b/test/bar-clip.html @@ -0,0 +1,128 @@ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +