diff --git a/NEWS.txt b/NEWS.txt index 343af64..e63b1d9 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -157,6 +157,8 @@ Bug fixes: - Fix for uneven axis margins (report and patch by Paul Kienzle) and snapping to ticks (concurrent report and patch by lifthrasiir). - Fixed bug with slicing in findNearbyItems (patch by zollman). +- Make heuristic for x axis label widths more dynamic (patch by + rickinhethuis). Flot 0.5 -------- diff --git a/jquery.flot.js b/jquery.flot.js index 0c716b2..9c47362 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -620,7 +620,7 @@ // them, we don't need the exact figures and the // fixed-size box content is easy to center if (axis.labelWidth == null) - axis.labelWidth = canvasWidth / 6; + axis.labelWidth = canvasWidth / (axis.ticks.length > 0 ? axis.ticks.length : 1); // measure x label heights if (axis.labelHeight == null) {