-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix label's maxWidth calculation #1177
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
Conversation
Thank you very much for catching and patching this! |
fix label's maxWidth calculation
xaxis: { and Sorry David forgot to add the code. |
@donkeybrains Where are you using labelWidth? |
I believe I may have the wrong end of the stick thinking about the query. I was thinking the spaces for the axis text was constrained by an inherent label width. I don't use axis labels as my chart uses navigation. By using the time format I assumed inherent formatting always placed the time under the date without going down the tickformatter method. DB |
@donkeybrains No; the space for each label is based on the number of labels, unless overridden. You can enforce a line break by adding a |
Yes did that David and worked. Thanks for your help. Off topic I was in Santa Barabara last September, from where I am now in the wind and rain of the Brecon Beacons UK, my California sure calls to the heart. DB |
That's a little tight, but the labels are not actually overlapping. I think you've just hit an edge case where the length of each label is right at maxWidth. You can tweak this by setting tickLabels to a (smaller) integer value. |
@dnschnur, I cannot find any documentation about |
@kia84 Ah, sorry! That was a typo; I meant to write 'ticks'. |
@dnschnur, thanks for tip! timeformat: "%d.%m.%Y<br>%H:%M:%S" |
The check to assign maxWidth to labelWidth if it has a value is not properly computing. This should correct the line to what I assume is the intended behavior.
I ran into this being a problem when needing to specify a custom labelWidth as an option.