Skip to content

feat: add overflow 'fit' property for text labels#21620

Open
utkarshhxd wants to merge 1 commit into
apache:masterfrom
utkarshhxd:test-label-overflow-fit
Open

feat: add overflow 'fit' property for text labels#21620
utkarshhxd wants to merge 1 commit into
apache:masterfrom
utkarshhxd:test-label-overflow-fit

Conversation

@utkarshhxd

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Adds a comprehensive visual test page for the proposed overflow: 'fit' text label behavior.

Fixed issues

Details

Before: What was the problem?

There was no visual test coverage for the proposed overflow: 'fit' label behavior across different ECharts rendering scenarios.

After: How does it behave after the fixing?

This PR adds test/label-overflow-fit.html to demonstrate and validate:

  • constrained-width label fitting
  • plain text rendering
  • rich text rendering
  • markPoint label fitting
  • Canvas vs SVG renderer behavior
  • dynamic resizing behavior
  • zero-width edge cases

Document Info

  • 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

Related test cases or examples to use the new APIs

Added test/label-overflow-fit.html.

Merging options

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

@echarts-bot echarts-bot Bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels May 18, 2026
@echarts-bot

echarts-bot Bot commented May 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.

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.

This PR depends on ZRender changes. Please update the ZRender dependency to the latest nightly version including this change, which takes place everyday at 8:00 UTC (16:00 Beijing Time).
You can use npm i zrender@npm:zrender-nightly@dev to update package.json.
If you have any question about this, please leave a comment and we will give you extra help on this.

@utkarshhxd utkarshhxd force-pushed the test-label-overflow-fit branch from 70f7035 to 25004df Compare May 18, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: awaiting doc Document changes is required for this PR. PR: awaiting review size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant