-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[BUG] labelOffset not working for vertical axis #3889
Comments
That looks like some kind of bug, but I'm not sure which is wrong: the docs or the code. |
is there a use case for the I feel if you "offset" labels on the data, it disrupts the integrity of the dataset. Unless the axis, and the data offsets with the label. May not be important for this particular jsfiddle but for numerical charts (x,y) if you want to look up data. It becomes confusing for the user. Just something to think about. |
It's necessary if you want to have the labels parallel to the y axis, but center the labels at the ticks.
For catergorial data (or range in general) on one axis centering labels between ticks makes sense without hurting integrity. Maybe makes more sense for a bubble-like chart. As far as i know offsetGridLines is not available for bubble charts or line charts. |
@dekuenstle ah great points. I guess for categorial data, there is some room some adjustments (like in your example). Do you mind including a link to your bubble example ? It would really help for identifying a good solution for this issue. |
@Jareechang here's a simplified example how to a abuse bubble chart for categorial data: http://codepen.io/anon/pen/bgJPMx Still the issue isn't just about my usecase, but about the inconsistency between docu, x-axis behaviour and y-axis non-behaviour. |
@dekuenstle You can acquire the same result as labelOffset with some padding, tickMarkLength and ticks.mirror = true.
And yes, I agree with you on everything you have said - could be nice with the (x,y) offset options. |
@MathiasHC Thank you! We currently worked around the issue with similar configs and some whitespace ;) |
Expected Behavior
In the docs
labelOffset
is described as:From the docs, I expect the label to move left/right if I set a non-zero value for labelOffset of a vertical axis, and up-down for a horizontal axis.
Just from the variable name I would expect opposite behaviour:
Current Behavior
Label is moving left/right on horizontal axis and not at all on a vertical axis.
Possible Solution
optionTicks.labelOffset
tolabelY
in core.scale.js'sdraw
-method.Steps to Reproduce (for bugs)
See http://codepen.io/anon/pen/JEmaBY
Context
We tried to to accomplish labels between the tick lines in a bubble chart.
The labels of the vertical axis were rotated by 90° (text parallel to y-axis)
Environment
The text was updated successfully, but these errors were encountered: