fix(splitLine): fix chart throws errors when splitLine is enabled in radius axis.#16736
Conversation
|
Thanks for your contribution! The pull request is marked to be |
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
|
@plainheart @pissang Hi, good to see you've found a solution. Actually I have another thought about where the real problem is. At: Lines 311 to 313 in ad3a07a The statement is dealing with tickItem.coord without judging the sign of it. In the case of radius axis, ticksItem.coord is equal to shift/2, but a very tiny error is introduced by binary storage when executing tickItem.coord -= shift/2. This makes ticksItem.coord a negative value when the error is negative, and BOOM, the painter won't accept a negative radius. This is why #16731 is happening.The current solution only makes sure tickCoords.coord is positive when creating a new circle at: echarts/src/component/axis/RadiusAxisView.ts Lines 115 to 122 in c2f4ac6 But there are other places where tickCoords.coord is used like: echarts/src/component/axis/RadiusAxisView.ts Line 182 in c2f4ac6 echarts/src/component/axis/RadiusAxisView.ts Lines 186 to 194 in c2f4ac6 echarts/src/component/axis/RadiusAxisView.ts Line 197 in c2f4ac6 This can cause the same problem in the future. So my suggestion would be: Lines 311 to 313 in ad3a07a and makes it look like: Please tell me if I got anything wrong or unclear. |
|
@jiawulin001 So much thanks for your deep dig. I've mentioned a bit in the MR description what you are concerned about [1]. That's why I didn't apply the changes to other places. [1]
|
|
@plainheart Thanks for your explanation! Literally a lesson to me. |
Brief Information
This pull request is in the type of:
What does this PR do?
The chart throws errors when
splitLineis enabled in the radius axis, resolves #16731.Fixed issues
Details
Before: What was the problem?
It will throw illegal argument errors as zrender basic shape
Circledoesn't handle the value less than0, unlike theSectorshape, it normalizes such an unexpected radius value.After: How is it fixed in this PR?
Ensure the circle radius is non-negative in ECharts.
Comparison
Misc
Related test cases or examples to use the new APIs
Please refer to
test/splitLine.htmlOthers
Merging options
Other information