Skip to content

Commit

Permalink
fix(markArea): fix markArea position when axis is with alignWithLabel
Browse files Browse the repository at this point in the history
Partially fix #18499 . The case when some ticks are skipped due to
overlapping is not fully fixed.
  • Loading branch information
Ovilia committed Jan 16, 2024
1 parent 94dd855 commit 3a056bd
Show file tree
Hide file tree
Showing 2 changed files with 309 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/chart/bar/BaseBarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ class BaseBarSeriesModel<Opts extends BaseBarSeriesOption<unknown> = 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;
}

Expand Down
308 changes: 307 additions & 1 deletion test/markArea.html

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

0 comments on commit 3a056bd

Please sign in to comment.