-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Stacked area charts not stacking #1552
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
Comments
It sort of makes weird sense as the order at each x-value follows the order it occurs in in the data. I would suggest we add a sorting step to @hadley thoughts? It might change the appearance of some plots, though I would argue that the benefit of the bug fix and sorting would alleviate that... |
I like the idea of matching the stacking order to the legend order. That would also help with #1593 |
It would not be bulletproof, i.e. it is only possible to match the stacking to the default legend order and not to any modified order defined in scale_*, that is, we can sort only by the data itself as position doesn't have access to the scale object... |
Oh that's true - and it would mean that to change the stacking order you'd be forced to change the levels of a factor. Hmmm. |
I think this is reasonable. If well documented it is not too much to ask that they reorder factor levels to achieve their desired stacking... |
When I try to create a stacked area chart using the following code the segments don't stack, and they occlude each other instead.
However if I reorder the rows so all of the
var
values are grouped together, it does create a stacked chart:Is this a bug, or is the ordering of the rows meant to matter like this?
The text was updated successfully, but these errors were encountered: