-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make base of bars configurable #475
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
To clarify, do you mean so that all negative values stack below and all positive values stack above? |
Yes. That's what I'm thinking. |
Maybe we should also generalize the base level of the bars. Right now, positive values span above the zero line and negative values below it, but what if a user wants to plot bars on each side of |
Maybe
I don't like |
And we could use |
#517, didn't setup a 'barbase' type functionality, but properly provides a 'relative' barmode that behaves as described. |
barmode
Issue title changed to reflect |
[http://codepen.io/etpinard/pen/mPGLrY] It seems 'relative' does not work if the first index of y in trace2 is a negative value and the first index of y in trace1 is a positive value. |
@programflex thanks for reporting ➡️ #639 |
Hello, So with the first options values are not stacked like in the example: http://codepen.io/etpinard/pen/mPGLrY Like this: plot_ly(data = test_data, |
@etpinard @alexcjohnson I wanted to check with you a question about the current behaviour of bar charts when a trace contains very close bars. I've edited Étienne's codepen with an example. In this example the positions are If the barmode:
Is this the desired behaviour? |
@n-riesco that's a good question. This behavior comes from Lib.distinctVals:
Where the criterion for a rounding error is a difference less than So 1 and 2 in your example are right over the edge of that criterion. It's definitely an unintuitive result, though the plot is pretty darn useless just on the other side of that boundary (put in 1e4 for example), with a bunch of sub-pixel bars. But I guess when you zoom in it could become useful. We could change that cutoff to be smarter - tighter and/or with an explicit lower bound so integers never get marked the same? Mostly this cutoff is meant to match between different traces, in case their x values have slight rounding differences due to different calculation methods or something. |
@alexcjohnson I think we're looking at different issues:
In relative mode, the size of the first bar is 34, because the |
I see - thanks for clarifying. In fact the same thing happens with FYI what's actually happening in group mode currently is it's showing all the bars. Try |
* Fix: do not normalise bars with no size * Fix: update minDtick if barmode is group and bars overlap. Closes plotly#475
* Fix: do not normalise bars with no size * Fix: update minDtick if barmode is group and bars overlap. Closes plotly#475
done in #1075 |
so that positive and negative values can be stacked on each side of the zero line.
See current behavior of the each
barmode
here: http://codepen.io/etpinard/pen/mPGLrY?The text was updated successfully, but these errors were encountered: