-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
explicit bar positioning and width #80
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
|
|
👍 for adding these attributes! |
👍 from me as well. With this I could correctly convert ggplot2's |
Is this feature implemented? |
@krishna-agarwal no. We close issues as soon as a feature is implemented (or a bug is fixed). |
@alexcjohnson I'm working on this issue and on #475. I wanted to check with you whether I understand This is how I understand it: if a trace sets either |
That's how I see it. 👍 |
@n-riesco I think it could be useful to treat the different aspects separately. So with In BUT it does seem like if you override the key attribute that's aggregated per trace ( |
@alexcjohnson If Here are a few more questions about the interactions with
Another question about |
great 👍
That's correct.
I'd vote for left-aligned. This is probably what most users would expect.
Yes, allowing overlap is fine. We shouldn't try to be too magical when users set
At the moment, data-referenced annotations on categorical axes are placed using their |
@n-riesco I agree with @etpinard on all points except
Most or all of the rest of the user-facing bar positioning is centered, so I'd keep it that way. |
While playing with mock images for this feature, I noticed that it's a bad idea to set Negative bar sizes are already an issue in At the moment plotly.js does nothing about negative bar sizes in |
It's true that this is in general ambiguous, though there are two reasons I think we should allow it:
|
done in #1075 |
Can i increase the bar widths with the x axis type as "date"? The idea is to have a single bar value (with large width) for multiple hours on time series. Right now i am doing it on the numerical values, but i want to implement it on time series. Please check and let me know what is best solution for this implementation. |
@AdnanBoota you might just need Plotly.newPlot(gd, [{
x: ['2017-01-02', '2017-01-03', '2017-01-04'],
y: [2, 4, 3],
type: 'bar'
}], {bargap: 0}) but if you really do need explicit widths on a date axis, you can specify them as milliseconds: Plotly.newPlot(gd, [{
x: ['2017-01-02', '2017-01-03', '2017-01-04'],
y: [2, 4, 3],
type: 'bar',
width: 1000*3600*23 // 23 hours
}]) |
@alexcjohnson Using the above code bar width is fixed, but tooltip is misplaced. |
@saimaparveen you can use |
Any plans to implement this same functionality for box type? It would provide a better workaround to do grouping for #78 and #2097 via explicit width and offset with boxmode 'overlay' since boxmode 'group' is not working with a second y-axis. The current workaround referenced in #78 still leaves a ghost trace and the group spacing shows a gap where the hidden trace is (between the yaxis and yaxis2 plot groupings), explicit offset and width could adjust them perfectly and without needing a 'dummy' trace... |
There are a number of use cases for explicit control over bar widths and positions (horizontal and vertical). I'm thinking about this in the context of waterfall plots, irregular-width bars but also times when the auto width is wrong (eg bar positions 1, 3, 5 and you want width 1, not width 2...), complex groupings (a stack of several traces, grouped with another stack of several other traces, etc).
If we allow explicit position and size, that covers every degree of freedom that exists for drawing bars on a plot. Then later we can peel off pieces with more meaning (like complex groupings that we should be able to describe in terms of grouping and stacking rather than positioning), and provide a simpler syntax for those.
I'm thinking of attributes:
Are
offset
andbase
clear enough? Any better names? And iswidth
OK even for horizontal bars (in which case it's really the bar height)?The text was updated successfully, but these errors were encountered: