Skip to content

Stacked bar plot not stacking, sometimes just overlapping #627

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

Closed
timecrust opened this issue Jun 11, 2016 · 8 comments · Fixed by #716
Closed

Stacked bar plot not stacking, sometimes just overlapping #627

timecrust opened this issue Jun 11, 2016 · 8 comments · Fixed by #716
Assignees
Labels
bug something broken

Comments

@timecrust
Copy link

timecrust commented Jun 11, 2016

When generating a stacked bar plot some pieces of bar will not stack, but rather will remain down along the x-axis either overlapping another piece of the bar (of another series), or being hidden behind another piece of the bar.

This is what renders when all series are enabled:
image

Disabling just one series (the red one) alters the render to this, note that the green series has suddenly appeared from behind the purple series in the 4th bar, and the total for the 4th bar has jumped from 10 to 11.
image

Here's a codepen mock up showing the issue: http://codepen.io/anon/pen/EyPrxV, disable the red series to see that the green series in the 4th bar was initially not stacking and hidden behind the purple series.

I get this issue whether using 7 series (or more) as in the example, all the way down to 3 series. When using only 2 series the issue doesn't seem to arise.

@timecrust timecrust changed the title Stacked bar plot not stacking, sometimes just overlapping with many series Stacked bar plot not stacking, sometimes just overlapping Jun 11, 2016
@mdtusz
Copy link
Contributor

mdtusz commented Jun 13, 2016

Interesting - this seems to only be broken sometimes in your example, it appears to only be broken with the green group. It definitely is unexpected behaviour though. Thanks for reporting!

@imaloserbaby
Copy link

imaloserbaby commented Jun 24, 2016

Just started using plotly.js and am generally loving it, but this exact bug is killing me right now! The codepen example given by timecrust has more series than the 5 I consistently need, but I have series not stacking properly on all my stacked bar charts. Shame on me for not really staring at them closely enough before continuing to make 9 of them, but I'm having to maintain them all as grouped bar charts for the time being which is not ideal as I have gaps in my data frequently and the groupings are sparse to say the least.

The only observation I wanted to add that can hopefully help lead to a speedier resolution is that whether I have 4, 5, or 6 series (though I almost always have 5 in practice), the 4th series (4th trace added to the data array) is always a culprit. I say a culprit and not the culprit because, depending on the chart, I sometimes have 2 series not stacking properly, but in those cases one of the offending series is always the 4th.

Hope that can help in some way, cheers to all you guys for maintaining such an awesome library!

@etpinard
Copy link
Contributor

@imaloserbaby Thanks for writing in.

Could you try using an old version of plotly.js e.g. v1.5.0 (available at "https://cdn.plot.ly/plotly-1.5.0.min.js") and see if you get the desired behavior in your situation?

Finding out whether this issue is a regression or simply a previously-undiscovered bug would help us out tremendously. Thanks in advance!

@timecrust
Copy link
Author

@etpinard I can't speak for @imaloserbaby but using v1.5.0 worked for me and has completely removed the issue of the series not stacking, no matter the quantity of series. Thank you for the suggestion!

@imaloserbaby
Copy link

@etpinard after I confirmed that v1.5.0 did not contain this issue per your suggestion, I moved through the release versions incrementally and found that v1.10.2 was the last release that did not suffer this issue, and v1.11.0 was the first that did. From the release notes, there appear to have been several changes from v1.10.2 to v1.11.0 that might have caused this, the most suspicious of which is the fix of bar widths brought up in #542 and #372 where null coordinates are involved. Relative bar mode was also introduced in v1.11.0, which seems to be a less likely culprit. For the time being I will rely on v1.10.2. Thanks for the great efforts tackling these issues! Plotly.js is awesome!

@etpinard
Copy link
Contributor

etpinard commented Jul 4, 2016

@imaloserbaby amazing. This helps a lot. Thank you very much.

This issue will be fixed this week.

@etpinard etpinard self-assigned this Jul 4, 2016
@imaloserbaby
Copy link

@etpinard AWESOME. Thanks a ton!

@etpinard
Copy link
Contributor

etpinard commented Jul 4, 2016

Commit dd2251d is the problem.

Working on a fix now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants