highcharts-rails 4.2.7 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +34 -0
- data/Gemfile +4 -0
- data/Rakefile +53 -32
- data/app/assets/javascripts/highcharts.js +18775 -17176
- data/app/assets/javascripts/highcharts/highcharts-3d.js +1849 -1563
- data/app/assets/javascripts/highcharts/highcharts-more.js +2162 -1988
- data/app/assets/javascripts/highcharts/modules/accessibility.js +1005 -0
- data/app/assets/javascripts/highcharts/modules/annotations.js +408 -401
- data/app/assets/javascripts/highcharts/modules/boost.js +561 -546
- data/app/assets/javascripts/highcharts/modules/broken-axis.js +330 -324
- data/app/assets/javascripts/highcharts/modules/data.js +973 -965
- data/app/assets/javascripts/highcharts/modules/drilldown.js +783 -723
- data/app/assets/javascripts/highcharts/modules/exporting.js +864 -785
- data/app/assets/javascripts/highcharts/modules/funnel.js +290 -306
- data/app/assets/javascripts/highcharts/modules/heatmap.js +701 -645
- data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +150 -132
- data/app/assets/javascripts/highcharts/modules/offline-exporting.js +414 -355
- data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +164 -0
- data/app/assets/javascripts/highcharts/modules/series-label.js +473 -448
- data/app/assets/javascripts/highcharts/modules/solid-gauge.js +279 -271
- data/app/assets/javascripts/highcharts/modules/treemap.js +921 -886
- data/app/assets/javascripts/highcharts/themes/dark-blue.js +307 -244
- data/app/assets/javascripts/highcharts/themes/dark-green.js +303 -244
- data/app/assets/javascripts/highcharts/themes/dark-unica.js +231 -201
- data/app/assets/javascripts/highcharts/themes/gray.js +314 -245
- data/app/assets/javascripts/highcharts/themes/grid-light.js +91 -66
- data/app/assets/javascripts/highcharts/themes/grid.js +124 -96
- data/app/assets/javascripts/highcharts/themes/sand-signika.js +119 -94
- data/app/assets/javascripts/highcharts/themes/skies.js +108 -85
- data/lib/highcharts/version.rb +1 -1
- metadata +13 -14
- data/app/assets/javascripts/highcharts/adapters/standalone-framework.js +0 -1
- data/app/assets/javascripts/highcharts/modules/canvas-tools.js +0 -3115
- data/app/assets/javascripts/highcharts/modules/map.js +0 -2117
@@ -1,279 +1,287 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS
|
2
|
+
* @license Highcharts JS v5.0.0 (2016-09-29)
|
3
3
|
* Solid angular gauge module
|
4
4
|
*
|
5
5
|
* (c) 2010-2016 Torstein Honsi
|
6
6
|
*
|
7
7
|
* License: www.highcharts.com/license
|
8
8
|
*/
|
9
|
-
|
10
|
-
(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
9
|
+
(function(factory) {
|
10
|
+
if (typeof module === 'object' && module.exports) {
|
11
|
+
module.exports = factory;
|
12
|
+
} else {
|
13
|
+
factory(Highcharts);
|
14
|
+
}
|
15
|
+
}(function(Highcharts) {
|
16
|
+
(function(H) {
|
17
|
+
/**
|
18
|
+
* Solid angular gauge module
|
19
|
+
*
|
20
|
+
* (c) 2010-2016 Torstein Honsi
|
21
|
+
*
|
22
|
+
* License: www.highcharts.com/license
|
23
|
+
*/
|
24
|
+
|
25
|
+
'use strict';
|
26
|
+
var pInt = H.pInt,
|
27
|
+
pick = H.pick,
|
28
|
+
each = H.each,
|
29
|
+
isNumber = H.isNumber,
|
30
|
+
colorAxisMethods;
|
31
|
+
|
32
|
+
// These methods are defined in the ColorAxis object, and copied here.
|
33
|
+
// If we implement an AMD system we should make ColorAxis a dependency.
|
34
|
+
colorAxisMethods = {
|
35
|
+
|
36
|
+
|
37
|
+
initDataClasses: function(userOptions) {
|
38
|
+
var axis = this,
|
39
|
+
chart = this.chart,
|
40
|
+
dataClasses,
|
41
|
+
colorCounter = 0,
|
42
|
+
options = this.options;
|
43
|
+
this.dataClasses = dataClasses = [];
|
44
|
+
|
45
|
+
each(userOptions.dataClasses, function(dataClass, i) {
|
46
|
+
var colors;
|
47
|
+
|
48
|
+
dataClass = H.merge(dataClass);
|
49
|
+
dataClasses.push(dataClass);
|
50
|
+
if (!dataClass.color) {
|
51
|
+
if (options.dataClassColor === 'category') {
|
52
|
+
colors = chart.options.colors;
|
53
|
+
dataClass.color = colors[colorCounter++];
|
54
|
+
// loop back to zero
|
55
|
+
if (colorCounter === colors.length) {
|
56
|
+
colorCounter = 0;
|
57
|
+
}
|
58
|
+
} else {
|
59
|
+
dataClass.color = axis.tweenColors(H.color(options.minColor), H.color(options.maxColor), i / (userOptions.dataClasses.length - 1));
|
60
|
+
}
|
61
|
+
}
|
62
|
+
});
|
63
|
+
},
|
64
|
+
|
65
|
+
initStops: function(userOptions) {
|
66
|
+
this.stops = userOptions.stops || [
|
67
|
+
[0, this.options.minColor],
|
68
|
+
[1, this.options.maxColor]
|
69
|
+
];
|
70
|
+
each(this.stops, function(stop) {
|
71
|
+
stop.color = H.color(stop[1]);
|
72
|
+
});
|
73
|
+
},
|
74
|
+
/**
|
75
|
+
* Translate from a value to a color
|
76
|
+
*/
|
77
|
+
toColor: function(value, point) {
|
78
|
+
var pos,
|
79
|
+
stops = this.stops,
|
80
|
+
from,
|
81
|
+
to,
|
82
|
+
color,
|
83
|
+
dataClasses = this.dataClasses,
|
84
|
+
dataClass,
|
85
|
+
i;
|
86
|
+
|
87
|
+
if (dataClasses) {
|
88
|
+
i = dataClasses.length;
|
89
|
+
while (i--) {
|
90
|
+
dataClass = dataClasses[i];
|
91
|
+
from = dataClass.from;
|
92
|
+
to = dataClass.to;
|
93
|
+
if ((from === undefined || value >= from) && (to === undefined || value <= to)) {
|
94
|
+
color = dataClass.color;
|
95
|
+
if (point) {
|
96
|
+
point.dataClass = i;
|
97
|
+
}
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
} else {
|
103
|
+
|
104
|
+
if (this.isLog) {
|
105
|
+
value = this.val2lin(value);
|
106
|
+
}
|
107
|
+
pos = 1 - ((this.max - value) / (this.max - this.min));
|
108
|
+
i = stops.length;
|
109
|
+
while (i--) {
|
110
|
+
if (pos > stops[i][0]) {
|
111
|
+
break;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
from = stops[i] || stops[i + 1];
|
115
|
+
to = stops[i + 1] || from;
|
116
|
+
|
117
|
+
// The position within the gradient
|
118
|
+
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
|
119
|
+
|
120
|
+
color = this.tweenColors(
|
121
|
+
from.color,
|
122
|
+
to.color,
|
123
|
+
pos
|
124
|
+
);
|
125
|
+
}
|
126
|
+
return color;
|
127
|
+
},
|
128
|
+
/*
|
129
|
+
* Return an intermediate color between two colors, according to pos where 0
|
130
|
+
* is the from color and 1 is the to color.
|
131
|
+
*/
|
132
|
+
tweenColors: function(from, to, pos) {
|
133
|
+
// Check for has alpha, because rgba colors perform worse due to lack of
|
134
|
+
// support in WebKit.
|
135
|
+
var hasAlpha,
|
136
|
+
ret;
|
137
|
+
|
138
|
+
// Unsupported color, return to-color (#3920)
|
139
|
+
if (!to.rgba.length || !from.rgba.length) {
|
140
|
+
ret = to.input || 'none';
|
141
|
+
|
142
|
+
// Interpolate
|
143
|
+
} else {
|
144
|
+
from = from.rgba;
|
145
|
+
to = to.rgba;
|
146
|
+
hasAlpha = (to[3] !== 1 || from[3] !== 1);
|
147
|
+
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
|
148
|
+
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
|
149
|
+
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
|
150
|
+
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
|
151
|
+
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
|
152
|
+
}
|
153
|
+
return ret;
|
154
|
+
}
|
155
|
+
};
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Handle animation of the color attributes directly
|
159
|
+
*/
|
160
|
+
each(['fill', 'stroke'], function(prop) {
|
161
|
+
H.Fx.prototype[prop + 'Setter'] = function() {
|
162
|
+
this.elem.attr(prop, colorAxisMethods.tweenColors(H.color(this.start), H.color(this.end), this.pos));
|
163
|
+
};
|
164
|
+
});
|
165
|
+
|
166
|
+
// The solidgauge series type
|
167
|
+
H.seriesType('solidgauge', 'gauge', {
|
168
|
+
colorByPoint: true
|
169
|
+
|
170
|
+
}, {
|
171
|
+
bindAxes: function() {
|
172
|
+
var axis;
|
173
|
+
H.seriesTypes.gauge.prototype.bindAxes.call(this);
|
174
|
+
|
175
|
+
axis = this.yAxis;
|
176
|
+
H.extend(axis, colorAxisMethods);
|
177
|
+
|
178
|
+
// Prepare data classes
|
179
|
+
if (axis.options.dataClasses) {
|
180
|
+
axis.initDataClasses(axis.options);
|
181
|
+
}
|
182
|
+
axis.initStops(axis.options);
|
183
|
+
},
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Draw the points where each point is one needle
|
187
|
+
*/
|
188
|
+
drawPoints: function() {
|
189
|
+
var series = this,
|
190
|
+
yAxis = series.yAxis,
|
191
|
+
center = yAxis.center,
|
192
|
+
options = series.options,
|
193
|
+
renderer = series.chart.renderer,
|
194
|
+
overshoot = options.overshoot,
|
195
|
+
overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0;
|
196
|
+
|
197
|
+
each(series.points, function(point) {
|
198
|
+
var graphic = point.graphic,
|
199
|
+
rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true),
|
200
|
+
radius = (pInt(pick(point.options.radius, options.radius, 100)) * center[2]) / 200,
|
201
|
+
innerRadius = (pInt(pick(point.options.innerRadius, options.innerRadius, 60)) * center[2]) / 200,
|
202
|
+
shapeArgs,
|
203
|
+
d,
|
204
|
+
toColor = yAxis.toColor(point.y, point),
|
205
|
+
axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
|
206
|
+
axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
|
207
|
+
minAngle,
|
208
|
+
maxAngle;
|
209
|
+
|
210
|
+
if (toColor === 'none') { // #3708
|
211
|
+
toColor = point.color || series.color || 'none';
|
212
|
+
}
|
213
|
+
if (toColor !== 'none') {
|
214
|
+
point.color = toColor;
|
215
|
+
}
|
216
|
+
|
217
|
+
// Handle overshoot and clipping to axis max/min
|
218
|
+
rotation = Math.max(axisMinAngle - overshootVal, Math.min(axisMaxAngle + overshootVal, rotation));
|
219
|
+
|
220
|
+
// Handle the wrap option
|
221
|
+
if (options.wrap === false) {
|
222
|
+
rotation = Math.max(axisMinAngle, Math.min(axisMaxAngle, rotation));
|
223
|
+
}
|
224
|
+
|
225
|
+
minAngle = Math.min(rotation, yAxis.startAngleRad);
|
226
|
+
maxAngle = Math.max(rotation, yAxis.startAngleRad);
|
227
|
+
|
228
|
+
if (maxAngle - minAngle > 2 * Math.PI) {
|
229
|
+
maxAngle = minAngle + 2 * Math.PI;
|
230
|
+
}
|
231
|
+
|
232
|
+
point.shapeArgs = shapeArgs = {
|
233
|
+
x: center[0],
|
234
|
+
y: center[1],
|
235
|
+
r: radius,
|
236
|
+
innerR: innerRadius,
|
237
|
+
start: minAngle,
|
238
|
+
end: maxAngle,
|
239
|
+
fill: toColor
|
240
|
+
};
|
241
|
+
point.startR = radius; // For PieSeries.animate
|
242
|
+
|
243
|
+
if (graphic) {
|
244
|
+
d = shapeArgs.d;
|
245
|
+
graphic.animate(shapeArgs);
|
246
|
+
if (d) {
|
247
|
+
shapeArgs.d = d; // animate alters it
|
248
|
+
}
|
249
|
+
} else {
|
250
|
+
point.graphic = renderer.arc(shapeArgs)
|
251
|
+
.addClass('highcharts-point')
|
252
|
+
.attr({
|
253
|
+
fill: toColor,
|
254
|
+
'sweep-flag': 0
|
255
|
+
})
|
256
|
+
.add(series.group);
|
257
|
+
|
258
|
+
|
259
|
+
if (options.linecap !== 'square') {
|
260
|
+
point.graphic.attr({
|
261
|
+
'stroke-linecap': 'round',
|
262
|
+
'stroke-linejoin': 'round'
|
263
|
+
});
|
264
|
+
}
|
265
|
+
point.graphic.attr({
|
266
|
+
stroke: options.borderColor || 'none',
|
267
|
+
'stroke-width': options.borderWidth || 0
|
268
|
+
});
|
269
|
+
|
270
|
+
}
|
271
|
+
});
|
272
|
+
},
|
273
|
+
|
274
|
+
/**
|
275
|
+
* Extend the pie slice animation by animating from start angle and up
|
276
|
+
*/
|
277
|
+
animate: function(init) {
|
278
|
+
|
279
|
+
if (!init) {
|
280
|
+
this.startAngleRad = this.yAxis.startAngleRad;
|
281
|
+
H.seriesTypes.pie.prototype.animate.call(this, init);
|
282
|
+
}
|
283
|
+
}
|
284
|
+
});
|
285
|
+
|
286
|
+
}(Highcharts));
|
279
287
|
}));
|