highcharts-rails 4.1.6 → 4.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.6 (2015-06-12)
2
+ * @license Highcharts JS v4.1.7 (2015-06-26)
3
3
  *
4
4
  * Standalone Highcharts Framework
5
5
  *
@@ -2,7 +2,7 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license Highcharts JS v4.1.6 (2015-06-12)
5
+ * @license Highcharts JS v4.1.7 (2015-06-26)
6
6
  *
7
7
  * (c) 2009-2013 Torstein Hønsi
8
8
  *
@@ -542,7 +542,7 @@ Highcharts.SVGRenderer.prototype.arc3dPath = function (shapeArgs) {
542
542
  ***/
543
543
  // Shorthand to check the is3d flag
544
544
  Highcharts.Chart.prototype.is3d = function () {
545
- return !this.inverted && this.options.chart.options3d && this.options.chart.options3d.enabled; // #4160 3D should not work with inverted charts
545
+ return this.options.chart.options3d && this.options.chart.options3d.enabled; // #4280
546
546
  };
547
547
 
548
548
  Highcharts.wrap(Highcharts.Chart.prototype, 'isInsidePlot', function (proceed) {
@@ -1232,34 +1232,33 @@ Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'translate', function (pro
1232
1232
  z: options3d.depth
1233
1233
  },
1234
1234
  alpha = options3d.alpha,
1235
- beta = options3d.beta;
1235
+ beta = options3d.beta,
1236
+ z = seriesOptions.stacking ? (seriesOptions.stack || 0) * depth : series._i * depth;
1236
1237
 
1237
- var z = seriesOptions.stacking ? (seriesOptions.stack || 0) * depth : series._i * depth;
1238
1238
  z += depth / 2;
1239
1239
 
1240
1240
  if (seriesOptions.grouping !== false) { z = 0; }
1241
1241
 
1242
1242
  Highcharts.each(series.data, function (point) {
1243
+
1244
+ var shapeArgs = point.shapeArgs,
1245
+ angle;
1246
+
1243
1247
  point.shapeType = 'arc3d';
1244
- var shapeArgs = point.shapeArgs;
1245
1248
 
1246
- if (point.y) { // will be false if null or 0 #3006
1247
- shapeArgs.z = z;
1248
- shapeArgs.depth = depth * 0.75;
1249
- shapeArgs.origin = origin;
1250
- shapeArgs.alpha = alpha;
1251
- shapeArgs.beta = beta;
1252
- shapeArgs.center = series.center;
1253
-
1254
- var angle = (shapeArgs.end + shapeArgs.start) / 2;
1249
+ shapeArgs.z = z;
1250
+ shapeArgs.depth = depth * 0.75;
1251
+ shapeArgs.origin = origin;
1252
+ shapeArgs.alpha = alpha;
1253
+ shapeArgs.beta = beta;
1254
+ shapeArgs.center = series.center;
1255
+
1256
+ angle = (shapeArgs.end + shapeArgs.start) / 2;
1255
1257
 
1256
- point.slicedTranslation = {
1257
- translateX : round(cos(angle) * series.options.slicedOffset * cos(alpha * deg2rad)),
1258
- translateY : round(sin(angle) * series.options.slicedOffset * cos(alpha * deg2rad))
1259
- };
1260
- } else {
1261
- shapeArgs = null;
1262
- }
1258
+ point.slicedTranslation = {
1259
+ translateX : round(cos(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad)),
1260
+ translateY : round(sin(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad))
1261
+ };
1263
1262
  });
1264
1263
  });
1265
1264
 
@@ -1269,11 +1268,13 @@ Highcharts.wrap(Highcharts.seriesTypes.pie.prototype.pointClass.prototype, 'halo
1269
1268
  });
1270
1269
 
1271
1270
  Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawPoints', function (proceed) {
1271
+
1272
+ var seriesGroup = this.group,
1273
+ options = this.options,
1274
+ states = options.states;
1275
+
1272
1276
  // Do not do this if the chart is not 3D
1273
1277
  if (this.chart.is3d()) {
1274
- var options = this.options,
1275
- states = this.options.states;
1276
-
1277
1278
  // Set the border color to the fill color to provide a smooth edge
1278
1279
  this.borderWidth = options.borderWidth = options.edgeWidth || 1;
1279
1280
  this.borderColor = options.edgeColor = Highcharts.pick(options.edgeColor, options.borderColor, undefined);
@@ -1297,12 +1298,16 @@ Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawPoints', function (pr
1297
1298
  proceed.apply(this, [].slice.call(arguments, 1));
1298
1299
 
1299
1300
  if (this.chart.is3d()) {
1300
- var seriesGroup = this.group;
1301
1301
  Highcharts.each(this.points, function (point) {
1302
- point.graphic.out.add(seriesGroup);
1303
- point.graphic.inn.add(seriesGroup);
1304
- point.graphic.side1.add(seriesGroup);
1305
- point.graphic.side2.add(seriesGroup);
1302
+ var graphic = point.graphic;
1303
+
1304
+ graphic.out.add(seriesGroup);
1305
+ graphic.inn.add(seriesGroup);
1306
+ graphic.side1.add(seriesGroup);
1307
+ graphic.side2.add(seriesGroup);
1308
+
1309
+ // Hide null or 0 points (#3006, 3650)
1310
+ graphic[point.y ? 'show' : 'hide']();
1306
1311
  });
1307
1312
  }
1308
1313
  });
@@ -2,7 +2,7 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license Highcharts JS v4.1.6 (2015-06-12)
5
+ * @license Highcharts JS v4.1.7 (2015-06-26)
6
6
  *
7
7
  * (c) 2009-2014 Torstein Honsi
8
8
  *
@@ -60,11 +60,8 @@ extend(Pane.prototype, {
60
60
 
61
61
  pane.chart = chart;
62
62
 
63
- // Set options
64
- if (chart.angular) { // gauges
65
- defaultOptions.background = {}; // gets extended by this.defaultBackgroundOptions
66
- }
67
- pane.options = options = merge(defaultOptions, options);
63
+ // Set options. Angular charts have a default background (#3318)
64
+ pane.options = options = merge(defaultOptions, chart.angular ? { background: {} } : undefined, options);
68
65
 
69
66
  backgroundOption = options.background;
70
67
 
@@ -841,27 +838,29 @@ seriesTypes.arearange = extendClass(seriesTypes.area, {
841
838
  i = length;
842
839
  while (i--) {
843
840
  point = data[i];
844
- up = point.plotHigh > point.plotLow;
845
-
846
- // Set preliminary values
847
- point.y = point.high;
848
- point._plotY = point.plotY;
849
- point.plotY = point.plotHigh;
850
-
851
- // Store original data labels and set preliminary label objects to be picked up
852
- // in the uber method
853
- originalDataLabels[i] = point.dataLabel;
854
- point.dataLabel = point.dataLabelUpper;
855
-
856
- // Set the default offset
857
- point.below = up;
858
- if (inverted) {
859
- if (!align) {
860
- dataLabelOptions.align = up ? 'right' : 'left';
841
+ if (point) {
842
+ up = point.plotHigh > point.plotLow;
843
+
844
+ // Set preliminary values
845
+ point.y = point.high;
846
+ point._plotY = point.plotY;
847
+ point.plotY = point.plotHigh;
848
+
849
+ // Store original data labels and set preliminary label objects to be picked up
850
+ // in the uber method
851
+ originalDataLabels[i] = point.dataLabel;
852
+ point.dataLabel = point.dataLabelUpper;
853
+
854
+ // Set the default offset
855
+ point.below = up;
856
+ if (inverted) {
857
+ if (!align) {
858
+ dataLabelOptions.align = up ? 'right' : 'left';
859
+ }
860
+ dataLabelOptions.x = dataLabelOptions.xHigh;
861
+ } else {
862
+ dataLabelOptions.y = dataLabelOptions.yHigh;
861
863
  }
862
- dataLabelOptions.x = dataLabelOptions.xHigh;
863
- } else {
864
- dataLabelOptions.y = dataLabelOptions.yHigh;
865
864
  }
866
865
  }
867
866
 
@@ -873,25 +872,27 @@ seriesTypes.arearange = extendClass(seriesTypes.area, {
873
872
  i = length;
874
873
  while (i--) {
875
874
  point = data[i];
876
- up = point.plotHigh > point.plotLow;
877
-
878
- // Move the generated labels from step 1, and reassign the original data labels
879
- point.dataLabelUpper = point.dataLabel;
880
- point.dataLabel = originalDataLabels[i];
881
-
882
- // Reset values
883
- point.y = point.low;
884
- point.plotY = point._plotY;
885
-
886
- // Set the default offset
887
- point.below = !up;
888
- if (inverted) {
889
- if (!align) {
890
- dataLabelOptions.align = up ? 'left' : 'right';
875
+ if (point) {
876
+ up = point.plotHigh > point.plotLow;
877
+
878
+ // Move the generated labels from step 1, and reassign the original data labels
879
+ point.dataLabelUpper = point.dataLabel;
880
+ point.dataLabel = originalDataLabels[i];
881
+
882
+ // Reset values
883
+ point.y = point.low;
884
+ point.plotY = point._plotY;
885
+
886
+ // Set the default offset
887
+ point.below = !up;
888
+ if (inverted) {
889
+ if (!align) {
890
+ dataLabelOptions.align = up ? 'left' : 'right';
891
+ }
892
+ dataLabelOptions.x = dataLabelOptions.xLow;
893
+ } else {
894
+ dataLabelOptions.y = dataLabelOptions.yLow;
891
895
  }
892
- dataLabelOptions.x = dataLabelOptions.xLow;
893
- } else {
894
- dataLabelOptions.y = dataLabelOptions.yLow;
895
896
  }
896
897
  }
897
898
  if (seriesProto.drawDataLabels) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Highcharts JS v4.1.6 (2015-06-12)
2
+ * Highcharts JS v4.1.7 (2015-06-26)
3
3
  * Highcharts Broken Axis module
4
4
  *
5
5
  * Author: Stephane Vanraes, Torstein Honsi
@@ -37,29 +37,32 @@
37
37
  },
38
38
 
39
39
  isInAnyBreak: function (val, testKeep) {
40
- // Sanity Check
41
- if (!this.options.breaks) { return false; }
42
40
 
43
41
  var breaks = this.options.breaks,
44
- i = breaks.length,
45
- inbrk = false,
46
- keep = false;
42
+ i = breaks && breaks.length,
43
+ inbrk,
44
+ keep,
45
+ ret;
47
46
 
48
-
49
- while (i--) {
50
- if (this.isInBreak(breaks[i], val)) {
51
- inbrk = true;
52
- if (!keep) {
53
- keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
47
+
48
+ if (i) {
49
+
50
+ while (i--) {
51
+ if (this.isInBreak(breaks[i], val)) {
52
+ inbrk = true;
53
+ if (!keep) {
54
+ keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
55
+ }
54
56
  }
55
57
  }
56
- }
57
58
 
58
- if (inbrk && testKeep) {
59
- return inbrk && !keep;
60
- } else {
61
- return inbrk;
59
+ if (inbrk && testKeep) {
60
+ ret = inbrk && !keep;
61
+ } else {
62
+ ret = inbrk;
63
+ }
62
64
  }
65
+ return ret;
63
66
  }
64
67
  });
65
68
 
@@ -110,7 +113,7 @@
110
113
  for (i = 0; i < axis.breakArray.length; i++) {
111
114
  brk = axis.breakArray[i];
112
115
  if (brk.to <= val) {
113
- nval -= (brk.len);
116
+ nval -= brk.len;
114
117
  } else if (brk.from >= val) {
115
118
  break;
116
119
  } else if (axis.isInBreak(brk, val)) {
@@ -132,12 +135,11 @@
132
135
  if (brk.from >= nval) {
133
136
  break;
134
137
  } else if (brk.to < nval) {
135
- nval += (brk.to - brk.from);
138
+ nval += brk.len;
136
139
  } else if (axis.isInBreak(brk, nval)) {
137
- nval += (brk.to - brk.from);
140
+ nval += brk.len;
138
141
  }
139
142
  }
140
-
141
143
  return nval;
142
144
  };
143
145
 
@@ -256,14 +258,17 @@
256
258
  yAxis = series.yAxis,
257
259
  points = series.points,
258
260
  point,
259
- i = points.length;
261
+ i = points.length,
262
+ connectNulls = series.options.connectNulls,
263
+ nullGap;
260
264
 
261
265
 
262
266
  if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
263
267
  while (i--) {
264
268
  point = points[i];
265
269
 
266
- if (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true)) {
270
+ nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
271
+ if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
267
272
  points.splice(i, 1);
268
273
  if (this.data[i]) {
269
274
  this.data[i].destroyElements(); // removes the graphics for this point if they exist
@@ -2908,7 +2908,7 @@ if (CanvasRenderingContext2D) {
2908
2908
  });
2909
2909
  }
2910
2910
  }/**
2911
- * @license Highcharts JS v4.1.6 (2015-06-12)
2911
+ * @license Highcharts JS v4.1.7 (2015-06-26)
2912
2912
  * CanVGRenderer Extension module
2913
2913
  *
2914
2914
  * (c) 2011-2012 Torstein Honsi, Erik Olsson
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.6 (2015-06-12)
2
+ * @license Highcharts JS v4.1.7 (2015-06-26)
3
3
  * Data module
4
4
  *
5
5
  * (c) 2012-2014 Torstein Honsi
@@ -642,7 +642,11 @@
642
642
 
643
643
  // Add the click event to the point
644
644
  H.addEvent(point, 'click', function () {
645
- point.doDrilldown();
645
+ if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
646
+ series.xAxis.drilldownCategory(x);
647
+ } else {
648
+ point.doDrilldown();
649
+ }
646
650
  });
647
651
  /*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
648
652
  if (!this.hasImportedEvents) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.6 (2015-06-12)
2
+ * @license Highcharts JS v4.1.7 (2015-06-26)
3
3
  * Exporting module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -220,10 +220,11 @@ extend(Chart.prototype, {
220
220
 
221
221
  // IE specific
222
222
  .replace(/<IMG /g, '<image ')
223
+ .replace(/<(\/?)TITLE>/g, '<$1title>')
223
224
  .replace(/height=([^" ]+)/g, 'height="$1"')
224
225
  .replace(/width=([^" ]+)/g, 'width="$1"')
225
226
  .replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
226
- .replace(/ id=([^" >]+)/g, 'id="$1"') // #4003
227
+ .replace(/ id=([^" >]+)/g, ' id="$1"') // #4003
227
228
  .replace(/class=([^" >]+)/g, 'class="$1"')
228
229
  .replace(/ transform /g, ' ')
229
230
  .replace(/:(path|rect)/g, '$1')
@@ -69,6 +69,7 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
69
69
  chart = series.chart,
70
70
  options = series.options,
71
71
  reversed = options.reversed,
72
+ ignoreHiddenPoint = options.ignoreHiddenPoint,
72
73
  plotWidth = chart.plotWidth,
73
74
  plotHeight = chart.plotHeight,
74
75
  cumulative = 0, // start at top
@@ -133,7 +134,9 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
133
134
 
134
135
  // get the total sum
135
136
  each(data, function (point) {
136
- sum += point.y;
137
+ if (!ignoreHiddenPoint || point.visible !== false) {
138
+ sum += point.y;
139
+ }
137
140
  });
138
141
 
139
142
  each(data, function (point) {
@@ -206,7 +209,9 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
206
209
  // Mimicking pie data label placement logic
207
210
  point.half = half;
208
211
 
209
- cumulative += fraction;
212
+ if (!ignoreHiddenPoint || point.visible !== false) {
213
+ cumulative += fraction;
214
+ }
210
215
  });
211
216
  },
212
217
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.6 (2015-06-12)
2
+ * @license Highcharts JS v4.1.7 (2015-06-26)
3
3
  *
4
4
  * (c) 2011-2014 Torstein Honsi
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.6 (2015-06-12)
2
+ * @license Highcharts JS v4.1.7 (2015-06-26)
3
3
  * Plugin for displaying a message when there is no data visible in chart.
4
4
  *
5
5
  * (c) 2010-2014 Highsoft AS
@@ -36,6 +36,7 @@
36
36
  fontSize: '12px',
37
37
  color: '#60606a'
38
38
  }
39
+ // useHTML: false // docs
39
40
  };
40
41
 
41
42
  /**
@@ -67,7 +68,18 @@
67
68
  noDataOptions = options.noData;
68
69
 
69
70
  if (!chart.noDataLabel) {
70
- chart.noDataLabel = chart.renderer.label(text, 0, 0, null, null, null, null, null, 'no-data')
71
+ chart.noDataLabel = chart.renderer
72
+ .label(
73
+ text,
74
+ 0,
75
+ 0,
76
+ null,
77
+ null,
78
+ null,
79
+ noDataOptions.useHTML,
80
+ null,
81
+ 'no-data'
82
+ )
71
83
  .attr(noDataOptions.attr)
72
84
  .css(noDataOptions.style)
73
85
  .add();