Skip to content

fix(marker): fix markArea position alignment when axis is inverse#21654

Open
Raman-Katiyar wants to merge 1 commit into
apache:masterfrom
Raman-Katiyar:fix/markarea-inverse-axis
Open

fix(marker): fix markArea position alignment when axis is inverse#21654
Raman-Katiyar wants to merge 1 commit into
apache:masterfrom
Raman-Katiyar:fix/markarea-inverse-axis

Conversation

@Raman-Katiyar

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixes the markArea positioning alignment bug when xAxis or yAxis category axis is set to inverse: true by refactoring the core to use axis.dataToCoord.

Fixed issues

Details

Before: What was the problem?

When inverse: true is set on category axes, the markArea bounding box misaligns or breaks completely because the old code hardcoded a manual index increment (targetTickId += 1) and a sequential coordinate scanning loop that assumed strictly ascending ticks.

After: How does it behave after the fixing?

The manual loops and hardcoded index shifting were refactored to use ECharts' core axis.dataToCoord mechanism. It seamlessly resolves the bounding coordinates for both regular and inverse category axis configurations accurately, keeping the markArea perfectly aligned.

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot

echarts-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant