Using x2axis/y2axis to add a second axis is deprecated, but we
currently still support it. Historically we’ve just extended the first
axis’s options with the second’s, but that is a problem when the first
has min/max and the second doesn’t; it will inherit an inappropriate
min/max.
We might want to consider not extending at all, but since that’s a
bigger change we’ll for now just ensure that if no min/max is
specified, we respect that.
Fixes#1228.
Flot 0.8 still officially supports jQuery 1.2.6 and higher, so we can’t
assume the existence of detach. This will go away in 0.9, where the
minimum jQuery version is 1.4.4.
Fixes#1240.
Flot 0.8.0 used the default font size, typically derived from the
placeholder, as the basis for the default lineHeight. This produced
incorrect results when a font.size was provided explicitly, and it
differed from the placeholder’s CSS size.
Fixed by waiting to default lineHeight until the actual font size has
been resolved. Fixes#1131.
Flot 0.8 added logic to account for the size of axis tick labels and add
padding around the edges of the plot, to prevent long labels from
sticking out. But it padded both sides equally, which is incorrect if
the right/top side has no last axis label.
Fixed by allocating padding per-side, and checking whether the last
label would be shown before padding the top or right. Fixes#1048.
The fix for #1056 caused a regression where grid lines were drawn for
the innermost axes on both sides instead of just the first axis.
Fixed by properly distinguishing the first axis in each direction from
the innermost one on each side. Fixes#1075.
The autoscale check was too broad; it included the case where autoscale
was undefined. This resulted in axes not expanding correctly when
coordinates at the end of a series had null x or y values. Fixed by
narrowing the check to !== false; resolves#1095.
This is up to 2x faster and appears to work around issues in Chrome's
canvas implementation that sometimes result in bars not being filled.
Resolves#915.
Throwing an exception was overkill for such a limited-use option; we
should reserve those, and the file-size bytes they consume, for serious
cases only.
Support for right-aligned bars was never added to the hover or highlight
code; only the actual bar drawing. We need to replicate that in the
other two places as well.
Resolves#1093.
Since a plot may be redrawn after removing ticks or hiding the axis,
the tick text should always be removed before determining if there are
ticks to draw.
An axis is innermost when it's first among those not just in its
direction, but also on its side, i.e. left/right, of the plot. So the
inArray check should be against the samePosition list, not all.
Resolves#1056.
Resolves#1032. Previously it was impossible to draw the same text,
with the same style, in two different locations, because the second
would end up using the first's cache entry, which only ended up moving
the element to a new position.
Now each cache entry holds a list of positions at which the text
appears, creating clones of the original element for each position
beyond the first.
Flot 0.7 calculated x-axis label dimensions by assigning each label a
fixed width, then measuring the height as determined by the browser. A
side-effect of this technique is that x-axis label divs received a fixed
width. The rewrite of the text system in 0.8 accidentally removed this
feature; this patch restores it.
(Realted to flot issue #1031: https://github.com/flot/flot/issues/1031)
Currently, if the user declares a custom color palette with less than 5 colors (say, n), $.extend(true, options, opts) only modifies the first n colors of the default palette and leaves the last 5-n in place. When the number of series is >n, colors are used that are not part of user-defined palette, contrary to description of colors array in API.
This line overrides the extended colors array and replaces it with exactly the user-defined colors array, when present. Afterwards, the user color palette is respected by the auto tinting/shading system for when there are more series than colors.