-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Extra bar traces show up in stacked bar chart in relative barmode in >=1.48.0 #4047
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
This is the desirable behaviour in respect to #3797. |
Thanks, @archmoj for the response. This happens even if I set line width to 0, though: var trace2 = {
x: [1, 2, 3, 4],
y: [0, 0, 0, 16],
name: 'Trace2',
type: 'bar',
marker: {
color: 'hotpink',
line: {width: 0}
}
}; |
Also, if that is the desired behavior, then there is a problem that the behavior does not occur with certain plot dimensions, e.g. 700x700 in the example I linked above (note that this doesn't appear to just a a "square" thing, that's just the first set of dims I found) |
You may consider passing |
Okay, I can do that as a workaround. There's no way to pass 0 and not have a visible trace render, though? And per my previous comment, it seems that you actually may have a bug that's the exact opposite of what I originally reported (for certain plot dimensions) |
Also, looking at this a bit more, |
What about using color arrays there? |
Thanks for writing in @linusmarco ! This is a bug. We should not draw an outline when |
It is a little hard to see sometimes, but that pink line is clearly appended into the DOM Try var trace1 = {
x: [1, 2, 3, 4],
y: [1, -4, 0, 0],
name: 'Trace1',
type: 'bar',
marker: {
color: 'limegreen'
}
};
var trace2 = {
x: [1, 2, 3, 4],
y: [0, 0, 0, 16],
name: 'Trace2',
type: 'bar',
marker: {
color: 'hotpink'
}
};
var data = [trace1, trace2];
var layout = {
barmode: 'relative',
width: 700,
yaxis: {range: [-6, 20]},
height: 500
};
Plotly.newPlot('graph', data, layout, {showSendToCloud:true});
gd._fullData.map(t => t.marker.line.width)
// => [0, 0] |
@etpinard just to double check the |
We should not draw bars that have |
For stacked bar charts with barmode='relative', super-thin bar traces show up on the plot when the bar height should be zero:
https://codepen.io/anon/pen/xoZOxP
This bug was introduced in 1.48.0 it seems, as the plot renders as expected in 1.47.4:
https://codepen.io/anon/pen/dBBJxW
This issue occurs in Chrome and Edge. I have not tried FF, but given the nature of the bug (extra path elements), I imagine this will occur on any browser.
The text was updated successfully, but these errors were encountered: