Skip to content

Conversation

@Justin-ZS
Copy link
Contributor

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix line area rendering issue when dataset dimension name is empty string.
截屏2025-08-22 16 51 00

Fixed issues

Details

Before: What was the problem?

When dataset.dimensions[].name is set to an empty string "", the line chart with areaStyle renders incorrectly.

Root cause: In getStackedOnPoints function, empty string dimension name fails truthiness check:

if (!dataCoordInfo.valueDim) {  // Empty string "" is falsy
    return [];
}

This causes the function to return empty stackedOnPoints array, breaking area rendering.

After: How does it behave after the fixing?

Changed the check to only reject null/undefined values:

if (dataCoordInfo.valueDim == null) {  // Only reject null/undefined
    return [];
}

Empty string dimension names are now treated as valid dimension names for area rendering.

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

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Others

Merging options

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

@echarts-bot
Copy link

echarts-bot bot commented Aug 22, 2025

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.

@Justin-ZS
Copy link
Contributor Author

@Ovilia Could you help to review the PR? Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21219@2e42179

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@Ovilia Ovilia merged commit be1028e into apache:master Sep 2, 2025
2 checks passed
@echarts-bot
Copy link

echarts-bot bot commented Sep 2, 2025

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@Ovilia Ovilia added this to the 6.0.1 milestone Sep 2, 2025
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.

2 participants