echarts
echarts copied to clipboard
feat(axis): support tooltip for axis label
Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [x] 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
- #11903
- #15299
- #16228
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
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 可以参考 PR 里附加的测试用例 test/axisLabel.html
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.
@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.
This is a very needed feature ! Thanks for your work.
Looking forward to seeing this feature merged in!
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-16315@33b9fdd
期待看到该功能的合并!