From 1681bd3b534d359c296430e8e369199790d4f670 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 1 Jan 2013 11:05:42 -0500 Subject: [PATCH] Upgraded jqPlot to 1.0.4 r1121 --- ChangeLog | 1 + js/jqplot/jquery.jqplot.js | 143 ++++++++++++++---- js/jqplot/plugins/jqplot.barRenderer.js | 26 ++-- .../plugins/jqplot.canvasAxisLabelRenderer.js | 6 +- .../plugins/jqplot.canvasTextRenderer.js | 8 +- .../plugins/jqplot.categoryAxisRenderer.js | 80 +++++++--- js/jqplot/plugins/jqplot.cursor.js | 6 +- js/jqplot/plugins/jqplot.dateAxisRenderer.js | 43 +----- js/jqplot/plugins/jqplot.highlighter.js | 6 +- js/jqplot/plugins/jqplot.pieRenderer.js | 6 +- js/jqplot/plugins/jqplot.pointLabels.js | 6 +- 11 files changed, 219 insertions(+), 112 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90ebecf37e..6a17d8b39e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -81,6 +81,7 @@ VerboseMultiSubmit, ReplaceHelpImg + Removed the AjaxEnable directive + rfe #3542567 Accept IPv6 ranges and IPv6 CIDR notations in $cfg['Servers'][$i]['AllowDeny']['rules'] - Bug #3576788 Grid editing shows the value before silent truncation +- Upgraded jqPlot to 1.0.4 r1121 3.5.6.0 (not yet released) - bug #3593604 [status] Erroneous advisor rule diff --git a/js/jqplot/jquery.jqplot.js b/js/jqplot/jquery.jqplot.js index 3e767e8643..cded47ab72 100644 --- a/js/jqplot/jquery.jqplot.js +++ b/js/jqplot/jquery.jqplot.js @@ -5,12 +5,12 @@ * * About: Version * - * version: 1.0.2 - * revision: 1108 + * version: 1.0.4 + * revision: 1121 * * About: Copyright & License * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT and GPL version 2.0 licenses. This means that you can * choose the license that best suits your project and use it accordingly. @@ -244,8 +244,8 @@ } }; - $.jqplot.version = "1.0.2"; - $.jqplot.revision = "1108"; + $.jqplot.version = "1.0.4"; + $.jqplot.revision = "1121"; $.jqplot.targetCounter = 1; @@ -1143,7 +1143,8 @@ * by the Plot oject. Series properties can be set or overriden by the * options passed in from the user. */ - function Series() { + function Series(options) { + options = options || {}; $.jqplot.ElemContainer.call(this); // Group: Properties // Properties will be assigned from a series array at the top level of the @@ -1316,8 +1317,8 @@ this.index = index; this.gridBorderWidth = gridbw; var d = this.data; - var temp = [], i; - for (i=0; i 0) { + for (var j=index; j--;) { + var prevval = this._plotData[j][k][sidx]; + // only need to sum up the stack axis column of data + // and only sum if it is of same sign. + // if previous series isn't same sign, keep looking + // at earlier series untill we find one of same sign. + if (temp * prevval >= 0) { + this._plotData[index][k][sidx] += prevval; + this._stackData[index][k][sidx] += prevval; + break; + } + } + } + } + + } + else { + for (var i=0; i0) { + series._prevPlotData = this.series[index-1]._plotData; + } + series._sumy = 0; + series._sumx = 0; + for (i=series.data.length-1; i>-1; i--) { + series._sumy += series.data[i][1]; + series._sumx += series.data[i][0]; + } + } + + }; // populate the _stackData and _plotData arrays for the plot and the series. this.populatePlotData = function(series, index) { @@ -2480,23 +2559,28 @@ var plotValues = {x:[], y:[]}; if (this.stackSeries && !series.disableStack) { series._stack = true; - var sidx = series._stackAxis == 'x' ? 0 : 1; - var idx = sidx ? 0 : 1; + var sidx = (series._stackAxis === 'x') ? 0 : 1; + // var idx = sidx ? 0 : 1; // push the current data into stackData //this._stackData.push(this.series[i].data); var temp = $.extend(true, [], series.data); // create the data that will be plotted for this series var plotdata = $.extend(true, [], series.data); + var tempx, tempy, dval, stackval, comparator; // for first series, nothing to add to stackData. for (var j=0; j= 0) { - plotdata[k][sidx] += cd[k][sidx]; + if (series.data[k][sidx] * stackval >= 0) { + plotdata[k][sidx] += stackval; } } } @@ -2609,13 +2693,13 @@ // return data as an array of point arrays, // in form [[x1,y1...], [x2,y2...], ...] var temp = []; - var i; + var i, l; dir = dir || 'vertical'; if (!$.isArray(data[0])) { // we have a series of scalars. One line with just y values. // turn the scalar list of data into a data array of form: // [[1, data[0]], [2, data[1]], ...] - for (i=0; i 0 && i < this.gridData.length-1) { - xstart = this.gridData[i-1][1]; + xstart = this.gridData[i-1][0]; } else if (this.waterfall && i == 0 && i < this.gridData.length-1) { if (this._xaxis.min <= 0 && this._xaxis.max >= 0) { @@ -489,7 +495,7 @@ xstart = 0; } else { - xstart = ctx.canvas.width; + xstart = 0; } } else if (this.waterfall && i == this.gridData.length - 1) { @@ -550,8 +556,8 @@ } var clr = opts.fillStyle || this.color; this._dataColors.push(clr); - this.renderer.shapeRenderer.draw(ctx, points, opts); - } + this.renderer.shapeRenderer.draw(ctx, points, opts); + } } } diff --git a/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js b/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js index febf01d327..18404399fd 100644 --- a/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js +++ b/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can diff --git a/js/jqplot/plugins/jqplot.canvasTextRenderer.js b/js/jqplot/plugins/jqplot.canvasTextRenderer.js index 4f869836d2..53f25305ec 100644 --- a/js/jqplot/plugins/jqplot.canvasTextRenderer.js +++ b/js/jqplot/plugins/jqplot.canvasTextRenderer.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can @@ -29,7 +29,7 @@ * * included jsDate library by Chris Leonello: * - * Copyright (c) 2010-2011 Chris Leonello + * Copyright (c) 2010-2012 Chris Leonello * * jsDate is currently available for use in all personal or commercial projects * under both the MIT and GPL version 2.0 licenses. This means that you can diff --git a/js/jqplot/plugins/jqplot.categoryAxisRenderer.js b/js/jqplot/plugins/jqplot.categoryAxisRenderer.js index dd1fc7e40f..4cea2de6ea 100644 --- a/js/jqplot/plugins/jqplot.categoryAxisRenderer.js +++ b/js/jqplot/plugins/jqplot.categoryAxisRenderer.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can @@ -70,6 +70,7 @@ this._groupLabels = []; this._grouped = false; this._barsPerGroup = null; + this.reverse = false; // prop: tickRenderer // A class of a rendering engine for creating the ticks labels displayed on the plot, // See <$.jqplot.AxisTickRenderer>. @@ -441,32 +442,67 @@ var pixellength = offmax - offmin; var unitlength = max - min; - // point to unit and unit to point conversions references to Plot DOM element top left corner. - this.p2u = function(p){ - return (p - offmin) * unitlength / pixellength + min; - }; - - this.u2p = function(u){ - return (u - min) * pixellength / unitlength + offmin; - }; - - if (this.name == 'xaxis' || this.name == 'x2axis'){ - this.series_u2p = function(u){ - return (u - min) * pixellength / unitlength; + if (!this.reverse) { + // point to unit and unit to point conversions references to Plot DOM element top left corner. + + this.u2p = function(u){ + return (u - min) * pixellength / unitlength + offmin; }; - this.series_p2u = function(p){ - return p * unitlength / pixellength + min; + + this.p2u = function(p){ + return (p - offmin) * unitlength / pixellength + min; }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (u - min) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + + else { + this.series_u2p = function(u){ + return (u - max) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } } - + else { - this.series_u2p = function(u){ - return (u - max) * pixellength / unitlength; + // point to unit and unit to point conversions references to Plot DOM element top left corner. + + this.u2p = function(u){ + return offmin + (max - u) * pixellength / unitlength; }; - this.series_p2u = function(p){ - return p * unitlength / pixellength + max; + + this.p2u = function(p){ + return min + (p - offmin) * unitlength / pixellength; }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (max - u) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } + + else { + this.series_u2p = function(u){ + return (min - u) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + } + if (this.show) { if (this.name == 'xaxis' || this.name == 'x2axis') { diff --git a/js/jqplot/plugins/jqplot.cursor.js b/js/jqplot/plugins/jqplot.cursor.js index e86ea7e6b3..0e583682a5 100644 --- a/js/jqplot/plugins/jqplot.cursor.js +++ b/js/jqplot/plugins/jqplot.cursor.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can diff --git a/js/jqplot/plugins/jqplot.dateAxisRenderer.js b/js/jqplot/plugins/jqplot.dateAxisRenderer.js index bdf4c22cf4..ec4211d42b 100644 --- a/js/jqplot/plugins/jqplot.dateAxisRenderer.js +++ b/js/jqplot/plugins/jqplot.dateAxisRenderer.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can @@ -335,28 +335,6 @@ var threshold = 30; var insetMult = 1; - var daTickInterval = null; - - // if user specified a tick interval, convert to usable. - if (this.tickInterval != null) - { - // if interval is a number or can be converted to one, use it. - // Assume it is in SECONDS!!! - if (Number(this.tickInterval)) { - daTickInterval = [Number(this.tickInterval), 'seconds']; - } - // else, parse out something we can build from. - else if (typeof this.tickInterval == "string") { - var parts = this.tickInterval.split(' '); - if (parts.length == 1) { - daTickInterval = [1, parts[0]]; - } - else if (parts.length == 2) { - daTickInterval = [parts[0], parts[1]]; - } - } - } - var tickInterval = this.tickInterval; // if we already have ticks, use them. @@ -486,7 +464,7 @@ // tickInterval will be used before numberTicks, that is if // both are specified, numberTicks will be ignored. else if (this.tickInterval) { - titarget = new $.jsDate(0).add(daTickInterval[0], daTickInterval[1]).getTime(); + titarget = this.tickInterval; } // if numberTicks specified, try to honor it. @@ -502,10 +480,9 @@ var tempti = ret[0]; this._autoFormatString = ret[1]; - //min = Math.floor(min/tempti) * tempti; + min = Math.floor(min/tempti) * tempti; min = new $.jsDate(min); - //min = min.getTime() + min.getUtcOffset(); -min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.getUtcOffset(); + min = min.getTime() + min.getUtcOffset(); nttarget = Math.ceil((max - min) / tempti) + 1; this.min = min; @@ -663,7 +640,7 @@ min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.get this.tickInterval = null; } - /* // if user specified a tick interval, convert to usable. + // if user specified a tick interval, convert to usable. if (this.tickInterval != null) { // if interval is a number or can be converted to one, use it. @@ -681,12 +658,8 @@ min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.get this.daTickInterval = [parts[0], parts[1]]; } } - }*/ + } - if (this.tickInterval != null && daTickInterval != null) { - this.daTickInterval = daTickInterval; - } - // if min and max are same, space them out a bit if (min == max) { var adj = 24*60*60*500; // 1/2 day diff --git a/js/jqplot/plugins/jqplot.highlighter.js b/js/jqplot/plugins/jqplot.highlighter.js index ea6251af23..2e8c5da936 100644 --- a/js/jqplot/plugins/jqplot.highlighter.js +++ b/js/jqplot/plugins/jqplot.highlighter.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can diff --git a/js/jqplot/plugins/jqplot.pieRenderer.js b/js/jqplot/plugins/jqplot.pieRenderer.js index f90f322714..2479885ce5 100644 --- a/js/jqplot/plugins/jqplot.pieRenderer.js +++ b/js/jqplot/plugins/jqplot.pieRenderer.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can diff --git a/js/jqplot/plugins/jqplot.pointLabels.js b/js/jqplot/plugins/jqplot.pointLabels.js index 009644390b..c20a9c4423 100644 --- a/js/jqplot/plugins/jqplot.pointLabels.js +++ b/js/jqplot/plugins/jqplot.pointLabels.js @@ -2,10 +2,10 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.2 - * Revision: 1108 + * Version: 1.0.4 + * Revision: 1121 * - * Copyright (c) 2009-2011 Chris Leonello + * Copyright (c) 2009-2012 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can