Commit Graph

344 Commits (80851c0dd7f33be323bc0df2cfb7b90edefcf3c5)

Author SHA1 Message Date
David Schnur 80851c0dd7 Merge pull request #1107 from trask/undefined-axis-options-fix
Handle undefined axisOptions in 0.9-work
13 years ago
Nick Schonning 7c52f44431 Convert remaining tabs to spaces 13 years ago
Nick Schonning 678ff275ba Enforce indenting with JSHint
- Doesn't differentiate between tabs and spaces
- Switch/Case indenting may seem odd to some
13 years ago
Trask Stalnaker 5e3ba78f6f Handle undefined axisOptions
I ran into this issue when upgrading from 0.8.1 to 0.9-work.
13 years ago
David Schnur 4d1042abf6 Rotate y-axis labels by 90 degrees.
The labels are rotated counter-clockwise for left axes and clockwise for
right axes.
13 years ago
David Schnur 6350cc6700 Added core support for rotated HTML text. 13 years ago
David Schnur 97f2a127ae Axes can now have basic horizontal text labels.
Labels are provided via a 'label' option on the axis, and can be styled
with the flot-axis-label class.  The labelFont option works similarly to
tickFont, as an override for the default font or the flot-axis-label
class.  The labelPadding option adds extra space between the axis and
its label.

Since most plots with axis labels currently use @markrcote's
flot-axislabels plugin, we also support the axisLabel and
axisLabelPadding options, and the axisLabels / axis[name]Label CSS
classes, to make it as easy as possible to transition from that plugin.
These are deprecated, and will be removed in 1.0.

The implementation uses the internal text API introduced in 0.8.
13 years ago
David Schnur 5209b8cd7f Inline legacyStyles; it wasn't reused anyway. 13 years ago
David Schnur f75a5a514f Updated axis option defaults and documentation.
Updated the axis option defaults and docs for tickColor, tickFont,
tickWidth, and tickHeight. Also re-organized the API docs to match the
master list, and revised many areas for clarity.
13 years ago
David Schnur 8d38774cac Added axis.tickFont as an override for axis.font. 13 years ago
David Schnur cfe16e1edb Rename labelWidth/Height to tickWidth/Height. 13 years ago
David Schnur b079efca0d Merge branch 'code-cleanup' into 0.9-work
Conflicts:
	jquery.flot.js
	jquery.flot.threshold.js
13 years ago
David Schnur bb18e099f1 Merge branch 'master' into 0.9-work 13 years ago
David Schnur bd191efb89 Fix further trailing and inconsistent whitespace. 13 years ago
David Schnur 797099867b Pull inline dependencies out into their own files.
We can inline the dependencies automatically as part of the build
process.
13 years ago
David Schnur ffcd71f416 Miscellaneous code cleanup. 13 years ago
David Schnur 3de9c0e99c Don't cache hasOwnProperty.
It's a little confusing, JSHint complains, and it doesn't make a big
difference anyway.
13 years ago
David Schnur 5c005f6b88 Wrap for...in loop bodies with hasOwnProperty. 13 years ago
David Schnur e0413b9308 Factor out duplicate variable definitions. 13 years ago
David Schnur f39c71fbc7 Remove unused variable definitions. 13 years ago
David Schnur 9fc03e5375 Switch to === and !== for safer equality testing. 13 years ago
David Schnur 1d4bee99fb Fix incorrect line termination. 13 years ago
David Schnur 49c312c36d Fix lines incorrectly broken before an operator. 13 years ago
David Schnur b8905be584 Fix mixed spaces and tabs. 13 years ago
David Schnur f24a67e752 Wrap one-statement if and for blocks in braces. 13 years ago
David Schnur 7efb3876fa Add missing semicolon. 13 years ago
David Schnur 05dfea7767 Convert single-quoted strings to double-quotes. 13 years ago
David Schnur 355331fd5f Merge tag '0.8.1' into 0.9-work 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 89ad298088 Replace ternary with a simpler or statement. 13 years ago
David Schnur b4258846b8 Merge pull request #1003 from djamshed/pointsStrokeColor 13 years ago
David Schnur 8722a99d9c Update version number to 0.9.0-alpha. 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