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

feat(axis): support tooltip for axis label. #16315

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

plainheart
Copy link
Member

@plainheart plainheart commented Jan 4, 2022

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Support tooltip for the axis label. It's useful for the case in which the axis label is truncated for long text and hope to show the full text when hovering on the label.

Fixed issues

Details

Before: What was the problem?

No tooltip for showing the full text of a truncated axis label. The developer has to simulate a tooltip via listening to the mouse event like https://codepen.io/plainheart/pen/jOGBrmJ.

After: How is it fixed in this PR?

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

Please refer to the last test case in test/axisLabel.html.

Others

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Jan 4, 2022

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.

@Thj007
Copy link

Thj007 commented Jul 17, 2022

怎么使用呢?

@plainheart
Copy link
Member Author

@Thj007 可以参考 PR 里附加的测试用例 test/axisLabel.html

@Ovilia Ovilia modified the milestones: 5.4, 5.4.1 Sep 1, 2022
Ovilia
Ovilia previously approved these changes Sep 2, 2022
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.

Tried with the test case and it looks cool. LGTM

@echarts-bot
Copy link

echarts-bot bot commented Sep 2, 2022

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

@Ovilia
Copy link
Contributor

Ovilia commented Sep 2, 2022

@pissang Please double-click this PR.

@plainheart I think a new option is probably required? Please check the "The API has been changed" and prepare the document later.

@Ovilia Ovilia requested a review from 100pah September 22, 2022 09:59
el: textEl,
componentModel: axisModel,
itemName: formattedLabel,
formatterParamsExtra: {
Copy link
Member Author

@plainheart plainheart Oct 8, 2022

Choose a reason for hiding this comment

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

I'm thinking if there is some simple way to allow the developer to detect if the label is overflowed and ellipsised to decide whether to show the tooltip and the content to show.

@plainheart plainheart added the discussion-required Further discussion is required before we decide if this issue should be fixed. label Oct 14, 2022
@plainheart plainheart modified the milestones: 5.4.1, 5.5.0 Nov 10, 2022
@plainheart plainheart modified the milestones: 5.5.0, TBD Feb 25, 2023
@ghost
Copy link

ghost commented May 12, 2023

This is a very needed feature ! Thanks for your work.

@2nPlusOne
Copy link

Looking forward to seeing this feature merged in!

Copy link
Contributor

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

@plainheart plainheart modified the milestones: TBD, 5.5.1 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-required Further discussion is required before we decide if this issue should be fixed. PR: author is committer PR: awaiting review size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] xAxis or yAxis tooltip x-axis Data label
5 participants