Skip to content

Commit

Permalink
Merge pull request #19516 from apache/fix/mark-area
Browse files Browse the repository at this point in the history
fix(marker): fix markArea position when axis is with `alignWithLabel`
  • Loading branch information
plainheart authored Jan 16, 2024
2 parents 6cae00c + 3a056bd commit 53bb9ff
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 53bb9ff

Please sign in to comment.