-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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(axisPointer): add triggerEmphasis
option to disable emphasis
#18524
Conversation
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me but it seems some of the tooltip-related test cases fail in the visual test.
@juliepagano Can you have a look?
Sure thing! The diff from "tooltip-axisPointer2" is from the case where |
I'm working with one of my teammates to get help with the Chinese translation, so I can put up a docs PR to go with this. Hoping I'll have that up some time today. |
Thank you for this high-quality pull request! |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
We ususally release a new version every two months. If you want to use this feature ASAP, you can use the nightly version ( |
triggerEmphasis
option to disable emphasis
Brief Information
This pull request is in the type of:
What does this PR do?
This PR adds a
triggerEmphasis
option to theaxisPointer
that enables the user to disable the emphasis/highlight behavior associated with the axis pointer.Fixed issues
Details
Before: What was the problem?
Prior to this PR, the axis pointer would always trigger highlight behavior. When you have a line chart with multiple series, the axis trigger tends to highlight all the series, which is often unhelpful and can be really confusing to users.
There is not a good way to work around this currently. You can see an example of some issues related to this in perses/perses#1112.
After: How does it behave after the fixing?
After this PR, the user has the option to disable this behavior on a given axis by setting
axisPointer.triggerEmphasis
tofalse
. When set tofalse
, the highlight/emphasis behavior will not trigger with the axis pointer. Other highlight/emphasis (e.g. on mouseover a specific line) is retained.The default value for
axisPointer.triggerEmphasis
istrue
when not set, retaining the prior behavior.Below is a screenshot of the
axisPointer.triggerEmphasis: false
visual test. You can see the diff is whether or not all the lines are highlighted. Note that it still retains highlight behavior on mousing over a particular line.Document Info
One of the following should be checked.
triggerEmphasis
option echarts-doc#343I'm happy to take a stab at making a PR to the docs once we're sure about the naming of the new option. I may need some help with the zh-based language bits. Let me know if you'd prefer I help with this or leave it to the maintainers.One of my teammates helped me with the translation, but it could use a second set of eyes to make sure we got it right.Misc
ZRender Changes
Related test cases or examples to use the new APIs
I added two test cases to
test/tooltip-axisPointer2.html
. One for thefalse
case and one for thetrue
case. Let me know if you think I should break this out into a separate test case, and if so, what you think the best name is for it.I added visual tests for each test case that take screenshots at the following points:
Others
Merging options
Other information
I was unsure of the best name for this configuration option. This behavior is referred to as
emphasis
in the configuration of the styling, but is referred to ashighlight
when triggering the event. I started withtriggerEmphasis
because I thought users might be more familiar with the styling configuration, but I can see arguments fortriggerHighlight
. I used thetrigger*
naming to match the similar-ishtriggerTooltip
option. I'm happy to rename it to whatever the maintainers think is best.