Skip to content

Conversation

benjamingram
Copy link
Contributor

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.

@ghost ghost assigned dnschnur Oct 30, 2013
@dnschnur
Copy link
Member

Thank you very much for catching and patching this!

dnschnur added a commit that referenced this pull request Oct 30, 2013
@dnschnur dnschnur merged commit 86c82e5 into flot:master Oct 30, 2013
@donkeybrains
Copy link

Hi David

I dont think this is fixed.

Have an axis problem with 0.8.2, what do you think?
flotaxisproblem

@donkeybrains
Copy link

xaxis: {
timeformat: '%y/%m/%d %H:%M', //on loaded
mode: "time",

and
minTickSize: [30, "minute"],
maxTickSize: [4, "hour"],

Sorry David forgot to add the code.

@dnschnur
Copy link
Member

dnschnur commented Jan 3, 2014

@donkeybrains Where are you using labelWidth?

@donkeybrains
Copy link

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

@dnschnur
Copy link
Member

dnschnur commented Jan 4, 2014

@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 <br> to your format string.

@donkeybrains
Copy link

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

@benjamingram benjamingram deleted the labelWidth_bug branch January 31, 2014 18:14
@korun
Copy link

korun commented Apr 4, 2014

Hello!
It seems I have this problem. :(
screenshot0002

graph_options =
  series:
    lines:
      show: true
    points:
      show: true
  legend:
    container: '#graph_labels'
  xaxis:
    mode: "time"
    timeformat: "%d.%m.%Y %H:%M:%S"
    timezone: "Europe/Moscow"
    autoscaleMargin: 0.01
    tickLength: 10 # px
  grid:
    hoverable: true
    autoHighlight: true

@dnschnur
Copy link
Member

dnschnur commented Apr 4, 2014

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.

@korun
Copy link

korun commented Apr 7, 2014

@dnschnur, I cannot find any documentation about tickLabels property. 😕

@dnschnur
Copy link
Member

dnschnur commented Apr 7, 2014

@kia84 Ah, sorry! That was a typo; I meant to write 'ticks'.

@korun
Copy link

korun commented Apr 8, 2014

@dnschnur, thanks for tip!
But now, I force a line break, and it worked. O_o

timeformat: "%d.%m.%Y<br>%H:%M:%S"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants