diff --git a/src/chart/bar/BaseBarSeries.ts b/src/chart/bar/BaseBarSeries.ts index 0fe8944e62..caebce271e 100644 --- a/src/chart/bar/BaseBarSeries.ts +++ b/src/chart/bar/BaseBarSeries.ts @@ -101,11 +101,12 @@ class BaseBarSeriesModel = BaseBarSeri // If axis type is category, use tick coords instead if (axis.type === 'category' && dims != null) { const tickCoords = axis.getTicksCoords(); + const alignTicksWithLabel = axis.getTickModel().get('alignWithLabel'); let targetTickId = clampData[idx]; // The index of rightmost tick of markArea is 1 larger than x1/y1 index const isEnd = dims[idx] === 'x1' || dims[idx] === 'y1'; - if (isEnd) { + if (isEnd && !alignTicksWithLabel) { targetTickId += 1; } diff --git a/test/markArea.html b/test/markArea.html index d19744c8e7..0c26bccec7 100644 --- a/test/markArea.html +++ b/test/markArea.html @@ -28,6 +28,8 @@
+
+
+ +