-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Comments
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! |
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! |
@imaloserbaby Thanks for writing in. Could you try using an old version of plotly.js e.g. Finding out whether this issue is a regression or simply a previously-undiscovered bug would help us out tremendously. Thanks in advance! |
@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! |
@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! |
@imaloserbaby amazing. This helps a lot. Thank you very much. This issue will be fixed this week. |
@etpinard AWESOME. Thanks a ton! |
Commit dd2251d is the problem. Working on a fix now. |
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:

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.

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.
The text was updated successfully, but these errors were encountered: