highcharts-rails 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,8 @@
24
24
  PieSeries = seriesTypes.pie,
25
25
  ColumnSeries = seriesTypes.column,
26
26
  fireEvent = HighchartsAdapter.fireEvent,
27
- inArray = HighchartsAdapter.inArray;
27
+ inArray = HighchartsAdapter.inArray,
28
+ dupes = [];
28
29
 
29
30
  // Utilities
30
31
  function tweenColors(startColor, endColor, pos) {
@@ -112,10 +113,10 @@
112
113
  if (series.xAxis === xAxis) {
113
114
  levelSeries.push(series);
114
115
  levelSeriesOptions.push(series.userOptions);
115
- series.levelNumber = series.levelNumber || 0;
116
+ series.levelNumber = series.levelNumber || levelNumber; // #3182
116
117
  }
117
118
  });
118
-
119
+
119
120
  // Add a record of properties for each drilldown level
120
121
  level = {
121
122
  levelNumber: levelNumber,
@@ -159,26 +160,33 @@
159
160
 
160
161
  Chart.prototype.applyDrilldown = function () {
161
162
  var drilldownLevels = this.drilldownLevels,
162
- levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
163
+ levelToRemove;
163
164
 
164
- each(this.drilldownLevels, function (level) {
165
- if (level.levelNumber === levelToRemove) {
166
- each(level.levelSeries, function (series) {
167
- if (series.levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
168
- series.remove(false);
169
- }
170
- });
171
- }
172
- });
165
+ if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
166
+ levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
167
+ each(this.drilldownLevels, function (level) {
168
+ if (level.levelNumber === levelToRemove) {
169
+ each(level.levelSeries, function (series) {
170
+ if (series.levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
171
+ series.remove(false);
172
+ }
173
+ });
174
+ }
175
+ });
176
+ }
173
177
 
174
178
  this.redraw();
175
179
  this.showDrillUpButton();
176
180
  };
177
181
 
178
182
  Chart.prototype.getDrilldownBackText = function () {
179
- var lastLevel = this.drilldownLevels[this.drilldownLevels.length - 1];
180
- lastLevel.series = lastLevel.seriesOptions;
181
- return format(this.options.lang.drillUpText, lastLevel);
183
+ var drilldownLevels = this.drilldownLevels,
184
+ lastLevel;
185
+ if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
186
+ lastLevel = drilldownLevels[drilldownLevels.length - 1];
187
+ lastLevel.series = lastLevel.seriesOptions;
188
+ return format(this.options.lang.drillUpText, lastLevel);
189
+ }
182
190
 
183
191
  };
184
192
 
@@ -300,6 +308,8 @@
300
308
  })
301
309
  .align();
302
310
  }
311
+
312
+ dupes.length = []; // #3315
303
313
  };
304
314
 
305
315
 
@@ -480,8 +490,9 @@
480
490
  seriesOptions;
481
491
 
482
492
  while (i-- && !seriesOptions) {
483
- if (drilldown.series[i].id === this.drilldown) {
493
+ if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, dupes) === -1) {
484
494
  seriesOptions = drilldown.series[i];
495
+ dupes.push(this.drilldown);
485
496
  }
486
497
  }
487
498
 
@@ -510,15 +521,23 @@
510
521
 
511
522
  if (point.drilldown) {
512
523
 
513
- // Add the click event to the point label
524
+ // Add the click event to the point
514
525
  H.addEvent(point, 'click', function () {
515
526
  point.doDrilldown();
516
527
  });
517
-
528
+ /*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
529
+ if (!this.hasImportedEvents) {
530
+ proceed.call(this);
531
+ H.addEvent(this, 'click', function () {
532
+ this.doDrilldown();
533
+ });
534
+ }
535
+ });*/
536
+
518
537
  // Make axis labels clickable
519
538
  if (tickLabel) {
520
- if (!tickLabel._basicStyle) {
521
- tickLabel._basicStyle = tickLabel.element.getAttribute('style');
539
+ if (!tickLabel.basicStyles) {
540
+ tickLabel.basicStyles = H.merge(tickLabel.styles);
522
541
  }
523
542
  tickLabel
524
543
  .addClass('highcharts-drilldown-axis-label')
@@ -537,8 +556,9 @@
537
556
  tickLabel.ddPoints.push(point);
538
557
 
539
558
  }
540
- } else if (tickLabel && tickLabel._basicStyle) {
541
- tickLabel.element.setAttribute('style', tickLabel._basicStyle);
559
+ } else if (tickLabel && tickLabel.basicStyles) {
560
+ tickLabel.styles = {}; // reset for full overwrite of styles
561
+ tickLabel.css(tickLabel.basicStyles);
542
562
  }
543
563
 
544
564
  return point;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.0.3 (2014-07-03)
2
+ * @license Highcharts JS v4.0.4 (2014-09-02)
3
3
  * Exporting module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -74,7 +74,7 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
74
74
  cumulative = 0, // start at top
75
75
  center = options.center,
76
76
  centerX = getLength(center[0], plotWidth),
77
- centerY = getLength(center[0], plotHeight),
77
+ centerY = getLength(center[1], plotHeight),
78
78
  width = getLength(options.width, plotWidth),
79
79
  tempWidth,
80
80
  getWidthAt,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.0.3 (2014-07-03)
2
+ * @license Highcharts JS v4.0.4 (2014-09-02)
3
3
  *
4
4
  * (c) 2011-2014 Torstein Honsi
5
5
  *
@@ -109,14 +109,15 @@ extend(ColorAxis.prototype, {
109
109
  Math.round(to.rgba[1] + (from.rgba[1] - to.rgba[1]) * (1 - pos)) + ',' +
110
110
  Math.round(to.rgba[2] + (from.rgba[2] - to.rgba[2]) * (1 - pos)) +
111
111
  (hasAlpha ? (',' + (to.rgba[3] + (from.rgba[3] - to.rgba[3]) * (1 - pos))) : '') + ')';
112
- },
112
+ },
113
113
 
114
114
  initDataClasses: function (userOptions) {
115
115
  var axis = this,
116
116
  chart = this.chart,
117
117
  dataClasses,
118
118
  colorCounter = 0,
119
- options = this.options;
119
+ options = this.options,
120
+ len = userOptions.dataClasses.length;
120
121
  this.dataClasses = dataClasses = [];
121
122
  this.legendItems = [];
122
123
 
@@ -134,7 +135,11 @@ extend(ColorAxis.prototype, {
134
135
  colorCounter = 0;
135
136
  }
136
137
  } else {
137
- dataClass.color = axis.tweenColors(Color(options.minColor), Color(options.maxColor), i / (userOptions.dataClasses.length - 1));
138
+ dataClass.color = axis.tweenColors(
139
+ Color(options.minColor),
140
+ Color(options.maxColor),
141
+ len < 2 ? 0.5 : i / (len - 1) // #3219
142
+ );
138
143
  }
139
144
  }
140
145
  });
@@ -436,7 +441,14 @@ extend(ColorAxis.prototype, {
436
441
  name: '' // Prevents 'undefined' in legend in IE8
437
442
  });
438
443
 
439
-
444
+ /**
445
+ * Handle animation of the color attributes directly
446
+ */
447
+ each(['fill', 'stroke'], function (prop) {
448
+ HighchartsAdapter.addAnimSetter(prop, function (fx) {
449
+ fx.elem.attr(prop, ColorAxis.prototype.tweenColors(Color(fx.start), Color(fx.end), fx.pos));
450
+ });
451
+ });
440
452
 
441
453
  /**
442
454
  * Extend the chart getAxes method to also get the color axis
@@ -650,7 +662,7 @@ seriesTypes.heatmap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, {
650
662
  // Make sure colors are updated on colorAxis update (#2893)
651
663
  if (this.chart.hasRendered) {
652
664
  each(series.points, function (point) {
653
- point.shapeArgs.fill = point.color;
665
+ point.shapeArgs.fill = point.options.color || point.color; // #3311
654
666
  });
655
667
  }
656
668
  },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.0.3 (2014-07-03)
2
+ * @license Highcharts JS v4.0.4 (2014-09-02)
3
3
  * Plugin for displaying a message when there is no data visible in chart.
4
4
  *
5
5
  * (c) 2010-2014 Highsoft AS
@@ -8,7 +8,7 @@
8
8
  * License: www.highcharts.com/license
9
9
  */
10
10
 
11
- (function (H) { // docs
11
+ (function (H) {
12
12
 
13
13
  var seriesTypes = H.seriesTypes,
14
14
  chartPrototype = H.Chart.prototype,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.0.3 (2014-07-03)
2
+ * @license Highcharts JS v4.0.4 (2014-09-02)
3
3
  * Solid angular gauge module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -1,3 +1,3 @@
1
1
  module Highcharts
2
- VERSION = "4.0.3"
2
+ VERSION = "4.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highcharts-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken