Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(treemap): label.show=false will throw error #15141

Merged
merged 5 commits into from
Jun 15, 2021

Conversation

susiwen8
Copy link
Contributor

@susiwen8 susiwen8 commented Jun 12, 2021

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

If treemap label is set to not show, then just return it

Fixed issues

Close #15140 15140

Details

Before: What was the problem?

Screen Shot 2021-06-12 at 9 59 31 PM

After: How is it fixed in this PR?

Screen Shot 2021-06-12 at 9 59 09 PM

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

NA.

Others

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Jun 12, 2021

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.

The pull request is marked to be PR: author is committer because you are a committer of this project.

@@ -979,6 +979,9 @@ function renderNode(
}
);

if (!isShow) {
Copy link
Contributor

Choose a reason for hiding this comment

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

textEl is also needed when label is set emphasis.show = true. Perhaps we can check if textEl is null in the next line instead of check if show on normal state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I missed that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pissang The reason is in labelStyle, a text element needs to be create should consider all four state, but in treemap, it only consider normal state.

Copy link
Contributor

Choose a reason for hiding this comment

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

@susiwen8 Year we need to check all four states. But it has been done in setLabelStyle. text element will be created if any state is set show: true. So I think we only need to check if rectEl.getTextContent() exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pissang Thx, You are right.

@pissang pissang merged commit ad31471 into apache:master Jun 15, 2021
@echarts-bot
Copy link

echarts-bot bot commented Jun 15, 2021

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

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.

treemap throws when series label set { show: false } property.
2 participants