-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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(axis):null value item on category axis should be able to show tooltip #20777
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
@Justin-ZS Thanks for the contribution and sorry for the late reply. I'll review it now. 😄 |
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20777@d0334da |
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.
When category value is null
or undefined
when not using dataset, it's considered as a string 'null'
and 'undefined'
so I think maybe it's best to align this behavior to this?
option = {
xAxis: {
type: 'category',
data: ['Mon', null, undefined, 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}
]
};
The result of this PR is an empty string as category value now.
I actually prefer the current behavior of Changing it could lead to unexpected issues when users upgrade to a new version. |
Thanks for your feedback. @plainheart @100pah What do you think about this? |
Brief Information
This pull request is in the type of:
What does this PR do?
If the chart uses
dataset/axis.encode
, the null value items on category axis cannot trigger axis tooltip.(NG)Try demo
echarts/src/scale/Ordinal.ts
Lines 143 to 147 in b5c4a66
This check will ignore
null
value items on category axis, althoughnull
is a valid value.But if the chart uses
axis.data
, the null value items on category axis can trigger axis tooltip.In this case, the
axis.data
will be parsed bygetName
--null
becomes"null"
.echarts/src/data/OrdinalMeta.ts
Lines 50 to 61 in b5c4a66
Fixed issues
#20774
Details
Before: What was the problem?
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information