Skip to content

fix(marker): respect markLine z2 for labels. close #21650#21674

Open
jesco-absolut wants to merge 1 commit into
apache:masterfrom
jesco-absolut:fix-21650-markline-label-z2
Open

fix(marker): respect markLine z2 for labels. close #21650#21674
jesco-absolut wants to merge 1 commit into
apache:masterfrom
jesco-absolut:fix-21650-markline-label-z2

Conversation

@jesco-absolut

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Makes markLine labels follow the same item z2 ordering as their corresponding markLine graphic.

Fixed issues

Details

Before: What was the problem?

markLine item z2 was applied to the line path, but the attached label received the default text-content z2 lift from traverseUpdateZ.

That meant a lower-z2 markLine label could still be rendered above a higher-z2 markLine. In the reported case, two markLines with different z2 values ordered their lines correctly, but their labels did not follow the same ordering.

After: How does it behave after the fixing?

traverseUpdateZ now supports a configurable label z2 lift while preserving the existing default behavior.

MarkerView uses a zero label lift for markLine, so the label keeps the same z2 ordering as the markLine item. markPoint and markArea keep the previous default label lift behavior.

A visual case was added to test/marker-z-z2.html where two overlapping markLines use z2: 1 and z2: 2; the blue z2: 2 line and label should render above the red z2: 1 label.

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

test/marker-z-z2.html

Merging options

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

Other information

Validation run locally:

  • npm run checktype
  • npm run build
  • npx eslint src/util/graphic.ts src/component/marker/MarkerView.ts
  • git diff --check

No dist/ files are included in this PR.

@echarts-bot

echarts-bot Bot commented Jul 4, 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