Skip to content

Commit c74ad6b

Browse files
committed
Update jqPlot to latest GitHub revision
1 parent 9c1bc44 commit c74ad6b

21 files changed

Lines changed: 502 additions & 336 deletions

libs/jqplot/build_minified_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ cat plugins/jqplot.categoryAxisRenderer.js >> jqplot-custom.min.js-temp
2121
cat plugins/jqplot.canvasTextRenderer.js >> jqplot-custom.min.js-temp
2222
cat plugins/jqplot.canvasAxisTickRenderer.js >> jqplot-custom.min.js-temp
2323

24-
java -jar ../../js/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar --type js --line-break 1000 jqplot-custom.min.js-temp > jqplot-custom.min.js
24+
java -jar ../../js/yuicompressor-2.4.8.jar --type js --line-break 1000 jqplot-custom.min.js-temp > jqplot-custom.min.js
2525

2626
rm ./jqplot-custom.min.js-temp

libs/jqplot/jqplot-custom.min.js

Lines changed: 152 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/jqplot/jqplot.axisLabelRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

libs/jqplot/jqplot.axisTickRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

libs/jqplot/jqplot.canvasGridRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

libs/jqplot/jqplot.core.js

Lines changed: 88 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* About: Copyright & License
1212
*
13-
* Copyright (c) 2009-2013 Chris Leonello
13+
* Copyright (c) 2009-2016 Chris Leonello
1414
* jqPlot is currently available for use in all personal or commercial projects
1515
* under both the MIT and GPL version 2.0 licenses. This means that you can
1616
* choose the license that best suits your project and use it accordingly.
@@ -184,7 +184,7 @@
184184
* enabled in the individual plot options. Default: false.
185185
* This property sets the "show" property of certain plugins to true or false.
186186
* Only plugins that can be immediately active upon loading are affected. This includes
187-
* non-renderer plugins like cursor, dragable, highlighter, and trendline.
187+
* non-renderer plugins like cursor, draggable, highlighter, and trendline.
188188
* defaultHeight - Default height for plots where no css height specification exists. This
189189
* is a jqplot wide default.
190190
* defaultWidth - Default height for plots where no css height specification exists. This
@@ -295,6 +295,7 @@
295295
if ($.jqplot.use_excanvas) {
296296
return window.G_vmlCanvasManager.initElement(canvas);
297297
}
298+
298299
var cctx = canvas.getContext('2d');
299300

300301
var canvasBackingScale = 1;
@@ -892,7 +893,7 @@
892893
// prop: placement
893894
// "insideGrid" places legend inside the grid area of the plot.
894895
// "outsideGrid" places the legend outside the grid but inside the plot container,
895-
// shrinking the grid to accomodate the legend.
896+
// shrinking the grid to accommodate the legend.
896897
// "inside" synonym for "insideGrid",
897898
// "outside" places the legend ouside the grid area, but does not shrink the grid which
898899
// can cause the legend to overflow the plot container.
@@ -1325,6 +1326,7 @@
13251326
this._sumy = 0;
13261327
this._sumx = 0;
13271328
this._type = '';
1329+
this.step = false;
13281330
}
13291331

13301332
Series.prototype = new $.jqplot.ElemContainer();
@@ -1804,7 +1806,7 @@
18041806
// prop: drawIfHidden
18051807
// True to execute the draw method even if the plot target is hidden.
18061808
// Generally, this should be false. Most plot elements will not be sized/
1807-
// positioned correctly if renderered into a hidden container. To render into
1809+
// positioned correclty if renderered into a hidden container. To render into
18081810
// a hidden container, call the replot method when the container is shown.
18091811
this.drawIfHidden = false;
18101812
this.eventCanvas = new $.jqplot.GenericCanvas();
@@ -2058,7 +2060,18 @@
20582060
$.extend(true, this.noDataIndicator, options.noDataIndicator);
20592061
}
20602062

2061-
if (data == null || $.isArray(data) == false || data.length == 0 || $.isArray(data[0]) == false || data[0].length == 0) {
2063+
// check for any data
2064+
var hasData = false;
2065+
if (data != null && $.isArray(data) === true) {
2066+
for (var i = 0; i < data.length; i++) {
2067+
if ($.isArray(data[i]) === true && data[i].length > 0) {
2068+
hasData = true;
2069+
break;
2070+
};
2071+
}
2072+
};
2073+
2074+
if (!hasData) {
20622075

20632076
if (this.noDataIndicator.show == false) {
20642077
throw new Error("No data specified");
@@ -2100,7 +2113,13 @@
21002113

21012114
// make a copy of the data
21022115
this.data = $.extend(true, [], data);
2103-
2116+
// fix missing data entries
2117+
for (var i = 0; i < this.data.length; i++) {
2118+
if ($.isArray(data[i]) == false) {
2119+
this.data[i] = [];
2120+
};
2121+
};
2122+
21042123
this.parseOptions(options);
21052124

21062125
if (this.textColor) {
@@ -3049,10 +3068,6 @@
30493068

30503069
if (this.legend.placement === 'outsideGrid') {
30513070
legendPadding = {top:this.title.getHeight(), left: 0, right: 0, bottom: 0};
3052-
if (this.legend.location === 's') {
3053-
legendPadding.left = this._gridPadding.left;
3054-
legendPadding.right = this._gridPadding.right;
3055-
}
30563071
}
30573072

30583073
ax.xaxis.pack({position:'absolute', bottom:this._gridPadding.bottom - ax.xaxis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});
@@ -3131,9 +3146,34 @@
31313146
}
31323147

31333148
var fb = this.fillBetween;
3134-
if (fb.fill && fb.series1 !== fb.series2 && fb.series1 < seriesLength && fb.series2 < seriesLength && series[fb.series1]._type === 'line' && series[fb.series2]._type === 'line') {
3149+
if(typeof fb.series1 == 'number'){
3150+
if(fb.fill&&fb.series1!==fb.series2&&fb.series1<seriesLength&&fb.series2<seriesLength&&series[fb.series1]._type==="line"&&series[fb.series2]._type==="line")
31353151
this.doFillBetweenLines();
31363152
}
3153+
else{
3154+
if(fb.series1 != null && fb.series2 != null){
3155+
var doFb = false;
3156+
if(fb.series1.length === fb.series2.length){
3157+
var tempSeries1 = 0;
3158+
var tempSeries2 = 0;
3159+
3160+
for(var cnt = 0; cnt < fb.series1.length; cnt++){
3161+
tempSeries1 = fb.series1[cnt];
3162+
tempSeries2 = fb.series2[cnt];
3163+
if(tempSeries1!==tempSeries2&&tempSeries1<seriesLength&&tempSeries2<seriesLength&&series[tempSeries1]._type==="line"&&series[tempSeries2]._type==="line"){
3164+
doFb = true;
3165+
}
3166+
else{
3167+
doFb = false;
3168+
break;
3169+
}
3170+
}
3171+
}
3172+
if(fb.fill && doFb){
3173+
this.doFillBetweenLines();
3174+
}
3175+
}
3176+
}
31373177

31383178
for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) {
31393179
$.jqplot.postDrawHooks[i].call(this);
@@ -3174,37 +3214,47 @@
31743214

31753215
jqPlot.prototype.doFillBetweenLines = function () {
31763216
var fb = this.fillBetween;
3217+
var series = this.series;
31773218
var sid1 = fb.series1;
31783219
var sid2 = fb.series2;
3179-
// first series should always be lowest index
3180-
var id1 = (sid1 < sid2) ? sid1 : sid2;
3181-
var id2 = (sid2 > sid1) ? sid2 : sid1;
3182-
3183-
var series1 = this.series[id1];
3184-
var series2 = this.series[id2];
3185-
3186-
if (series2.renderer.smooth) {
3187-
var tempgd = series2.renderer._smoothedData.slice(0).reverse();
3188-
}
3189-
else {
3190-
var tempgd = series2.gridData.slice(0).reverse();
3220+
var id1 = 0, id2 = 0;
3221+
3222+
function fill(id1, id2){
3223+
var series1 = series[id1];
3224+
var series2 = series[id2];
3225+
if (series2.renderer.smooth)
3226+
var tempgd = series2.renderer._smoothedData.slice(0).reverse();
3227+
else
3228+
var tempgd = series2.gridData.slice(0).reverse();
3229+
if (series1.renderer.smooth)
3230+
var gd = series1.renderer._smoothedData.concat(tempgd);
3231+
else
3232+
var gd = series1.gridData.concat(tempgd);
3233+
var color = fb.color !== null ? fb.color : series[id1].fillColor;
3234+
var baseSeries = fb.baseSeries !== null ? fb.baseSeries : id1;
3235+
var sr =
3236+
series[baseSeries].renderer.shapeRenderer;
3237+
var opts =
3238+
{
3239+
fillStyle : color,
3240+
fill : true,
3241+
closePath : true
3242+
};
3243+
sr.draw(series1.shadowCanvas._ctx, gd, opts)
31913244
}
31923245

3193-
if (series1.renderer.smooth) {
3194-
var gd = series1.renderer._smoothedData.concat(tempgd);
3246+
if(typeof sid1 == 'number' && typeof sid2 == 'number'){
3247+
id1 = sid1 < sid2 ? sid1 : sid2;
3248+
id2 = sid2 > sid1 ? sid2 : sid1;
3249+
fill(id1, id2);
31953250
}
3196-
else {
3197-
var gd = series1.gridData.concat(tempgd);
3251+
else{
3252+
for(var cnt = 0; cnt < sid1.length ; cnt++){
3253+
id1 = sid1[cnt] < sid2[cnt] ? sid1[cnt] : sid2[cnt];
3254+
id2 = sid2[cnt] > sid1[cnt] ? sid2[cnt] : sid1[cnt];
3255+
fill(id1, id2);
3256+
}
31983257
}
3199-
3200-
var color = (fb.color !== null) ? fb.color : this.series[sid1].fillColor;
3201-
var baseSeries = (fb.baseSeries !== null) ? fb.baseSeries : id1;
3202-
3203-
// now apply a fill to the shape on the lower series shadow canvas,
3204-
// so it is behind both series.
3205-
var sr = this.series[baseSeries].renderer.shapeRenderer;
3206-
var opts = {fillStyle: color, fill: true, closePath: true};
3207-
sr.draw(series1.shadowCanvas._ctx, gd, opts);
32083258
};
32093259

32103260
this.bindCustomEvents = function() {
@@ -3261,7 +3311,7 @@
32613311
for (j=0; j<s._barPoints.length; j++) {
32623312
points = s._barPoints[j];
32633313
p = s.gridData[j];
3264-
if (x>points[0][0] && x<points[2][0] && y>points[2][1] && y<points[0][1]) {
3314+
if (x>points[0][0] && x<points[2][0] && (y>points[2][1] && y<points[0][1] || y<points[2][1] && y>points[0][1])) {
32653315
return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
32663316
}
32673317
}
@@ -3414,7 +3464,7 @@
34143464
for (j=0; j<v.length; j++) {
34153465
cv = v[j];
34163466
if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) {
3417-
return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};
3467+
return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};
34183468
}
34193469
}
34203470
break;

libs/jqplot/jqplot.divTitleRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

libs/jqplot/jqplot.linePattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

libs/jqplot/jqplot.lineRenderer.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
@@ -790,6 +790,9 @@
790790
for (var i=0; i<data.length; i++) {
791791
// if not a line series or if no nulls in data, push the converted point onto the array.
792792
if (data[i][0] != null && data[i][1] != null) {
793+
if (this.step && i>0) {
794+
gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i-1][1])]);
795+
}
793796
gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
794797
}
795798
// else if there is a null, preserve it.
@@ -1011,7 +1014,11 @@
10111014
fasgd = this.gridData;
10121015
}
10131016
for (i=0; i<fasgd.length; i++) {
1014-
this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, opts.markerOptions);
1017+
var markerOptions = opts.markerOptions || {};
1018+
if (this.markerOptionsCallback) {
1019+
markerOptions = $.extend(true, markerOptions, this.markerOptionsCallback(plot, this, i, this.data[i], gd[i]) || {});
1020+
}
1021+
this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, markerOptions);
10151022
}
10161023
}
10171024
}
@@ -1081,8 +1088,12 @@
10811088
gd = this.gridData;
10821089
}
10831090
for (i=0; i<gd.length; i++) {
1091+
var markerOptions = opts.markerOptions || {};
1092+
if (this.markerOptionsCallback) {
1093+
markerOptions = $.extend(true, markerOptions, this.markerOptionsCallback(plot, this, i, this.data[i], gd[i]) || {});
1094+
}
10841095
if (gd[i][0] != null && gd[i][1] != null) {
1085-
this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, opts.markerOptions);
1096+
this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, markerOptions);
10861097
}
10871098
}
10881099
}
@@ -1224,4 +1235,4 @@
12241235
}
12251236
}
12261237

1227-
})(jQuery);
1238+
})(jQuery);

libs/jqplot/jqplot.linearAxisRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version: @VERSION
66
* Revision: @REVISION
77
*
8-
* Copyright (c) 2009-2013 Chris Leonello
8+
* Copyright (c) 2009-2016 Chris Leonello
99
* jqPlot is currently available for use in all personal or commercial projects
1010
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
1111
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can

0 commit comments

Comments
 (0)