Commit Graph

348 Commits (1d3a062833593c1917462fb846f94215dfde52b1)

Author SHA1 Message Date
David Schnur 1d3a062833 Update copyright year to 2014. 12 years ago
David Schnur 51aea3463b Merge pull request #1284 from dnschnur/multi-axis-min-fix
Allow x2axis/y2axis with no min/max to auto-scale.
12 years ago
David Schnur 86f7ab1e48 Allow x2axis/y2axis with no min/max to auto-scale.
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.
12 years ago
David Schnur e17d379834 Provide a detach shim for jQuery prior to 1.4.
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.
12 years ago
David Schnur 4db2939f17 Fix poor wording / typo in comment. 12 years ago
David Schnur 739cefd539 Add sub-pixel adjustments to avoid blurry markings.
Fixes #1210.
12 years ago
David Schnur e4c035b37d Updated version number to 0.8.3-alpha. 12 years ago
David Schnur 39bc058b21 Fixed an error when plotting an empty dataset.
This was accidentally introduced by #1200; we can’t assume that
axis.ticks is an array.
13 years ago
David Schnur 00e93b6d46 Update version numbers to 0.8.2 final. 13 years ago
David Schnur 08d5bfadaa Merge pull request #1200 from dnschnur/xaxis-plot-size-fix
Don't add padding when there's no last tick.
13 years ago
David Schnur 968271a458 Merge pull request #1199 from dnschnur/line-height-default-fix
Default lineHeight based on the font size.
13 years ago
David Schnur 745d24cc79 Default lineHeight based on the font size.
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.
13 years ago
David Schnur 1650c18442 Don't add padding when there's no last tick.
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.
13 years ago
David Schnur edac9e0ed2 Distinguish between the first and innermost axis.
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.
13 years ago
David Schnur 7fa063e9ba Merge pull request #1130 from thgreasi/master
Added plot.destroy() method, to properly destruct and release memory of plots.
13 years ago
David Schnur 319f4dfe94 Apply fix from #1084 to the inline copy in jquery.flot.js. 13 years ago
Anthony Ryan eed38b8d4f :not(selector , selector) isn't actually a valid CSS selector
jQuery's Sizzle is the only thing that this actually works in so jQuery will fail when it passes this directly to querySelectorAll()
13 years ago
David Schnur c195e836fb Minor cleanup / optimization of font-size defaulting. 13 years ago
David Schnur fd1a02416a Merge pull request #1135 from coldford/master
Fixed a bug where plotting a chart crashes if the placeholder doesn't have a font size
13 years ago
David Schnur 4701726302 Additional style fixes on code merged from #1160. 13 years ago
David Schnur 6008cd7a1d Merge pull request #1160 from luisvsilva/master
Fixed Issue #1159 - Bug Redrawing Legend when using custom container
13 years ago
Benjamin Gram 6a9f71f70e fix label's maxWidth calculation 13 years ago
Luis Silva 91d254894d Added curly braces to match flot style guidelines 13 years ago
Luis Silva 3041b38d8d Fixed Issue #1159 - Bug Redrawing Legend when using custom container 13 years ago
Craig Oldford 593cbc5f19 Fixed a bug where plotting a chart crashes if the placeholder doesn't have a font size 13 years ago
Thodoris Greasidis 6f294cedf6 Added plot.destroy() method, to properly destruct and release memory of a plot. 13 years ago
Eric Byers bfc5d2ae7f Instantiating barLeft/barRight 13 years ago
David Schnur ce3bdb0886 Fixed autoscale check when using null x/y values.
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.
13 years ago
David Schnur e2b9cf8ce0 Remove the unused offset parameter.
The drawBar method was always called with an offset of zero, and I see
no other way in which it is currently used. Resolves #382.
13 years ago
David Schnur a286f044ef Draw bars using fillRect instead of paths.
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.
13 years ago
David Schnur 6a39c5ba11 Always simply default to center alignment.
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.
13 years ago
David Schnur 2ce1139cf7 Fix highlights for right-aligned bars.
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.
13 years ago
David Schnur df32626007 Added a comment for posterity. 13 years ago
Mark Côté 5a0372159a Always remove the tick text in drawAxisLabels() regardless of axis settings.
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.
13 years ago
David Schnur 1d4bee99fb Fix incorrect line termination. 13 years ago
David Schnur 7efb3876fa Add missing semicolon. 13 years ago
David Schnur 1f9e3ba730 Fix incorrect check for the innermost axis.
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.
13 years ago
David Schnur ed3f14897e Always set the axis innermost property.
It doesn't make sense to calculate the innermost property only when no
tickLength has been provided; the two have little to do with each other.
13 years ago
David Schnur 7f94a133f9 Updated version number to 0.8.2-alpha. 13 years ago
David Schnur 7f5f90384e Updated version number to 0.8.1 final. 13 years ago
David Schnur defe651617 Allow the same text in multiple locations.
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.
13 years ago
David Schnur 77a4b8647b Trigger an overlay refresh when drawing the plot.
Resolves #1030.  The performance impact should be low, and is the
correct thing to do in just about all cases where a plot is being
redrawn.
13 years ago
David Schnur 5fb61a92c8 Respect autoscale when nullifying points.
Resolves #1033.
13 years ago
David Schnur 571d86e936 Restore 0.7's maximum width for x-axis labels.
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.
13 years ago
David Schnur e8ef708494 Added a width parameter to control text wrapping.
The optional width parameter establishes a maximum width for the text's
bounding box, forcing it to wrap when it reaches that size.
13 years ago
David Schnur 7c6993e77b Fix a regression when no options are provided. 13 years ago
goorpy c20370ab57 Add comment and desired structure to colors patch
Per request from dnschnur (https://github.com/flot/flot/pull/1034#issuecomment-17119203), I have: 
- Added a comment explaining the purpose of the new check/override
- Changed the structure to match preferred standard structure
13 years ago
goorpy fccc8a6e21 Override colors array after extend in parseOptions
(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.
13 years ago
David Schnur e037f5ca56 Updated version number to 0.8.1-alpha. 13 years ago
David Schnur 0f83ac3d5c Fixed missing semicolons. 13 years ago