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.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +36 -0
- data/app/assets/javascripts/highcharts.js +147 -106
- data/app/assets/javascripts/highcharts/adapters/standalone-framework.js +17 -4
- data/app/assets/javascripts/highcharts/highcharts-3d.js +68 -37
- data/app/assets/javascripts/highcharts/highcharts-more.js +3 -4
- data/app/assets/javascripts/highcharts/modules/canvas-tools.js +1 -1
- data/app/assets/javascripts/highcharts/modules/data.js +476 -73
- data/app/assets/javascripts/highcharts/modules/drilldown.js +43 -23
- data/app/assets/javascripts/highcharts/modules/exporting.js +1 -1
- data/app/assets/javascripts/highcharts/modules/funnel.js +1 -1
- data/app/assets/javascripts/highcharts/modules/heatmap.js +18 -6
- data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +2 -2
- data/app/assets/javascripts/highcharts/modules/solid-gauge.js +1 -1
- data/lib/highcharts/version.rb +1 -1
- metadata +1 -1
@@ -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 ||
|
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
|
163
|
+
levelToRemove;
|
163
164
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
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
|
180
|
-
|
181
|
-
|
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
|
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.
|
521
|
-
tickLabel.
|
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.
|
541
|
-
tickLabel.
|
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;
|
@@ -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[
|
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.
|
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(
|
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.
|
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) {
|
11
|
+
(function (H) {
|
12
12
|
|
13
13
|
var seriesTypes = H.seriesTypes,
|
14
14
|
chartPrototype = H.Chart.prototype,
|
data/lib/highcharts/version.rb
CHANGED