Commit Graph

331 Commits (65cba843510a8486cbacc1658e25e0f1ecbf3efd)

Author SHA1 Message Date
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
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
David Schnur bad589c0a7 Update version number to 0.8.0 final. 13 years ago
David Schnur 209fe5336a Always recalculate tickDecimals and tickSize.
Resolves #1000.  In Flot 0.7 we only calculated tickDecimals and
tickSize once, when creating the tickGenerator for the first time.  This
meant that calls to setupGrid failed to recalculate the values, as
reported in #860.  #861 fixed the problem by moving calculation into
tickGenerator, but this turned out to cause a new problem, since the
function doesn't run when an explicit ticks array is provided.

This commit solves both by always recalculating the values outside of
the tickGenerator function.  As far as I can tell the only reason it
wasn't done this way from the beginning was to avoid unnecessary work in
the case where tickGenerator is already provided in the options.  But
the extra work is negligible, and it's actually more consistent for the
properties to always be set.
13 years ago
David Schnur aefe4e729b Round text coordinates consistently.
The core implementation used parseInt, which was originally to catch
text values, but really only stayed due to its side-effect of flooring
the values.  The canvas implementation has never rounded coordinates.
This led to various one-pixel rendering glitches between the two
implementations.  I've fixed the problem by consistently rounding
coordinates to the nearest whole number.
13 years ago
David Schnur bceb4bfca2 Added lineHeight to the font-spec object.
Line height is a core font property - it can be specified as part of the
unified 'font' definition - and we therefore need to give users access
to it when they're manually defining the font.
13 years ago
David Schnur 55e671b795 Fix incorrect default for xaxes/yaxes tickColor.
The way in which xaxes/yaxes inherit options from xaxis/yaxis resulted
in a minor bug, where tickColor defaulted to the xaxis/yaxis color
instead of the color for its axis.  Fixed by applying the default before
extending the per-axis options, resolving #984.

There's still some questionable behavior here; this section should be
revisited for 0.9, especially with an eye towards removing some of the
code that only exists for backwards-compatibility.
13 years ago
David Schnur 4e8d8535e0 Move time-specific options into the time plugin. 13 years ago
David Schnur df0875e549 Replace the stylesheet hack with inline styles.
The purpose of the stylesheet hack was to provide a default without
having to use inline styles on containers.  We can do this much more
neatly by instead just giving the inline styles to a parent container,
leaving users free to customize the children.
13 years ago
David Schnur 5741f26756 Short-circuit when removing all highlights.
There's no need to continue in the function when all highlights are
being cleared.
13 years ago
David Schnur eee071c47d Fix highlight and unhighlight inconsistency.
The unhighlight method retrieved the point differently from highlight,
and incorrectly.  It now matches the behavior of highlight.
13 years ago
David Schnur aeddf4e385 Avoid an unnecessary intermediate variable. 13 years ago
David Schnur 4e9c0c0b53 Ensure that axis lines align with their ticks.
Add an extra pixel to ensure that the lines cleanly join both top and
bottom ticks.  Also apply the sub-pixel offset only in the necessary
direction, so the lines don't start a pixel off from where they should.
13 years ago
David Schnur 0594a49158 Update version number to 0.8.0-beta. 13 years ago
David Schnur 3cd7a51026 Axis and tick color options now make more sense.
The axis color now controls the color of the axis line, instead of its
ticks and labels, while the tickColor controls the tick color. This
makes a little more sense and provides the minor feature of being able
to change the axis line color separately from that of its ticks.  Pull
request #917 ought to be easier to merge now, too.
13 years ago
David Schnur a0b05a4bab Switch to semantic versioning. 13 years ago
David Schnur 53ce9ad123 Move canvas reuse up into the Canvas constructor.
This allows us to reuse the canvas elements without having to retain the
rest of the Canvas object, which should really be reset when the plot is
reconstructed.  It's also a little simpler, and the Canvas constructor
just feels like the right place for this code.
13 years ago
martinqt 1e6c45bd95 Update js files 13 years ago
David Schnur 60ed6b2963 Merge pull request #935 from dnschnur/canvas-text
Moved canvas text support into a plugin.
13 years ago