outfielding-jqplot-rails 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/changes-jqplot.txt +18 -0
  3. data/lib/outfielding-jqplot-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/jqplot-plugins/jqplot.BezierCurveRenderer.js +2 -2
  5. data/vendor/assets/javascripts/jqplot-plugins/jqplot.barRenderer.js +26 -25
  6. data/vendor/assets/javascripts/jqplot-plugins/jqplot.blockRenderer.js +2 -2
  7. data/vendor/assets/javascripts/jqplot-plugins/jqplot.bubbleRenderer.js +6 -6
  8. data/vendor/assets/javascripts/jqplot-plugins/jqplot.canvasAxisLabelRenderer.js +4 -4
  9. data/vendor/assets/javascripts/jqplot-plugins/jqplot.canvasAxisTickRenderer.js +6 -6
  10. data/vendor/assets/javascripts/jqplot-plugins/jqplot.canvasOverlay.js +159 -3
  11. data/vendor/assets/javascripts/jqplot-plugins/jqplot.canvasTextRenderer.js +2 -2
  12. data/vendor/assets/javascripts/jqplot-plugins/jqplot.categoryAxisRenderer.js +14 -8
  13. data/vendor/assets/javascripts/jqplot-plugins/jqplot.ciParser.js +3 -3
  14. data/vendor/assets/javascripts/jqplot-plugins/jqplot.cursor.js +4 -4
  15. data/vendor/assets/javascripts/jqplot-plugins/jqplot.dateAxisRenderer.js +4 -4
  16. data/vendor/assets/javascripts/jqplot-plugins/jqplot.donutRenderer.js +6 -6
  17. data/vendor/assets/javascripts/jqplot-plugins/jqplot.dragable.js +2 -2
  18. data/vendor/assets/javascripts/jqplot-plugins/jqplot.enhancedLegendRenderer.js +3 -3
  19. data/vendor/assets/javascripts/jqplot-plugins/jqplot.funnelRenderer.js +6 -6
  20. data/vendor/assets/javascripts/jqplot-plugins/jqplot.highlighter.js +10 -10
  21. data/vendor/assets/javascripts/jqplot-plugins/jqplot.logAxisRenderer.js +4 -4
  22. data/vendor/assets/javascripts/jqplot-plugins/jqplot.mekkoAxisRenderer.js +2 -2
  23. data/vendor/assets/javascripts/jqplot-plugins/jqplot.mekkoRenderer.js +2 -2
  24. data/vendor/assets/javascripts/jqplot-plugins/jqplot.meterGaugeRenderer.js +6 -7
  25. data/vendor/assets/javascripts/jqplot-plugins/jqplot.mobile.js +2 -2
  26. data/vendor/assets/javascripts/jqplot-plugins/jqplot.ohlcRenderer.js +2 -2
  27. data/vendor/assets/javascripts/jqplot-plugins/jqplot.pieRenderer.js +6 -6
  28. data/vendor/assets/javascripts/jqplot-plugins/jqplot.pointLabels.js +2 -2
  29. data/vendor/assets/javascripts/jqplot-plugins/jqplot.pyramidAxisRenderer.js +2 -2
  30. data/vendor/assets/javascripts/jqplot-plugins/jqplot.pyramidGridRenderer.js +2 -2
  31. data/vendor/assets/javascripts/jqplot-plugins/jqplot.pyramidRenderer.js +3 -3
  32. data/vendor/assets/javascripts/jqplot-plugins/jqplot.trendline.js +2 -2
  33. data/vendor/assets/javascripts/jquery.jqplot.js +47 -31
  34. data/vendor/assets/stylesheets/jquery.jqplot.css +8 -8
  35. metadata +2 -2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 2013-03-30 Jason Young <jay@outfielding.net>
2
+
3
+ * Includes jqplot 1.0.8 (r1250)
4
+
1
5
  2013-02-27 Jason Young <jay@outfielding.net>
2
6
 
3
7
  * Includes jqplot 1.0.7 (r1224)
data/changes-jqplot.txt CHANGED
@@ -1,5 +1,23 @@
1
1
  Title: Change Log
2
2
 
3
+ 1.0.8:
4
+ * Issue #375: sortMergedLabels does not sort string labels
5
+ * Issue #279: Groups > 3 Causes Alignment Issues
6
+ * Issue #439: IE can't display a customized legend in Quirks mode
7
+ * Issue #482: "Undefined" error message when plotting a chart with no data
8
+ * Issue #116: Don't mix spaces and tabs for indentation
9
+ * Issue #564: Metergauge renderer not resizable when replotting
10
+ * Issue #409: MeterGaugeRenderer replot/redraw offsets center
11
+ * Issue #523: Adding rectangles to Canvas Overlay plugin
12
+ * Issue #756: jqplot.min files contain non-UTF-8 characters
13
+ * Issue #223: fillToZero does not color negative values when crossover point is 0
14
+ * Pull Request #23: Adding rectangles to Canvas Overlay plugin
15
+ * Pull Request #28: Cross-over points of 0 will actually change colors
16
+ * Pull Request #35: Don't highlight hidden bars or show tooltips for them
17
+ * Pull Request #41: Add dutch(nl) and svenska(sv) translations for dates
18
+ * Add tooltip support for Pie Charts
19
+ * Update to latest YUI compressor
20
+
3
21
  1.0.7:
4
22
  * Issue #726: Bug in sprintf %p, sometimes it outputs exponential form rather than decimal
5
23
  * Issue #717: Plot's preDrawHooks not called
@@ -1,7 +1,7 @@
1
1
  module Outfielding
2
2
  module Jqplot
3
3
  module Rails
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.8"
5
5
  end
6
6
  end
7
7
  end
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -350,7 +350,7 @@
350
350
  var nvals = temp[0];
351
351
  var nseries = temp[1];
352
352
  var pos = temp[2];
353
- var points = [];
353
+ var points = [];
354
354
 
355
355
  if (this._stack) {
356
356
  this._barNudge = 0;
@@ -366,9 +366,9 @@
366
366
  negativeColor = opts.fillStyle;
367
367
  }
368
368
  var positiveColor = opts.fillStyle;
369
- var base;
370
- var xstart;
371
- var ystart;
369
+ var base;
370
+ var xstart;
371
+ var ystart;
372
372
 
373
373
  if (this.barDirection == 'vertical') {
374
374
  for (var i=0; i<gridData.length; i++) {
@@ -438,20 +438,20 @@
438
438
  opts.fillStyle = positiveColor;
439
439
  }
440
440
  }
441
-
442
- if (!this.fillToZero || this._plotData[i][1] >= 0) {
443
- points.push([base-this.barWidth/2, ystart]);
444
- points.push([base-this.barWidth/2, gridData[i][1]]);
445
- points.push([base+this.barWidth/2, gridData[i][1]]);
446
- points.push([base+this.barWidth/2, ystart]);
447
- }
448
- // for negative bars make sure points are always ordered clockwise
449
- else {
450
- points.push([base-this.barWidth/2, gridData[i][1]]);
451
- points.push([base-this.barWidth/2, ystart]);
452
- points.push([base+this.barWidth/2, ystart]);
453
- points.push([base+this.barWidth/2, gridData[i][1]]);
454
- }
441
+
442
+ if (!this.fillToZero || this._plotData[i][1] >= 0) {
443
+ points.push([base-this.barWidth/2, ystart]);
444
+ points.push([base-this.barWidth/2, gridData[i][1]]);
445
+ points.push([base+this.barWidth/2, gridData[i][1]]);
446
+ points.push([base+this.barWidth/2, ystart]);
447
+ }
448
+ // for negative bars make sure points are always ordered clockwise
449
+ else {
450
+ points.push([base-this.barWidth/2, gridData[i][1]]);
451
+ points.push([base-this.barWidth/2, ystart]);
452
+ points.push([base+this.barWidth/2, ystart]);
453
+ points.push([base+this.barWidth/2, gridData[i][1]]);
454
+ }
455
455
  this._barPoints.push(points);
456
456
  // now draw the shadows if not stacked.
457
457
  // for stacked plots, they are predrawn by drawShadow
@@ -732,9 +732,10 @@
732
732
  evt1.pageX = ev.pageX;
733
733
  evt1.pageY = ev.pageY;
734
734
  plot.target.trigger(evt1, ins);
735
- if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
735
+ if (plot.series[ins[0]].show && plot.series[ins[0]].highlightMouseOver &&
736
+ !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
736
737
  var evt = jQuery.Event('jqplotDataHighlight');
737
- evt.which = ev.which;
738
+ evt.which = ev.which;
738
739
  evt.pageX = ev.pageX;
739
740
  evt.pageY = ev.pageY;
740
741
  plot.target.trigger(evt, ins);
@@ -751,7 +752,7 @@
751
752
  var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
752
753
  if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
753
754
  var evt = jQuery.Event('jqplotDataHighlight');
754
- evt.which = ev.which;
755
+ evt.which = ev.which;
755
756
  evt.pageX = ev.pageX;
756
757
  evt.pageY = ev.pageY;
757
758
  plot.target.trigger(evt, ins);
@@ -774,7 +775,7 @@
774
775
  if (neighbor) {
775
776
  var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
776
777
  var evt = jQuery.Event('jqplotDataClick');
777
- evt.which = ev.which;
778
+ evt.which = ev.which;
778
779
  evt.pageX = ev.pageX;
779
780
  evt.pageY = ev.pageY;
780
781
  plot.target.trigger(evt, ins);
@@ -789,7 +790,7 @@
789
790
  unhighlight(plot);
790
791
  }
791
792
  var evt = jQuery.Event('jqplotDataRightClick');
792
- evt.which = ev.which;
793
+ evt.which = ev.which;
793
794
  evt.pageX = ev.pageX;
794
795
  evt.pageY = ev.pageY;
795
796
  plot.target.trigger(evt, ins);
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -632,7 +632,7 @@
632
632
  plot.target.trigger(evt1, ins);
633
633
  if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
634
634
  var evt = jQuery.Event('jqplotDataHighlight');
635
- evt.which = ev.which;
635
+ evt.which = ev.which;
636
636
  evt.pageX = ev.pageX;
637
637
  evt.pageY = ev.pageY;
638
638
  plot.target.trigger(evt, ins);
@@ -651,7 +651,7 @@
651
651
  var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
652
652
  if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
653
653
  var evt = jQuery.Event('jqplotDataHighlight');
654
- evt.which = ev.which;
654
+ evt.which = ev.which;
655
655
  evt.pageX = ev.pageX;
656
656
  evt.pageY = ev.pageY;
657
657
  plot.target.trigger(evt, ins);
@@ -676,7 +676,7 @@
676
676
  var pi = neighbor.pointIndex;
677
677
  var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
678
678
  var evt = jQuery.Event('jqplotDataClick');
679
- evt.which = ev.which;
679
+ evt.which = ev.which;
680
680
  evt.pageX = ev.pageX;
681
681
  evt.pageY = ev.pageY;
682
682
  plot.target.trigger(evt, ins);
@@ -693,7 +693,7 @@
693
693
  unhighlight(plot);
694
694
  }
695
695
  var evt = jQuery.Event('jqplotDataRightClick');
696
- evt.which = ev.which;
696
+ evt.which = ev.which;
697
697
  evt.pageX = ev.pageX;
698
698
  evt.pageY = ev.pageY;
699
699
  plot.target.trigger(evt, ins);
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -186,8 +186,8 @@
186
186
  elem.style.width = w;
187
187
  elem.style.height = h;
188
188
 
189
- elem = plot.canvasManager.initCanvas(elem);
190
-
189
+ elem = plot.canvasManager.initCanvas(elem);
190
+
191
191
  this._elem = $(elem);
192
192
  this._elem.css({ position: 'absolute'});
193
193
  this._elem.addClass('jqplot-'+this.axis+'-label');
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -235,13 +235,13 @@
235
235
  elem.style.height = h;
236
236
  elem.style.textAlign = 'left';
237
237
  elem.style.position = 'absolute';
238
-
239
- elem = plot.canvasManager.initCanvas(elem);
240
-
238
+
239
+ elem = plot.canvasManager.initCanvas(elem);
240
+
241
241
  this._elem = $(elem);
242
242
  this._elem.css(this._styles);
243
243
  this._elem.addClass('jqplot-'+this.axis+'-tick');
244
-
244
+
245
245
  elem = null;
246
246
  return this._elem;
247
247
  };
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -66,6 +66,9 @@
66
66
  case 'dashedVerticalLine':
67
67
  this.addDashedVerticalLine(obj[n]);
68
68
  break;
69
+ case 'rectangle':
70
+ this.addRectangle(obj[n]);
71
+ break;
69
72
  default:
70
73
  break;
71
74
  }
@@ -153,7 +156,41 @@
153
156
  tooltipFormatString: '%d, %d'
154
157
  };
155
158
  }
159
+
160
+
161
+ function Rectangle(options) {
162
+ LineBase.call(this);
163
+ this.type = 'rectangle';
164
+ var opts = {
165
+ // prop: xmin
166
+ // x value for the start of the line, null to scale to axis min.
167
+ xmin: null,
168
+ // prop: xmax
169
+ // x value for the end of the line, null to scale to axis max.
170
+ xmax: null,
171
+ // prop xOffset
172
+ // offset ends of the line inside the grid. Number
173
+ xOffset: '6px', // number or string. Number interpreted as units, string as pixels.
174
+ xminOffset: null,
175
+ xmaxOffset: null,
176
+
177
+ ymin: null,
178
+ ymax: null,
179
+ yOffset: '6px', // number or string. Number interpreted as units, string as pixels.
180
+ yminOffset: null,
181
+ ymaxOffset: null
182
+ };
183
+ $.extend(true, this.options, opts, options);
156
184
 
185
+ if (this.options.showTooltipPrecision < 0.01) {
186
+ this.options.showTooltipPrecision = 0.01;
187
+ }
188
+ }
189
+
190
+ Rectangle.prototype = new LineBase();
191
+ Rectangle.prototype.constructor = Rectangle;
192
+
193
+
157
194
  /**
158
195
  * Class: Line
159
196
  * A straight line.
@@ -338,6 +375,13 @@
338
375
  this.objectNames.push(line.options.name);
339
376
  };
340
377
 
378
+ $.jqplot.CanvasOverlay.prototype.addRectangle = function(opts) {
379
+ var line = new Rectangle(opts);
380
+ line.uid = objCounter++;
381
+ this.objects.push(line);
382
+ this.objectNames.push(line.options.name);
383
+ };
384
+
341
385
  $.jqplot.CanvasOverlay.prototype.removeObject = function(idx) {
342
386
  // check if integer, remove by index
343
387
  if ($.type(idx) == 'number') {
@@ -621,6 +665,80 @@
621
665
  }
622
666
  }
623
667
  break;
668
+
669
+ case 'rectangle':
670
+ // style and shadow properties should be set before
671
+ // every draw of marker renderer.
672
+ mr.style = 'line';
673
+ opts.closePath = true;
674
+
675
+ var xaxis = plot.axes[obj.options.xaxis],
676
+ xstart,
677
+ xstop,
678
+ y = plot.axes[obj.options.yaxis].series_u2p(obj.options.y),
679
+ xminoff = obj.options.xminOffset || obj.options.xOffset,
680
+ xmaxoff = obj.options.xmaxOffset || obj.options.xOffset;
681
+ if (obj.options.xmin != null) {
682
+ xstart = xaxis.series_u2p(obj.options.xmin);
683
+ }
684
+ else if (xminoff != null) {
685
+ if ($.type(xminoff) == "number") {
686
+ xstart = xaxis.series_u2p(xaxis.min + xminoff);
687
+ }
688
+ else if ($.type(xminoff) == "string") {
689
+ xstart = xaxis.series_u2p(xaxis.min) + parseFloat(xminoff);
690
+ }
691
+ }
692
+ if (obj.options.xmax != null) {
693
+ xstop = xaxis.series_u2p(obj.options.xmax);
694
+ }
695
+ else if (xmaxoff != null) {
696
+ if ($.type(xmaxoff) == "number") {
697
+ xstop = xaxis.series_u2p(xaxis.max - xmaxoff);
698
+ }
699
+ else if ($.type(xmaxoff) == "string") {
700
+ xstop = xaxis.series_u2p(xaxis.max) - parseFloat(xmaxoff);
701
+ }
702
+ }
703
+
704
+ var yaxis = plot.axes[obj.options.yaxis],
705
+ ystart,
706
+ ystop,
707
+ x = plot.axes[obj.options.xaxis].series_u2p(obj.options.x),
708
+ yminoff = obj.options.yminOffset || obj.options.yOffset,
709
+ ymaxoff = obj.options.ymaxOffset || obj.options.yOffset;
710
+ if (obj.options.ymin != null) {
711
+ ystart = yaxis.series_u2p(obj.options.ymin);
712
+ }
713
+ else if (yminoff != null) {
714
+ if ($.type(yminoff) == "number") {
715
+ ystart = yaxis.series_u2p(yaxis.min - yminoff);
716
+ }
717
+ else if ($.type(yminoff) == "string") {
718
+ ystart = yaxis.series_u2p(yaxis.min) - parseFloat(yminoff);
719
+ }
720
+ }
721
+ if (obj.options.ymax != null) {
722
+ ystop = yaxis.series_u2p(obj.options.ymax);
723
+ }
724
+ else if (ymaxoff != null) {
725
+ if ($.type(ymaxoff) == "number") {
726
+ ystop = yaxis.series_u2p(yaxis.max + ymaxoff);
727
+ }
728
+ else if ($.type(ymaxoff) == "string") {
729
+ ystop = yaxis.series_u2p(yaxis.max) + parseFloat(ymaxoff);
730
+ }
731
+ }
732
+
733
+
734
+ if (xstop != null && xstart != null && ystop != null && ystart != null) {
735
+ obj.gridStart = [xstart, ystart];
736
+ obj.gridStop = [xstop, ystop];
737
+
738
+ this.canvas._ctx.fillStyle = obj.options.color;
739
+ this.canvas._ctx.fillRect(xstart, ystart, xstop - xstart, ystop - ystart);
740
+ }
741
+ break;
624
742
 
625
743
  default:
626
744
  break;
@@ -738,6 +856,24 @@
738
856
  var ret = (res < eps) ? true : false;
739
857
  return ret;
740
858
  }
859
+
860
+ function isNearRectangle(point, lstart, lstop, width) {
861
+ // r is point to test, p and q are end points.
862
+ var rx = point[0];
863
+ var ry = point[1];
864
+ var px = Math.round(lstop[0]);
865
+ var py = Math.round(lstop[1]);
866
+ var qx = Math.round(lstart[0]);
867
+ var qy = Math.round(lstart[1]);
868
+
869
+ var temp;
870
+ if (px > qx) { temp = px; px = qx; qx = temp; }
871
+ if (py > qy) { temp = py; py = qy; qy = temp; }
872
+
873
+ var ret = (rx >= px && rx <= qx && ry >= py && ry <= qy);
874
+
875
+ return ret;
876
+ }
741
877
 
742
878
 
743
879
  function handleMove(ev, gridpos, datapos, neighbor, plot) {
@@ -749,7 +885,12 @@
749
885
  for (var i=0; i<l; i++) {
750
886
  obj = objs[i];
751
887
  if (obj.options.showTooltip) {
752
- var n = isNearLine([gridpos.x, gridpos.y], obj.gridStart, obj.gridStop, obj.tooltipWidthFactor);
888
+ var n;
889
+ if (obj.type === 'rectangle') {
890
+ n = isNearRectangle([gridpos.x, gridpos.y], obj.gridStart, obj.gridStop, obj.tooltipWidthFactor);
891
+ } else {
892
+ n = isNearLine([gridpos.x, gridpos.y], obj.gridStart, obj.gridStop, obj.tooltipWidthFactor);
893
+ }
753
894
  datapos = [plot.axes[obj.options.xaxis].series_p2u(gridpos.x), plot.axes[obj.options.yaxis].series_p2u(gridpos.y)];
754
895
 
755
896
  // cases:
@@ -775,6 +916,11 @@
775
916
  case 'dashedVerticalLine':
776
917
  showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
777
918
  break;
919
+
920
+ case 'rectangle':
921
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
922
+ break;
923
+
778
924
  default:
779
925
  break;
780
926
  }
@@ -809,6 +955,11 @@
809
955
  case 'dashedVerticalLine':
810
956
  showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
811
957
  break;
958
+
959
+ case 'rectangle':
960
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
961
+ break;
962
+
812
963
  default:
813
964
  break;
814
965
  }
@@ -834,6 +985,11 @@
834
985
  case 'dashedVerticalLine':
835
986
  showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
836
987
  break;
988
+
989
+ case 'rectangle':
990
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
991
+ break;
992
+
837
993
  default:
838
994
  break;
839
995
  }
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -211,7 +211,11 @@
211
211
  }
212
212
 
213
213
  if (isMerged && this.sortMergedLabels) {
214
- labels.sort(function(a,b) { return a - b; });
214
+ if (typeof labels[0] == "string") {
215
+ labels.sort();
216
+ } else {
217
+ labels.sort(function(a,b) { return a - b; });
218
+ }
215
219
  }
216
220
 
217
221
  // keep a reference to these tick labels to use for redrawing plot (see bug #57)
@@ -432,7 +436,7 @@
432
436
  var offmin = offsets.min;
433
437
  var lshow = (this._label == null) ? false : this._label.show;
434
438
  var i;
435
-
439
+
436
440
  for (var p in pos) {
437
441
  this._elem.css(p, pos[p]);
438
442
  }
@@ -564,11 +568,12 @@
564
568
  }
565
569
 
566
570
  // draw the group labels
567
- var step = parseInt(this._ticks.length/this.groups, 10);
571
+ var step = parseInt(this._ticks.length/this.groups, 10) + 1;
568
572
  for (i=0; i<this._groupLabels.length; i++) {
569
573
  var mid = 0;
570
574
  var count = 0;
571
- for (var j=i*step; j<=(i+1)*step; j++) {
575
+ for (var j=i*step; j<(i+1)*step; j++) {
576
+ if (j >= this._ticks.length-1) continue; // the last tick does not exist as there is no other group in order to have an empty one.
572
577
  if (this._ticks[j]._elem && this._ticks[j].label != " ") {
573
578
  var t = this._ticks[j]._elem;
574
579
  var p = t.position();
@@ -648,11 +653,12 @@
648
653
  }
649
654
 
650
655
  // draw the group labels, position top here, do left after label position.
651
- var step = parseInt(this._ticks.length/this.groups, 10);
656
+ var step = parseInt(this._ticks.length/this.groups, 10) + 1; // step is one more than before as we don't want to have overlaps in loops
652
657
  for (i=0; i<this._groupLabels.length; i++) {
653
658
  var mid = 0;
654
659
  var count = 0;
655
- for (var j=i*step; j<=(i+1)*step; j++) {
660
+ for (var j=i*step; j<(i+1)*step; j++) { // j must never reach (i+1)*step as we don't want to have overlap between loops
661
+ if (j >= this._ticks.length-1) continue; // the last tick does not exist as there is no other group in order to have an empty one.
656
662
  if (this._ticks[j]._elem && this._ticks[j].label != " ") {
657
663
  var t = this._ticks[j]._elem;
658
664
  var p = t.position();
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -54,7 +54,7 @@
54
54
  $.jqplot.ciParser = function (data, plot) {
55
55
  var ret = [],
56
56
  line,
57
- temp,
57
+ temp,
58
58
  i, j, k, kk;
59
59
 
60
60
  if (typeof(data) == "string") {
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -654,7 +654,7 @@
654
654
 
655
655
  elem.css('left', x);
656
656
  elem.css('top', y);
657
- elem = null;
657
+ elem = null;
658
658
  }
659
659
 
660
660
  function positionTooltip(plot) {
@@ -1048,7 +1048,7 @@
1048
1048
  if (this.show) {
1049
1049
  var series = this._series, s;
1050
1050
  // make a table. one line label per row.
1051
- var elem = document.createElement('div');
1051
+ var elem = document.createElement('table');
1052
1052
  this._elem = $(elem);
1053
1053
  elem = null;
1054
1054
  this._elem.addClass('jqplot-legend jqplot-cursor-legend');
@@ -2,8 +2,8 @@
2
2
  * jqPlot
3
3
  * Pure JavaScript plotting plugin using jQuery
4
4
  *
5
- * Version: 1.0.7
6
- * Revision: 1224
5
+ * Version: 1.0.8
6
+ * Revision: 1250
7
7
  *
8
8
  * Copyright (c) 2009-2013 Chris Leonello
9
9
  * jqPlot is currently available for use in all personal or commercial projects
@@ -480,7 +480,7 @@
480
480
  }
481
481
 
482
482
  // If tickInterval is specified, we'll try to honor it.
483
- // Not gauranteed to get this interval, but we'll get as close as
483
+ // Not guaranteed to get this interval, but we'll get as close as
484
484
  // we can.
485
485
  // tickInterval will be used before numberTicks, that is if
486
486
  // both are specified, numberTicks will be ignored.
@@ -489,7 +489,7 @@
489
489
  }
490
490
 
491
491
  // if numberTicks specified, try to honor it.
492
- // Not gauranteed, but will try to get close.
492
+ // Not guaranteed, but will try to get close.
493
493
  else if (this.numberTicks) {
494
494
  nttarget = this.numberTicks;
495
495
  titarget = (max - min) / (nttarget - 1);