Skip to content

fix(treemap): align rich bottom labels. close #17591#21704

Open
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:fix-17591-treemap-rich-label-position
Open

fix(treemap): align rich bottom labels. close #17591#21704
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:fix-17591-treemap-rich-label-position

Conversation

@rahul37wallst-sudo

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Corrects the alignment of rich treemap labels using insideBottom, insideBottomLeft, or insideBottomRight.

Fixed issues

Details

Before: What was the problem?

Treemap labels were always assigned the full available cell height. ZRender interprets an explicit height as the height of the entire rich-text block, so bottom-aligned rich labels kept their text tokens at the top of that block and appeared at the top of the treemap cell.

Plain-text labels were not affected in the same way.

After: How does it behave after the fixing?

Rich labels configured with insideBottom, insideBottomLeft, or insideBottomRight now use their natural content height and align correctly at the bottom of the treemap cell.

The change is intentionally limited to these three positions. Plain labels and rich labels at top or center positions retain their existing height constraints, minimizing unrelated visual changes.

Unit tests cover multiline labels with mixed rich and plain content, all three bottom positions, and compatibility controls for unaffected positions. A focused visual test case was also added.

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/treemap-label-position-rich.html
  • test/ut/spec/series/treemap.test.ts

Merging options

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

Other information

Validated with:

  • Focused Jest tests: 5 tests passed
  • npm run lint
  • npm run checktype
  • Local bundle build
  • SVG renderer validation confirming zero position difference between equivalent plain and rich bottom-aligned labels

@echarts-bot

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