Commit Graph

930 Commits (ba4de812f50ff034d3c2aeabd80266a97438250e)
 

Author SHA1 Message Date
execjosh c8c67de8b7 Also stop at root when extracting CSS color
This change adds an additional check for whether the parent element
is `null` or `undefined` in `$.color.extract`.  This can happen when
working with elements that have not yet been added to the DOM under
`<body>`.

Consider the following example pie chart.

    var elm = $("<div />")
      .css({
        width: "240px"
      , height: "320px"
      })
    var data = [
      {label: "One", data: "33"}
    , {label: "Two", data: "33"}
    , {label: "Three", data: "33"}
    ]
    var opts = {
      legend: {
        show: true
      }
    , series: {
        pie: {
          show: true
        }
      }
    }
    $.plot(elm, data, opts)
    elm.appendTo($("body"))

When flot inserts each legend row, it tries to use the same color as
the corresponding graph part, unless it was explicitly specified in
the options.  However, in this example, `$.color.extract` runs into
an unexpected `null` reference because `<body>` is not an ancestor
of `elm`.  Specifically, a `TypeError: Cannot read property
'nodeName' of undefined` would be thrown.
13 years ago
David Schnur 6cd3cb9887 Prevent options from becoming global.
The pie plugin was a little too clever in its use of closures.  In
processDatapoints it set canvas, target, and options for use in other
functions.  Since options was not declared this meant that it became
global.  Pages containing multiple pie plots therefore saw a range of
weird effects resulting from earlier plots receiving some of the options
set by later ones.  Resolves #1128, resolves #1073, resolves #1055.
13 years ago
David Schnur 7deacc9ed1 Clip the pie center only when using offset auto.
If an explicit numeric offset was provided, we should not override it.
The clipping is only meant to apply to the case where the center is
moved to make room for the legend in 'auto' mode, anyway.
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
David Schnur 3951e0c472 Merge pull request #1127 from brianpeiris/patch-1
Link to PLUGINS.md
13 years ago
Thodoris Greasidis 6f294cedf6 Added plot.destroy() method, to properly destruct and release memory of a plot. 13 years ago
Brian Peiris 4bfa801e31 Link to PLUGINS.md 13 years ago
David Schnur 0360316eb5 Merge pull request #1120 from EricByers/master
Instantiate barLeft/barRight in Bar Highlighting Section
13 years ago
Eric Byers bfc5d2ae7f Instantiating barLeft/barRight 13 years ago
Trask Stalnaker a17be4c57e Highlight vertexes when no points
When series.points.show is false, currently a ring appears on highlight
around where the point would have been.  Instead, display the point on
highlight.
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 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 f42e4eddfd Merge pull request #1074 from cleroux/master
Fixing Issue 686: Tooltip bug
13 years ago
David Schnur fca41ad5cd Added BeWiBu to credits for the right-aligned bar fix. 13 years ago
David Schnur 6dfc581d27 Update inline jquery-resize to the latest version.
Resolves #997 and #1081.
13 years ago
David Schnur ef23fd401a Updated credits for right-aligned bar fix. 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 d94c1b75bc Updated credits for the flot-tickrotor fix. 13 years ago
David Schnur df32626007 Added a comment for posterity. 13 years ago
David Schnur 14651f7f79 Merge pull request #1091 from markrcote/master
Always remove the tick text in drawAxisLabels() regardless of axis settings
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 4318eeaed0 Merge pull request #1090 from dnschnur/axis-labels
Added axis labels and rotated text support.
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 81926d033d Merge pull request #1086 from dentarg/patch-2
Fix typo in API.md
13 years ago
David Schnur 32e9575080 Merge pull request #1085 from dentarg/patch-1
Change [olson] to http link
13 years ago
Patrik Ragnarsson 488fbc8df5 Fix typo in API.md 13 years ago
Patrik Ragnarsson 13cedbc897 Change [olson] to http link
GitHub doesn't render ftp links for some reason ([security?][1]).

[1]: https://github.com/mojombo/jekyll/issues/373#issuecomment-15025728
13 years ago
Cedric Le Roux caf1c7c9a5 Fixing Issue 686: Tooltip bug 13 years ago
David Schnur 65c38d0b59 Minor reordering of axis options. 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 1b29c62fe0 Tweak Travis test target to omit dependencies. 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 b074bde4aa Updated credits for API table of contents. 13 years ago
David Schnur a4c4163109 Merge pull request #1064 from brianpeiris/patch-1
Add table of contents
13 years ago
Brian Peiris 2b901841b2 Move TOC below main title and make it horizontal 13 years ago
Brian Peiris d777b2e795 Add table of contents
The reference document is quite large; a table of contents would help readers navigate and find topics. (TOC was generated via [DocToc](http://doctoc.herokuapp.com/))
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 13cbd2ce11 Updated credits for threshold above operator. 13 years ago