Add the plot function as a chainable property.

Resolves #734 and #816.
pull/1/head
David Schnur 13 years ago
parent 78f2dfdf09
commit 49cce02be9

@ -2681,6 +2681,8 @@ Licensed under the MIT license.
}
}
// Add the plot function to the top level of the jQuery object
$.plot = function(placeholder, data, options) {
//var t0 = new Date();
var plot = new Plot($(placeholder), data, options, $.plot.plugins);
@ -2692,6 +2694,14 @@ Licensed under the MIT license.
$.plot.plugins = [];
// Also add the plot function as a chainable property
$.fn.plot = function(data, options) {
return this.each(function() {
$.plot(this, data, options);
});
}
// round to nearby lower multiple of base
function floorInBase(n, base) {
return base * Math.floor(n / base);

Loading…
Cancel
Save