markrcote / flot-tickrotor

Flot plugin to display angled X-axis tick labels. This repo is unmaintained in part due to flot being in a similar situation.
23 stars 39 forks source link

issue with the latest flot from github #1

Open freeeve opened 12 years ago

freeeve commented 12 years ago

Using flot-tickrotor with the latest flot seems to give some undesirable results--too much space between the axis label and the graph, and the labels go off the canvas to the left. I'm using angles > 90. I tested with angles < 90 as well, and it seems less bad that way, but still goes off the edge to the right.

I've got a demo Monday and no time to work out what's wrong with the math, so I just hacked some extra offset calculations that worked for my particular rotation angle.

Anyway, just letting you know, in case you're still maintaining this. Thanks for a good starting point.

markrcote commented 12 years ago

Hi yup I'm stil maintaining this. Yeah the right-edge cut off with angles < 90 is a known bug. Haven't had time to investigate yet. The left edge should be fine though... are you using really long labels?

As for the distance between the labels and the graph, you can set grid.labelMargin to increase (or even decrease) the distance, although it will apply to all axes. It's hard to get the spacing right for all font sizes.

If you have an example, or even a screenshot, I might be able to help more.

freeeve commented 12 years ago

Yes, they're pretty long, and some are longer than others. That's another thing--it would be better if they would right justify so they're all flush up against the graph.

So this is what I got it to look like (I chopped off the bottom to keep some of the data private): Example after tweaking offsets

But this is what it started with before tweaking the axis widths and offsets in your code (note that it's not using the full height of the div, either, there was a bunch of white space below the labels): Example before tweaking offsets

markrcote commented 12 years ago

That's pretty fascinating. I'll try to reproduce it.