Skip to content

fix(radar): respect axisName width and overflow#21676

Open
jesco-absolut wants to merge 1 commit into
apache:masterfrom
jesco-absolut:fix-14449-radar-axis-name-overflow
Open

fix(radar): respect axisName width and overflow#21676
jesco-absolut wants to merge 1 commit into
apache:masterfrom
jesco-absolut:fix-14449-radar-axis-name-overflow

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?

Allow radar indicator axis names to respect configured axisName.width and axisName.overflow instead of always using the internal truncate fallback.

Fixed issues

Details

Before: What was the problem?

Radar indicator names are rendered through the shared axis-name builder. That builder always passed overflow: 'truncate' and width: maxWidth as fixed style values for axis names, so user-provided radar axisName text style options such as:

radar: {
    axisName: {
        width: 50,
        overflow: 'break'
    }
}

were overwritten before reaching the ZRender text element. In an SSR reproduction, long radar indicator labels remained a single SVG <text> element even with width: 50 and overflow: 'break'.

After: How does it behave after the fixing?

Axis-name rendering now uses nameTextStyle / radar axisName overflow and width when they are provided, while preserving the existing truncate fallback when they are not. With width: 50 and overflow: 'break', the SSR output now emits multiple text lines for long radar indicator labels.

A focused visual case was added to test/radar-axis.html to cover long radar indicator names wrapping within 50px.

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/radar-axis.html

Merging options

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

Other information

Validation run locally:

  • npx eslint src/component/axis/AxisBuilder.ts
  • npm run checktype
  • git diff --check
  • npm run build:lib && npm run build

npm run build:lib && npm run build generated build outputs locally for validation only; generated files were reverted and are not 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