-
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
fix(line): 过滤空节点, 避免阶梯线条变为斜线 #16435
fix(line): 过滤空节点, 避免阶梯线条变为斜线 #16435
Conversation
Thanks for your contribution! |
The code looks good to me now. Could you add a test case |
src/chart/line/LineView.ts
Outdated
pt[1] = points[i + 1]; | ||
stepPoints.push(pt[0], pt[1]); | ||
} | ||
if (!isNaN(points[i + 2]) && !isNaN(points[i + 3])) { |
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.
Seems it may not work when there are multiple consecutive NaN values. And handling these consecutive NaN values may be too complex and easy to bring bugs.
Perhaps the original filter logic is simpler and more robust. Sorry for the wrong suggestion.
But still the variable name points_
should be renamed to some others without underline, like newPoints
.
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.
Haha, OK, I have fixed this problem. And I also make it filter null points only when using connectNull: true.
Please review the code again,Thanks~
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
fix that connectNulls with stepLine fails when after a long number of null entries occur
Fixed issues
#16424
Details
option:
Before: What was the problem?
After: How is it fixed in this PR?
Misc
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information