Skip to content

Commit 3a056bd

Browse files
committed
fix(markArea): fix markArea position when axis is with alignWithLabel
Partially fix #18499 . The case when some ticks are skipped due to overlapping is not fully fixed.
1 parent 94dd855 commit 3a056bd

File tree

2 files changed

+309
-2
lines changed

2 files changed

+309
-2
lines changed

src/chart/bar/BaseBarSeries.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ class BaseBarSeriesModel<Opts extends BaseBarSeriesOption<unknown> = BaseBarSeri
101101
// If axis type is category, use tick coords instead
102102
if (axis.type === 'category' && dims != null) {
103103
const tickCoords = axis.getTicksCoords();
104+
const alignTicksWithLabel = axis.getTickModel().get('alignWithLabel');
104105

105106
let targetTickId = clampData[idx];
106107
// The index of rightmost tick of markArea is 1 larger than x1/y1 index
107108
const isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';
108-
if (isEnd) {
109+
if (isEnd && !alignTicksWithLabel) {
109110
targetTickId += 1;
110111
}
111112

test/markArea.html

Lines changed: 307 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)