-
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: add new stacking strategies #17086
Conversation
Thanks for your contribution! The pull request is marked to be |
Docs for the proposed feature: apache/echarts-doc#255 |
@pissang let me know if you feel this should be implemented some other way so I can change the PR accordingly |
@villebro Thanks for the wonderful work! All looks good to me except a tiny code style issue. |
This could fix a lot of issues. I have added in PR description |
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?
This PR adds a new property
stackStrategy
to theSeriesStackOptionMixin
which defaults tosamesign
(current behavior). Associated PR on the docs repo: apache/echarts-doc#255Fixed issues
Details
Before: What was the problem?
Currently stacking is only applied if the cumulative sum has the same sign as the value to be stacked. This makes it impossible to mix positive and negative values in the same series, something typically needed when creating confidence bands:
After: How is it fixed in this PR?
Here we introduce the following new stacking options:
all
: stack all values, irrespective of the sign of the stackable value:positive
: only stack positive values:negative
: only stack negative values:We also add the strategy
samesign
which corresponds to the current behavior which we default to to avoid introducing a breaking change. However, I propose defaulting toall
in the next major version, as I assume this is the behavior users will expect to see.Misc
Related test cases or examples to use the new APIs
New test cases added to the
area-stack.html
test.Others
Merging options
Other information