Commit 7043573a authored by David Schnur's avatar David Schnur

Merge branch 'master' into 0.9-work

Conflicts:
	NEWS.md
	component.json
	flot.jquery.json
	jquery.flot.canvas.js
	jquery.flot.fillbetween.js
	jquery.flot.pie.js
	jquery.flot.time.js
	package.json
	src/jquery.flot.js
	src/plugins/jquery.flot.crosshair.js
	src/plugins/jquery.flot.navigate.js
	src/plugins/jquery.flot.resize.js
parents f2b3b266 453b017c
Copyright (c) 2007-2013 IOLA and Ole Laursen
Copyright (c) 2007-2014 IOLA and Ole Laursen
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
......
......@@ -10,6 +10,54 @@
by Jason Swank, issue #331, and Rene Pieter Kok, issue #344)
## Flot 0.8.3 ##
### Changes ###
- Updated example code to avoid encouraging unnecessary re-plots.
(patch by soenter, pull request #1221)
### Bug fixes ###
- Added a work-around to disable the allocation of extra space for first and
last axis ticks, allowing plots to span the full width of their container.
A proper solution for this bug will be implemented in the 0.9 release.
(reported by Josh Pigford and andig, issue #1212, pull request #1290)
- Fixed a regression introduced in 0.8.1, where the last tick label would
sometimes wrap rather than extending the plot's offset to create space.
(reported by Elite Gamer, issue #1283)
- Fixed a regression introduced in 0.8.2, where the resize plugin would use
unexpectedly high amounts of CPU even when idle.
(reported by tommie, issue #1277, pull request #1289)
- Fixed the selection example to work with jQuery 1.9.x and later.
(reported by EGLadona and dmfalke, issue #1250, pull request #1285)
- Added a detach shim to fix support for jQuery versions earlier than 1.4.x.
(reported by ngavard, issue #1240, pull request #1286)
- Fixed a rare 'Uncaught TypeError' when using the resize plugin in IE 7/8.
(reported by tleish, issue #1265, pull request #1289)
- Fixed zoom constraints to apply only in the direction of the zoom.
(patch by Neil Katin, issue #1204, pull request #1205)
- Markings lines are no longer blurry when drawn on pixel boundaries.
(reported by btccointicker and Rouillard, issue #1210)
- Don't discard original pie data-series values when combining slices.
(patch by Phil Tsarik, pull request #1238)
- Fixed broken auto-scale behavior when using deprecated [x|y]2axis options.
(reported by jorese, issue #1228, pull request #1284)
- Exposed the dateGenerator function on the plot object, as it used to be
before time-mode was moved into a separate plugin.
(patch by Paolo Valleri, pull request #1028)
## Flot 0.8.2 ##
### Changes ###
......
......@@ -167,7 +167,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -81,7 +81,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -91,7 +91,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -71,7 +71,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -108,7 +108,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -131,7 +131,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -85,7 +85,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -51,7 +51,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -69,7 +69,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -53,7 +53,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -63,7 +63,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -112,7 +112,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -147,7 +147,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -73,7 +73,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -116,7 +116,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -39,7 +39,7 @@
maxWidth: 900,
maxHeight: 500,
minWidth: 450,
minHeight: 250,
minHeight: 250
});
// Add the Flot version string to the footer
......@@ -70,7 +70,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -13,6 +13,15 @@
$(function() {
// Shim allowing us to get the state of the check-box on jQuery versions
// prior to 1.6, when prop was added. The reason we don't just use attr
// is because it doesn't work in jQuery versions 1.9.x and later.
// TODO: Remove this once Flot's minimum supported jQuery reaches 1.6.
if (typeof $.fn.prop != 'function') {
$.fn.prop = $.fn.attr;
}
var data = [{
label: "United States",
data: [[1990, 18.9], [1991, 18.7], [1992, 18.4], [1993, 19.3], [1994, 19.5], [1995, 19.3], [1996, 19.4], [1997, 20.2], [1998, 19.8], [1999, 19.9], [2000, 20.4], [2001, 20.1], [2002, 20.0], [2003, 19.8], [2004, 20.4]]
......@@ -65,15 +74,17 @@
$("#selection").text(ranges.xaxis.from.toFixed(1) + " to " + ranges.xaxis.to.toFixed(1));
var zoom = $("#zoom").attr("checked");
var zoom = $("#zoom").prop("checked");
if (zoom) {
plot = $.plot(placeholder, data, $.extend(true, {}, options, {
xaxis: {
min: ranges.xaxis.from,
max: ranges.xaxis.to
}
}));
$.each(plot.getXAxes(), function(_, axis) {
var opts = axis.options;
opts.min = ranges.xaxis.from;
opts.max = ranges.xaxis.to;
});
plot.setupGrid();
plot.draw();
plot.clearSelection();
}
});
......@@ -135,7 +146,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -144,7 +144,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -812,7 +812,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -115,7 +115,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -85,7 +85,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -101,7 +101,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -70,7 +70,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -70,7 +70,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -129,7 +129,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -93,13 +93,14 @@
$("#placeholder").bind("plotselected", function (event, ranges) {
// do the zooming
plot = $.plot("#placeholder", [d], $.extend(true, {}, options, {
xaxis: {
min: ranges.xaxis.from,
max: ranges.xaxis.to
}
}));
$.each(plot.getXAxes(), function(_, axis) {
var opts = axis.options;
opts.min = ranges.xaxis.from;
opts.max = ranges.xaxis.to;
});
plot.setupGrid();
plot.draw();
plot.clearSelection();
// don't fire event on the overview to prevent eternal loop
......@@ -140,7 +141,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -138,7 +138,7 @@
</div>
<div id="footer">
Copyright &copy; 2007 - 2013 IOLA and Ole Laursen
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
......
......@@ -49,28 +49,31 @@
(function($,window,undefined){
'$:nomunge'; // Used by YUI compressor.
// A jQuery object containing all non-window elements to which the resize
// Array containing all non-window elements to which the resize
// event is bound.
var elems = $([]),
var elems = [],
// Extend $.resize if it already exists, otherwise create it.
jq_resize = $.resize = $.extend( $.resize, {} ),
timeout_id,
active = false,
// Reused strings.
str_setTimeout = 'setTimeout',
str_resize = 'resize',
str_data = str_resize + '-special-event',
str_delay = 'delay',
str_pendingDelay = 'pendingDelay',
str_activeDelay = 'activeDelay',
str_throttle = 'throttleWindow';
// Property: jQuery.resize.delay
//
// The numeric interval (in milliseconds) at which the resize event polling
// loop executes. Defaults to 250.
// loop executes. Defaults to 200.
jq_resize[ str_delay ] = 250;
jq_resize[ str_pendingDelay ] = 200;
jq_resize[ str_activeDelay ] = 20;
// Property: jQuery.resize.throttleWindow
//
......@@ -139,13 +142,17 @@
var elem = $(this);
// Add this element to the list of internal elements to monitor.
elems = elems.add( elem );
elems.push( this );
// Initialize data store on the element.
$.data( this, str_data, { w: elem.width(), h: elem.height() } );
elem.data( str_data, { w: elem.width(), h: elem.height() } );
// If this is the first element added, start the polling loop.
if ( elems.length === 1 ) {
//set the timeout_id to undefined.
timeout_id = undefined;
//start the loop
loopy();
}
},
......@@ -161,15 +168,27 @@
var elem = $(this);
// Remove this element from the list of internal elements to monitor.
elems = elems.not( elem );
for (var i = elems.length - 1; i >= 0; i--) {
if(elems[i] == this){
elems.splice(i, 1);
break;
}
};
// Remove any data stored on the element.
elem.removeData( str_data );
// If this is the last element removed, stop the polling loop.
if ( !elems.length ) {
if (active) {
cancelAnimationFrame( timeout_id );
} else {
clearTimeout( timeout_id );
}
//set the timeout_id to null, to make sure the loop is stopped
timeout_id = null;
}
},
// Called every time a 'resize' event callback is bound per element (new in
......@@ -190,7 +209,7 @@
function new_handler( e, w, h ) {
var elem = $(this),
data = $.data( this, str_data );
data = elem.data( str_data ) || {};
// If called from the polling loop, w and h will be passed in as
// arguments. If called manually, via .trigger( 'resize' ) or .resize(),
......@@ -216,31 +235,79 @@
};
function loopy() {
// Start the polling loop, asynchronously.
timeout_id = window[ str_setTimeout ](function(){
function loopy(timestamp) {
// If this is the first call since switching to active polling, then save
// its timestamp; we need it to determine when to switch back to passive
// polling. Note the || 1; this is just in case the first real timestamp
// is legitimately zero; in that case we still want a truthy value.
if (active === true) {
active = timestamp || 1;
}
// Iterate over all elements to which the 'resize' event is bound.
elems.each(function(){
var elem = $(this),
width = elem.width(),
for (var i = elems.length - 1; i >= 0; i--) {
var elem = $(elems[i]);
if (elem[0] == window || elem.is(':visible')) {
var width = elem.width(),
height = elem.height(),
data = $.data( this, str_data );
data = elem.data( str_data );
// If element size has changed since the last time, update the element
// data store and trigger the 'resize' event.
if ( width !== data.w || height !== data.h ) {
if ( data && ( width !== data.w || height !== data.h ) ) {
elem.trigger( str_resize, [ data.w = width, data.h = height ] );
active = timestamp || true;
}
} else {
// resetting stored width and height so that resize event is triggered next time
data = elem.data(str_data);
data.w = 0;
data.h = 0;
}
};
});
// Loop.
loopy();
}, jq_resize[ str_delay ] );
// Poll gently until there is a change, then requestAnimationFrame until
// a second passes without a resize event, at which point we switch back.
if (timeout_id !== null) {
if (active && (timestamp == null || timestamp - active < 1000)) {
timeout_id = window.requestAnimationFrame(loopy);
} else {
timeout_id = setTimeout(loopy, jq_resize[ str_pendingDelay ]);
active = false;
}
}
};
/**
* Provides requestAnimationFrame in a cross browser way.
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = (function(){
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
return window.setTimeout(function() {
callback((new Date()).getTime());
}, jq_resize[ str_activeDelay ] );
};
})();
}
/**
* Provides cancelAnimationFrame in a cross browser way.
*/
if( !window.cancelAnimationFrame ){
window.cancelAnimationFrame = ( function() {
return window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame ||
window.oCancelRequestAnimationFrame ||
window.msCancelRequestAnimationFrame ||
clearTimeout
})();
}
})(jQuery,this);
/* Javascript plotting library for jQuery, version 0.9.0-alpha.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
*/
......@@ -1125,10 +1125,24 @@ Licensed under the MIT license.
if (options.x2axis) {
options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
options.xaxes[1].position = "top";
// Override the inherit to allow the axis to auto-scale
if (options.x2axis.min == null) {
options.xaxes[1].min = null;
}
if (options.x2axis.max == null) {
options.xaxes[1].max = null;
}
}
if (options.y2axis) {
options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
options.yaxes[1].position = "right";
// Override the inherit to allow the axis to auto-scale
if (options.y2axis.min == null) {
options.yaxes[1].min = null;
}
if (options.y2axis.max == null) {
options.yaxes[1].max = null;
}
}
if (options.grid.coloredAreas) {
options.grid.markings = options.grid.coloredAreas;
......@@ -1777,7 +1791,7 @@ Licensed under the MIT license.
// Determine the axis's position in its direction and on its side
$.each(isXAxis ? xaxes : yaxes, function(i, a) {
if (a && a.reserveSpace) {
if (a && (a.show || a.reserveSpace)) {
if (a === axis) {
found = true;
} else if (a.options.position === axisPosition) {
......@@ -1886,19 +1900,14 @@ Licensed under the MIT license.
// jump as much around with replots
$.each(allAxes(), function(_, axis) {
if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
var lastTick = axis.ticks[axis.ticks.length - 1];
if (axis.direction === "x") {
margins.left = Math.max(margins.left, axis.tickWidth / 2);
if (lastTick.v <= axis.max) {
margins.right = Math.max(margins.right, axis.tickWidth / 2);
}
} else {
margins.bottom = Math.max(margins.bottom, axis.tickHeight / 2);
if (lastTick.v <= axis.max) {
margins.top = Math.max(margins.top, axis.tickHeight / 2);
}
}
}
});
plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left));
......@@ -1931,26 +1940,20 @@ Licensed under the MIT license.
}
}
// init axes
$.each(axes, function(_, axis) {
axis.show = axis.options.show;
if (axis.show == null) {
// by default an axis is visible if it's got data
axis.show = axis.used;
}
axis.reserveSpace = axis.show || axis.options.reserveSpace;
var axisOpts = axis.options;
axis.show = axisOpts.show == null ? axis.used : axisOpts.show;
axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace;
setRange(axis);
});
if (showGrid) {
var allocatedAxes = $.grep(axes, function(axis) { return axis.reserveSpace; });
var allocatedAxes = $.grep(axes, function(axis) {
return axis.show || axis.reserveSpace;
});
$.each(allocatedAxes, function(_, axis) {
// make the ticks
setupTickGeneration(axis);
setTicks(axis);
......@@ -2563,35 +2566,44 @@ Licensed under the MIT license.
yrange.from = Math.max(yrange.from, yrange.axis.min);
yrange.to = Math.min(yrange.to, yrange.axis.max);
// then draw
xrange.from = xrange.axis.p2c(xrange.from);
xrange.to = xrange.axis.p2c(xrange.to);
yrange.from = yrange.axis.p2c(yrange.from);
yrange.to = yrange.axis.p2c(yrange.to);
var xequal = xrange.from === xrange.to,
yequal = yrange.from === yrange.to;
if (xrange.from !== xrange.to || xrange.from !== yrange.to) {
if (xrange.from === xrange.to || yrange.from === yrange.to) {
if (xequal && yequal) {
continue;
}
// draw line
// then draw
xrange.from = Math.floor(xrange.axis.p2c(xrange.from));
xrange.to = Math.floor(xrange.axis.p2c(xrange.to));
yrange.from = Math.floor(yrange.axis.p2c(yrange.from));
yrange.to = Math.floor(yrange.axis.p2c(yrange.to));
if (xequal || yequal) {
var lineWidth = m.lineWidth || options.grid.markingsLineWidth,
subPixel = lineWidth % 2 ? 0.5 : 0;
ctx.beginPath();
ctx.strokeStyle = m.color || options.grid.markingsColor;
ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth;
ctx.moveTo(xrange.from, yrange.from);
ctx.lineTo(xrange.to, yrange.to);
ctx.lineWidth = lineWidth;
if (xequal) {
ctx.moveTo(xrange.to + subPixel, yrange.from);
ctx.lineTo(xrange.to + subPixel, yrange.to);
} else {
ctx.moveTo(xrange.from, yrange.to + subPixel);
ctx.lineTo(xrange.to, yrange.to + subPixel);
}
ctx.stroke();
} else {
// fill area
ctx.fillStyle = m.color || options.grid.markingsColor;
if (!m.rounded) {
ctx.fillRect(xrange.from, yrange.to,
xrange.to - xrange.from,
yrange.from - yrange.to);
} else {
roundRect(ctx, xrange.from, yrange.to, xrange.to - xrange.from, yrange.from - yrange.to, m.rounded);
if (m.rounded) {
roundRect(
ctx, xrange.from, yrange.to, xrange.to - xrange.from,
yrange.from - yrange.to, m.rounded);
ctx.fill();
}
} else {
ctx.fillRect(
xrange.from, yrange.to, xrange.to - xrange.from,
yrange.from - yrange.to);
}
}
......
/* Flot plugin for drawing all elements of a plot on the canvas.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Flot normally produces certain elements, like axis labels and the legend, using
......
/* Flot plugin for plotting textual data or categories.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
......
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
......@@ -145,7 +145,7 @@ The plugin also adds four public methods:
ctx.translate(plotOffset.left, plotOffset.top);
if (crosshair.x !== -1) {
var adj = plot.getOptions().crosshair.lineWidth % 2 === 0 ? 0 : 0.5;
var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
ctx.strokeStyle = c.color;
ctx.lineWidth = c.lineWidth;
......@@ -153,12 +153,12 @@ The plugin also adds four public methods:
ctx.beginPath();
if (c.mode.indexOf("x") !== -1) {
var drawX = Math.round(crosshair.x) + adj;
var drawX = Math.floor(crosshair.x) + adj;
ctx.moveTo(drawX, 0);
ctx.lineTo(drawX, plot.height());
}
if (c.mode.indexOf("y") !== -1) {
var drawY = Math.round(crosshair.y) + adj;
var drawY = Math.floor(crosshair.y) + adj;
ctx.moveTo(0, drawY);
ctx.lineTo(plot.width(), drawY);
}
......
/* Flot plugin for plotting error bars.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Error bars are used to show standard deviation and other statistical
......
/* Flot plugin for computing bottoms for filled line and bar charts.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The case: you've got two series that you want to fill the area between. In Flot
......
/* Flot plugin for plotting images.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
......
/* Flot plugin for adding the ability to pan and zoom the plot.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The default behaviour is double click and scrollwheel up/down to zoom in, drag
......@@ -245,8 +245,8 @@ can set the default in the options.
var range = max - min;
if (zr &&
((zr[0] != null && range < zr[0]) ||
(zr[1] != null && range > zr[1]))) {
((zr[0] != null && range < zr[0] && amount > 1) ||
(zr[1] != null && range > zr[1] && amount < 1))) {
return;
}
......
/* Flot plugin for rendering pie charts.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin assumes that each series has a single data value, and that each
......@@ -225,13 +225,17 @@ More detail and specific examples can be found in the included HTML file.
for (i = 0; i < data.length; ++i) {
value = data[i].data[0][1];
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
newdata.push({
newdata.push(
// Use extend rather than replacing, so other original
// data values can be used, e.g. in labelFormatter.
$.extend(data[i], {
data: [[1, value]],
color: data[i].color,
label: data[i].label,
angle: value * Math.PI * 2 / total,
percent: value / (total / 100)
});
})
);
}
}
......
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
It works by listening for changes on the placeholder div (through the jQuery
......
/* Flot plugin for selecting regions of a plot.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
......
/* Flot plugin for stacking data sets rather than overlyaing them.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin assumes the data is sorted on x (or y if stacking horizontally).
......
/* Flot plugin that adds some extra symbols for plotting points.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The symbols are accessed as strings through the standard symbol options:
......
/* Flot plugin for thresholding data.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
......
/* Pretty handling of time axes.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Set axis.mode to "time" to enable. See the section "Time series data" in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment