Skip to content

fix(axis): apply nameGap after overlap resolution when nameMoveOverlap enabled - #21837

Open
sidshas03 wants to merge 1 commit into
apache:masterfrom
sidshas03:fix/21834-nameGap-post-overlap-offset
Open

sidshas03 wants to merge 1 commit into
apache:masterfrom
sidshas03:fix/21834-nameGap-post-overlap-offset

Conversation

@sidshas03

@sidshas03 sidshas03 commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes: #21834
Problem with nameMoveOverlap on, nameGap was applied before the overlap move. So small nameGap values all gave the same position, and the name only moved when the gap was bigger than the labels. You couldn't set a fixed gap from the labels.

What I did in AxisBuilder.ts, when nameMoveOverlap is on, the name now starts with no gap. After the overlap move is done, I add nameGap in the same direction. So nameGap: 10 always means 10px past the labels. Negative nameGap is ignored in this mode so the name doesn't go back on the labels. With nameMoveOverlap off, nothing changes. I also updated the nameGap and nameMoveOverlap comments in axisCommonTypes.ts to match.

@echarts-bot

echarts-bot Bot commented Nov 12, 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.

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

@echarts-bot echarts-bot Bot added the PR: awaiting doc Document changes is required for this PR. label Nov 12, 2026
@echarts-bot

echarts-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

@echarts-bot echarts-bot Bot added PR: doc ready and removed PR: awaiting doc Document changes is required for this PR. labels Nov 12, 2026

This branch has not been deployed

No deployments
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.

[Feature] Support a post-overlap offset for axis names while keeping nameMoveOverlap enabled

1 participant