From 230d6aebb0a9277ab827a9a886fed5544ad51799 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Thu, 23 May 2024 21:05:24 +0300 Subject: [PATCH 1/2] fix(bar): fix bar chart bars overflowing the coordinate system --- src/chart/bar/BarView.ts | 2 +- test/bar-clip.html | 89 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 test/bar-clip.html 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..49860e2944 --- /dev/null +++ b/test/bar-clip.html @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + From d13267baf78cd2830c7f097db2e5978af3125025 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Fri, 24 May 2024 00:33:27 +0300 Subject: [PATCH 2/2] add datazoom test --- test/bar-clip.html | 53 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/test/bar-clip.html b/test/bar-clip.html index 49860e2944..1ee8b1100e 100644 --- a/test/bar-clip.html +++ b/test/bar-clip.html @@ -40,6 +40,9 @@
+
+ + @@ -47,8 +50,6 @@ + + + + + +