From a4c2998ea8ce3951f5d39f9286d9be9b079506c9 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Wed, 17 Sep 2008 22:32:27 +0000 Subject: [PATCH] Fixed a bug with multi-line x-axis labels git-svn-id: https://flot.googlecode.com/svn/trunk@83 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 26 ++++++++++++++++++-------- TODO | 4 ---- jquery.flot.js | 6 +++--- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 526d33b..23805e8 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -6,18 +6,15 @@ Backwards API change summary: Timestamps are now in UTC. Also parameters for setSelection are now different (but backwards compatibility hooks are in place). + Interactivity: added a new "plothover" event and this and the "plotclick" event now returns the closest data item (based on patch by /david). See the revamped "interacting with the data" example for some hints on what you can do. -Timestamps in time mode are now displayed according to -UTC instead of the time zone of the visitor. This affects the way the -timestamps should be input; you'll probably have to offset the -timestamps according to your local time zone. It also affects any -custom date handling code (which basically now should use the -equivalent UTC date mehods, e.g. .setUTCMonth() instead of -.setMonth(). +Highlighting: you can now highlight points and points are +autohighlighted when you hover over them (if hovering is turned on). +Note: bars haven't been special-cased, yet. Support for dual axis has been added (based on patch by someone who's annoyed and /david). For each data series you can specify which axes @@ -27,6 +24,14 @@ customize. This affects the "selected" event which has been renamed to setSelection in which the parameters are on a new form (backwards compatible hooks are in place so old code shouldn't break). +Timestamps in time mode are now displayed according to +UTC instead of the time zone of the visitor. This affects the way the +timestamps should be input; you'll probably have to offset the +timestamps according to your local time zone. It also affects any +custom date handling code (which basically now should use the +equivalent UTC date mehods, e.g. .setUTCMonth() instead of +.setMonth(). + Added support for specifying the size of tick labels (axis.labelWidth, axis.labelHeight). Useful for specifying a max label size to keep multiple plots aligned. @@ -34,6 +39,10 @@ multiple plots aligned. The "fill" option can now be a number that specifies the opacity of the fill. +You can now specify a coordinate as null (like [2, null]) and Flot +will take the other coordinate into account when scaling the axes +(based on patch by joebno). + Using the "container" option in legend now overwrites the container element instead of just appending to it (fixes infinite legend bug, reported by several people, fix by Brad Dewey). @@ -45,7 +54,8 @@ Fixed a bug when borderWidth is set to 0 (reported by Rob/sanchothefat). Fixed a bug with drawing bars extending below 0 (reported by James Hewitt, convenient patch by Ryan Funduk). Fixed a bug with line widths of bars (reported by MikeM). Fixed a bug with -'nw' and 'sw' legend positions. +'nw' and 'sw' legend positions. Improved the handling of axis +auto-scaling with bars. Flot 0.4 diff --git a/TODO b/TODO index f58efdd..49bb53c 100644 --- a/TODO +++ b/TODO @@ -18,10 +18,6 @@ interactive zooming - auto-zoom mode? - auto-margins -support for highlighting stuff - - lines - - points - legend - interactive auto-highlight of graph? - ability to specify noRows instead of just noColumns diff --git a/jquery.flot.js b/jquery.flot.js index 8a72d15..92937a5 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -743,13 +743,13 @@ for (i = 0; i < axis.ticks.length; ++i) { l = axis.ticks[i].label; if (l) - labels.push('' + l + ''); + labels.push('
' + l + '
'); } axis.labelHeight = 0; if (labels.length > 0) { - var dummyDiv = $('
' - + labels.join("") + '
').appendTo(target); + var dummyDiv = $('
' + + labels.join("") + '
').appendTo(target); axis.labelHeight = dummyDiv.height(); dummyDiv.remove(); }