Commit a4c2998e authored by olau@iola.dk's avatar olau@iola.dk

Fixed a bug with multi-line x-axis labels

git-svn-id: https://flot.googlecode.com/svn/trunk@83 1e0a6537-2640-0410-bfb7-f154510ff394
parent de724cf7
...@@ -6,18 +6,15 @@ Backwards API change summary: Timestamps are now in UTC. Also ...@@ -6,18 +6,15 @@ Backwards API change summary: Timestamps are now in UTC. Also
parameters for setSelection are now different (but backwards parameters for setSelection are now different (but backwards
compatibility hooks are in place). compatibility hooks are in place).
Interactivity: added a new "plothover" event and this and the Interactivity: added a new "plothover" event and this and the
"plotclick" event now returns the closest data item (based on patch by "plotclick" event now returns the closest data item (based on patch by
/david). See the revamped "interacting with the data" example for /david). See the revamped "interacting with the data" example for
some hints on what you can do. some hints on what you can do.
Timestamps in time mode are now displayed according to Highlighting: you can now highlight points and points are
UTC instead of the time zone of the visitor. This affects the way the autohighlighted when you hover over them (if hovering is turned on).
timestamps should be input; you'll probably have to offset the Note: bars haven't been special-cased, yet.
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().
Support for dual axis has been added (based on patch by someone who's 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 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 ...@@ -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 setSelection in which the parameters are on a new form (backwards
compatible hooks are in place so old code shouldn't break). 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, Added support for specifying the size of tick labels (axis.labelWidth,
axis.labelHeight). Useful for specifying a max label size to keep axis.labelHeight). Useful for specifying a max label size to keep
multiple plots aligned. multiple plots aligned.
...@@ -34,6 +39,10 @@ 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" option can now be a number that specifies the opacity of
the fill. 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 Using the "container" option in legend now overwrites the container
element instead of just appending to it (fixes infinite legend bug, element instead of just appending to it (fixes infinite legend bug,
reported by several people, fix by Brad Dewey). reported by several people, fix by Brad Dewey).
...@@ -45,7 +54,8 @@ Fixed a bug when borderWidth is set to 0 (reported by ...@@ -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 Rob/sanchothefat). Fixed a bug with drawing bars extending below 0
(reported by James Hewitt, convenient patch by Ryan Funduk). Fixed a (reported by James Hewitt, convenient patch by Ryan Funduk). Fixed a
bug with line widths of bars (reported by MikeM). Fixed a bug with 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 Flot 0.4
......
...@@ -18,10 +18,6 @@ interactive zooming ...@@ -18,10 +18,6 @@ interactive zooming
- auto-zoom mode? - auto-zoom mode?
- auto-margins - auto-margins
support for highlighting stuff
- lines
- points
legend legend
- interactive auto-highlight of graph? - interactive auto-highlight of graph?
- ability to specify noRows instead of just noColumns - ability to specify noRows instead of just noColumns
......
...@@ -743,13 +743,13 @@ ...@@ -743,13 +743,13 @@
for (i = 0; i < axis.ticks.length; ++i) { for (i = 0; i < axis.ticks.length; ++i) {
l = axis.ticks[i].label; l = axis.ticks[i].label;
if (l) if (l)
labels.push('<span class="tickLabel" width="' + axis.labelWidth + '">' + l + '</span>'); labels.push('<div class="tickLabel" style="float:left;width:' + axis.labelWidth + 'px">' + l + '</div>');
} }
axis.labelHeight = 0; axis.labelHeight = 0;
if (labels.length > 0) { if (labels.length > 0) {
var dummyDiv = $('<div style="position:absolute;top:-10000px;font-size:smaller">' var dummyDiv = $('<div style="position:absolute;top:-10000px;width:10000px;font-size:smaller">'
+ labels.join("") + '</div>').appendTo(target); + labels.join("") + '<div style="clear:left"></div></div>').appendTo(target);
axis.labelHeight = dummyDiv.height(); axis.labelHeight = dummyDiv.height();
dummyDiv.remove(); dummyDiv.remove();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment