highcharts-rails 5.0.12 → 5.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +59 -0
- data/app/assets/javascripts/highcharts.js +6250 -788
- data/app/assets/javascripts/highcharts/highcharts-3d.js +210 -25
- data/app/assets/javascripts/highcharts/highcharts-more.js +908 -22
- data/app/assets/javascripts/highcharts/modules/accessibility.js +272 -64
- data/app/assets/javascripts/highcharts/modules/annotations.js +1 -1
- data/app/assets/javascripts/highcharts/modules/boost.js +89 -66
- data/app/assets/javascripts/highcharts/modules/broken-axis.js +65 -4
- data/app/assets/javascripts/highcharts/modules/data.js +1 -1
- data/app/assets/javascripts/highcharts/modules/drilldown.js +234 -17
- data/app/assets/javascripts/highcharts/modules/exporting.js +508 -69
- data/app/assets/javascripts/highcharts/modules/funnel.js +129 -8
- data/app/assets/javascripts/highcharts/modules/grid-axis.js +1 -1
- data/app/assets/javascripts/highcharts/modules/heatmap.js +361 -44
- data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +64 -1
- data/app/assets/javascripts/highcharts/modules/offline-exporting.js +44 -44
- data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +26 -3
- data/app/assets/javascripts/highcharts/modules/series-label.js +19 -1
- data/app/assets/javascripts/highcharts/modules/solid-gauge.js +14 -5
- data/app/assets/javascripts/highcharts/modules/stock.js +1122 -86
- data/app/assets/javascripts/highcharts/modules/treemap.js +265 -43
- data/app/assets/javascripts/highcharts/modules/xrange-series.js +1 -1
- data/lib/highcharts/version.rb +1 -1
- metadata +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
* Highcharts funnel module
|
4
4
|
*
|
5
5
|
* (c) 2010-2017 Torstein Honsi
|
@@ -32,27 +32,127 @@
|
|
32
32
|
each = Highcharts.each;
|
33
33
|
|
34
34
|
|
35
|
-
seriesType('funnel', 'pie',
|
35
|
+
seriesType('funnel', 'pie',
|
36
|
+
/**
|
37
|
+
* Funnel charts are a type of chart often used to visualize stages in a sales
|
38
|
+
* project, where the top are the initial stages with the most clients.
|
39
|
+
* It requires that the modules/funnel.js file is loaded.
|
40
|
+
*
|
41
|
+
* @sample highcharts/demo/funnel/ Funnel demo
|
42
|
+
* @extends {plotOptions.pie}
|
43
|
+
* @optionparent plotOptions.funnel
|
44
|
+
*/
|
45
|
+
{
|
46
|
+
|
47
|
+
/**
|
48
|
+
*/
|
36
49
|
animation: false,
|
50
|
+
|
51
|
+
/**
|
52
|
+
* The center of the series. By default, it is centered in the middle
|
53
|
+
* of the plot area, so it fills the plot area height.
|
54
|
+
*
|
55
|
+
* @type {Array<String|Number>}
|
56
|
+
* @default ["50%", "50%"]
|
57
|
+
* @since 3.0
|
58
|
+
* @product highcharts
|
59
|
+
*/
|
37
60
|
center: ['50%', '50%'],
|
61
|
+
|
62
|
+
/**
|
63
|
+
* The width of the funnel compared to the width of the plot area,
|
64
|
+
* or the pixel width if it is a number.
|
65
|
+
*
|
66
|
+
* @type {Number|String}
|
67
|
+
* @default 90%
|
68
|
+
* @since 3.0
|
69
|
+
* @product highcharts
|
70
|
+
*/
|
38
71
|
width: '90%',
|
72
|
+
|
73
|
+
/**
|
74
|
+
* The width of the neck, the lower part of the funnel. A number defines
|
75
|
+
* pixel width, a percentage string defines a percentage of the plot
|
76
|
+
* area width.
|
77
|
+
*
|
78
|
+
* @type {Number|String}
|
79
|
+
* @sample {highcharts} highcharts/demo/funnel/ Funnel demo
|
80
|
+
* @default 30%
|
81
|
+
* @since 3.0
|
82
|
+
* @product highcharts
|
83
|
+
*/
|
39
84
|
neckWidth: '30%',
|
85
|
+
|
86
|
+
/**
|
87
|
+
* The height of the funnel or pyramid. If it is a number it defines
|
88
|
+
* the pixel height, if it is a percentage string it is the percentage
|
89
|
+
* of the plot area height.
|
90
|
+
*
|
91
|
+
* @type {Number|String}
|
92
|
+
* @sample {highcharts} highcharts/demo/funnel/ Funnel demo
|
93
|
+
* @since 3.0
|
94
|
+
* @product highcharts
|
95
|
+
*/
|
40
96
|
height: '100%',
|
97
|
+
|
98
|
+
/**
|
99
|
+
* The height of the neck, the lower part of the funnel. A number defines
|
100
|
+
* pixel width, a percentage string defines a percentage of the plot
|
101
|
+
* area height.
|
102
|
+
*
|
103
|
+
* @type {Number|String}
|
104
|
+
* @default 25%
|
105
|
+
* @product highcharts
|
106
|
+
*/
|
41
107
|
neckHeight: '25%',
|
108
|
+
|
109
|
+
/**
|
110
|
+
* A reversed funnel has the widest area down. A reversed funnel with
|
111
|
+
* no neck width and neck height is a pyramid.
|
112
|
+
*
|
113
|
+
* @type {Boolean}
|
114
|
+
* @default false
|
115
|
+
* @since 3.0.10
|
116
|
+
* @product highcharts
|
117
|
+
*/
|
42
118
|
reversed: false,
|
119
|
+
|
120
|
+
/**
|
121
|
+
*/
|
43
122
|
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
|
44
123
|
|
45
124
|
|
46
125
|
// Presentational
|
126
|
+
|
127
|
+
/**
|
128
|
+
*/
|
47
129
|
dataLabels: {
|
48
130
|
//position: 'right',
|
131
|
+
|
132
|
+
/**
|
133
|
+
*/
|
49
134
|
connectorWidth: 1
|
50
135
|
//connectorColor: null
|
51
136
|
},
|
137
|
+
|
138
|
+
/**
|
139
|
+
*/
|
52
140
|
states: {
|
141
|
+
|
142
|
+
/**
|
143
|
+
*/
|
53
144
|
select: {
|
145
|
+
|
146
|
+
/**
|
147
|
+
*/
|
54
148
|
color: '#cccccc',
|
149
|
+
|
150
|
+
/**
|
151
|
+
*/
|
55
152
|
borderColor: '#000000',
|
153
|
+
|
154
|
+
/**
|
155
|
+
*/
|
56
156
|
shadow: false
|
57
157
|
}
|
58
158
|
}
|
@@ -293,13 +393,34 @@
|
|
293
393
|
|
294
394
|
/**
|
295
395
|
* Pyramid series type.
|
296
|
-
* A pyramid series is a special type of funnel, without neck and reversed by default.
|
297
396
|
*/
|
298
|
-
seriesType('pyramid', 'funnel',
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
397
|
+
seriesType('pyramid', 'funnel',
|
398
|
+
/**
|
399
|
+
* A pyramid series is a special type of funnel, without neck and reversed by default.
|
400
|
+
* @extends funnel
|
401
|
+
* @optionparent plotOptions.pyramid
|
402
|
+
*/
|
403
|
+
{
|
404
|
+
|
405
|
+
/**
|
406
|
+
*/
|
407
|
+
neckWidth: '0%',
|
408
|
+
|
409
|
+
/**
|
410
|
+
*/
|
411
|
+
neckHeight: '0%',
|
412
|
+
|
413
|
+
/**
|
414
|
+
* The pyramid is reversed by default, as opposed to the funnel, which
|
415
|
+
* shares the layout engine, and is not reversed.
|
416
|
+
*
|
417
|
+
* @type {Boolean}
|
418
|
+
* @default true
|
419
|
+
* @since 3.0.10
|
420
|
+
* @product highcharts
|
421
|
+
*/
|
422
|
+
reversed: true
|
423
|
+
});
|
303
424
|
|
304
425
|
}(Highcharts));
|
305
426
|
}));
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
*
|
4
4
|
* (c) 2009-2017 Torstein Honsi
|
5
5
|
*
|
@@ -41,31 +41,198 @@
|
|
41
41
|
};
|
42
42
|
extend(ColorAxis.prototype, Axis.prototype);
|
43
43
|
extend(ColorAxis.prototype, {
|
44
|
+
/**
|
45
|
+
* @extends {xAxis}
|
46
|
+
* @optionparent colorAxis
|
47
|
+
*/
|
44
48
|
defaultColorAxisOptions: {
|
49
|
+
|
50
|
+
/**
|
51
|
+
*/
|
45
52
|
lineWidth: 0,
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Padding of the min value relative to the length of the axis. A
|
56
|
+
* padding of 0.05 will make a 100px axis 5px longer.
|
57
|
+
*
|
58
|
+
* @type {Number}
|
59
|
+
* @product highmaps
|
60
|
+
*/
|
46
61
|
minPadding: 0,
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Padding of the max value relative to the length of the axis. A
|
65
|
+
* padding of 0.05 will make a 100px axis 5px longer.
|
66
|
+
*
|
67
|
+
* @type {Number}
|
68
|
+
* @product highmaps
|
69
|
+
*/
|
47
70
|
maxPadding: 0,
|
71
|
+
|
72
|
+
/**
|
73
|
+
* The width of the grid lines extending from the axis across the
|
74
|
+
* gradient of a scalar color axis.
|
75
|
+
*
|
76
|
+
* @type {Number}
|
77
|
+
* @sample {highmaps} maps/coloraxis/gridlines/ Grid lines demonstrated
|
78
|
+
* @default 1
|
79
|
+
* @product highmaps
|
80
|
+
*/
|
48
81
|
gridLineWidth: 1,
|
82
|
+
|
83
|
+
/**
|
84
|
+
* If [tickInterval](#colorAxis.tickInterval) is `null` this option
|
85
|
+
* sets the approximate pixel interval of the tick marks.
|
86
|
+
*
|
87
|
+
* @type {Number}
|
88
|
+
* @default 72
|
89
|
+
* @product highmaps
|
90
|
+
*/
|
49
91
|
tickPixelInterval: 72,
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Whether to force the axis to start on a tick. Use this option with
|
95
|
+
* the `maxPadding` option to control the axis start.
|
96
|
+
*
|
97
|
+
* @type {Boolean}
|
98
|
+
* @default true
|
99
|
+
* @product highmaps
|
100
|
+
*/
|
50
101
|
startOnTick: true,
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Whether to force the axis to end on a tick. Use this option with
|
105
|
+
* the [maxPadding](#colorAxis.maxPadding) option to control the axis
|
106
|
+
* end.
|
107
|
+
*
|
108
|
+
* @type {Boolean}
|
109
|
+
* @default true
|
110
|
+
* @product highmaps
|
111
|
+
*/
|
51
112
|
endOnTick: true,
|
113
|
+
|
114
|
+
/**
|
115
|
+
*/
|
52
116
|
offset: 0,
|
117
|
+
|
118
|
+
/**
|
119
|
+
* The triangular marker on a scalar color axis that points to the
|
120
|
+
* value of the hovered area. To disable the marker, set `marker:
|
121
|
+
* null`.
|
122
|
+
*
|
123
|
+
* @type {Object}
|
124
|
+
* @sample {highmaps} maps/coloraxis/marker/ Black marker
|
125
|
+
* @product highmaps
|
126
|
+
*/
|
53
127
|
marker: {
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Animation for the marker as it moves between values. Set to `false`
|
131
|
+
* to disable animation. Defaults to `{ duration: 50 }`.
|
132
|
+
*
|
133
|
+
* @type {Object|Boolean}
|
134
|
+
* @product highmaps
|
135
|
+
*/
|
54
136
|
animation: {
|
137
|
+
|
138
|
+
/**
|
139
|
+
*/
|
55
140
|
duration: 50
|
56
141
|
},
|
142
|
+
|
143
|
+
/**
|
144
|
+
*/
|
57
145
|
width: 0.01,
|
58
146
|
|
147
|
+
|
148
|
+
/**
|
149
|
+
* The color of the marker.
|
150
|
+
*
|
151
|
+
* @type {Color}
|
152
|
+
* @default #999999
|
153
|
+
* @product highmaps
|
154
|
+
*/
|
59
155
|
color: '#999999'
|
60
156
|
|
61
157
|
},
|
158
|
+
|
159
|
+
/**
|
160
|
+
* The axis labels show the number for each tick.
|
161
|
+
*
|
162
|
+
* For more live examples on label options, see [xAxis.labels in the
|
163
|
+
* Highcharts API.](/highcharts#xAxis.labels)
|
164
|
+
*
|
165
|
+
* @type {Object}
|
166
|
+
* @extends xAxis.labels
|
167
|
+
* @product highmaps
|
168
|
+
*/
|
62
169
|
labels: {
|
170
|
+
|
171
|
+
/**
|
172
|
+
* How to handle overflowing labels on horizontal axis. Can be undefined
|
173
|
+
* or "justify". If "justify", labels will not render outside the
|
174
|
+
* plot area. If there is room to move it, it will be aligned to
|
175
|
+
* the edge, else it will be removed.
|
176
|
+
*
|
177
|
+
* @validvalue [null, "justify"]
|
178
|
+
* @type {String}
|
179
|
+
* @default justify
|
180
|
+
* @product highmaps
|
181
|
+
*/
|
63
182
|
overflow: 'justify',
|
183
|
+
|
184
|
+
/**
|
185
|
+
*/
|
64
186
|
rotation: 0
|
65
187
|
},
|
188
|
+
|
189
|
+
/**
|
190
|
+
* The color to represent the minimum of the color axis. Unless [dataClasses](#colorAxis.
|
191
|
+
* dataClasses) or [stops](#colorAxis.stops) are set, the gradient
|
192
|
+
* starts at this value.
|
193
|
+
*
|
194
|
+
* If dataClasses are set, the color is based on minColor and maxColor
|
195
|
+
* unless a color is set for each data class, or the [dataClassColor](#colorAxis.
|
196
|
+
* dataClassColor) is set.
|
197
|
+
*
|
198
|
+
* @type {Color}
|
199
|
+
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor/ Min and max colors on scalar (gradient) axis
|
200
|
+
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/ On data classes
|
201
|
+
* @default #e6ebf5
|
202
|
+
* @product highmaps
|
203
|
+
*/
|
66
204
|
minColor: '#e6ebf5',
|
205
|
+
|
206
|
+
/**
|
207
|
+
* The color to represent the maximum of the color axis. Unless [dataClasses](#colorAxis.
|
208
|
+
* dataClasses) or [stops](#colorAxis.stops) are set, the gradient
|
209
|
+
* ends at this value.
|
210
|
+
*
|
211
|
+
* If dataClasses are set, the color is based on minColor and maxColor
|
212
|
+
* unless a color is set for each data class, or the [dataClassColor](#colorAxis.
|
213
|
+
* dataClassColor) is set.
|
214
|
+
*
|
215
|
+
* @type {Color}
|
216
|
+
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor/ Min and max colors on scalar (gradient) axis
|
217
|
+
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/ On data classes
|
218
|
+
* @default #003399
|
219
|
+
* @product highmaps
|
220
|
+
*/
|
67
221
|
maxColor: '#003399',
|
222
|
+
|
223
|
+
/**
|
224
|
+
*/
|
68
225
|
tickLength: 5,
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Whether to display the colorAxis in the legend.
|
229
|
+
*
|
230
|
+
* @type {Boolean}
|
231
|
+
* @see [heatmap.showInLegend](#series<heatmap>.showInLegend)
|
232
|
+
* @default true
|
233
|
+
* @since 4.2.7
|
234
|
+
* @product highmaps
|
235
|
+
*/
|
69
236
|
showInLegend: true
|
70
237
|
},
|
71
238
|
|
@@ -100,7 +267,7 @@
|
|
100
267
|
Axis.prototype.init.call(this, chart, options);
|
101
268
|
|
102
269
|
// Base init() pushes it to the xAxis array, now pop it again
|
103
|
-
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
|
270
|
+
// chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
|
104
271
|
|
105
272
|
// Prepare data classes
|
106
273
|
if (userOptions.dataClasses) {
|
@@ -131,30 +298,44 @@
|
|
131
298
|
|
132
299
|
dataClass = merge(dataClass);
|
133
300
|
dataClasses.push(dataClass);
|
134
|
-
if (!dataClass.color) {
|
135
|
-
if (options.dataClassColor === 'category') {
|
136
301
|
|
137
|
-
colors = chart.options.colors;
|
138
|
-
colorCount = colors.length;
|
139
|
-
dataClass.color = colors[colorCounter];
|
140
302
|
|
141
|
-
|
303
|
+
if (dataClass.color) {
|
304
|
+
return;
|
305
|
+
}
|
142
306
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
307
|
+
if (options.dataClassColor === 'category') {
|
308
|
+
|
309
|
+
colors = chart.options.colors;
|
310
|
+
colorCount = colors.length;
|
311
|
+
dataClass.color = colors[colorCounter];
|
312
|
+
|
313
|
+
dataClass.colorIndex = colorCounter;
|
314
|
+
|
315
|
+
// increase and loop back to zero
|
316
|
+
colorCounter++;
|
317
|
+
if (colorCounter === colorCount) {
|
318
|
+
colorCounter = 0;
|
153
319
|
}
|
320
|
+
} else {
|
321
|
+
dataClass.color = color(options.minColor).tweenTo(
|
322
|
+
color(options.maxColor),
|
323
|
+
len < 2 ? 0.5 : i / (len - 1) // #3219
|
324
|
+
);
|
154
325
|
}
|
155
326
|
});
|
156
327
|
},
|
157
328
|
|
329
|
+
/**
|
330
|
+
* Override so that ticks are not added in data class axes (#6914)
|
331
|
+
*/
|
332
|
+
setTickPositions: function() {
|
333
|
+
if (!this.dataClasses) {
|
334
|
+
return Axis.prototype.setTickPositions.call(this);
|
335
|
+
}
|
336
|
+
},
|
337
|
+
|
338
|
+
|
158
339
|
initStops: function() {
|
159
340
|
this.stops = this.options.stops || [
|
160
341
|
[0, this.options.minColor],
|
@@ -195,8 +376,13 @@
|
|
195
376
|
this.len = this.horiz ? width : height;
|
196
377
|
this.pos = this.horiz ? x : y;
|
197
378
|
} else {
|
198
|
-
// Fake length for disabled legend to avoid tick issues
|
199
|
-
|
379
|
+
// Fake length for disabled legend to avoid tick issues
|
380
|
+
// and such (#5205)
|
381
|
+
this.len = (
|
382
|
+
this.horiz ?
|
383
|
+
legendOptions.symbolWidth :
|
384
|
+
legendOptions.symbolHeight
|
385
|
+
) || this.defaultLegendLength;
|
200
386
|
}
|
201
387
|
},
|
202
388
|
|
@@ -226,8 +412,13 @@
|
|
226
412
|
dataClass = dataClasses[i];
|
227
413
|
from = dataClass.from;
|
228
414
|
to = dataClass.to;
|
229
|
-
if (
|
415
|
+
if (
|
416
|
+
(from === undefined || value >= from) &&
|
417
|
+
(to === undefined || value <= to)
|
418
|
+
) {
|
419
|
+
|
230
420
|
color = dataClass.color;
|
421
|
+
|
231
422
|
if (point) {
|
232
423
|
point.dataClass = i;
|
233
424
|
point.colorIndex = dataClass.colorIndex;
|
@@ -260,7 +451,8 @@
|
|
260
451
|
},
|
261
452
|
|
262
453
|
/**
|
263
|
-
* Override the getOffset method to add the whole axis groups inside
|
454
|
+
* Override the getOffset method to add the whole axis groups inside
|
455
|
+
* the legend.
|
264
456
|
*/
|
265
457
|
getOffset: function() {
|
266
458
|
var group = this.legendGroup,
|
@@ -316,8 +508,14 @@
|
|
316
508
|
var padding = legend.padding,
|
317
509
|
legendOptions = legend.options,
|
318
510
|
horiz = this.horiz,
|
319
|
-
width = pick(
|
320
|
-
|
511
|
+
width = pick(
|
512
|
+
legendOptions.symbolWidth,
|
513
|
+
horiz ? this.defaultLegendLength : 12
|
514
|
+
),
|
515
|
+
height = pick(
|
516
|
+
legendOptions.symbolHeight,
|
517
|
+
horiz ? 12 : this.defaultLegendLength
|
518
|
+
),
|
321
519
|
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30),
|
322
520
|
itemDistance = pick(legendOptions.itemDistance, 10);
|
323
521
|
|
@@ -334,7 +532,8 @@
|
|
334
532
|
}).add(item.legendGroup);
|
335
533
|
|
336
534
|
// Set how much space this legend item takes up
|
337
|
-
this.legendItemWidth = width + padding +
|
535
|
+
this.legendItemWidth = width + padding +
|
536
|
+
(horiz ? itemDistance : labelPadding);
|
338
537
|
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
|
339
538
|
},
|
340
539
|
/**
|
@@ -391,8 +590,25 @@
|
|
391
590
|
}
|
392
591
|
},
|
393
592
|
getPlotLinePath: function(a, b, c, d, pos) {
|
394
|
-
|
395
|
-
|
593
|
+
// crosshairs only
|
594
|
+
return isNumber(pos) ? // pos can be 0 (#3969)
|
595
|
+
(
|
596
|
+
this.horiz ? [
|
597
|
+
'M',
|
598
|
+
pos - 4, this.top - 6,
|
599
|
+
'L',
|
600
|
+
pos + 4, this.top - 6,
|
601
|
+
pos, this.top,
|
602
|
+
'Z'
|
603
|
+
] : [
|
604
|
+
'M',
|
605
|
+
this.left, pos,
|
606
|
+
'L',
|
607
|
+
this.left - 6, pos + 6,
|
608
|
+
this.left - 6, pos - 6,
|
609
|
+
'Z'
|
610
|
+
]
|
611
|
+
) :
|
396
612
|
Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
|
397
613
|
},
|
398
614
|
|
@@ -401,10 +617,12 @@
|
|
401
617
|
legend = chart.legend;
|
402
618
|
|
403
619
|
each(this.series, function(series) {
|
404
|
-
|
620
|
+
// Needed for Axis.update when choropleth colors change
|
621
|
+
series.isDirtyData = true;
|
405
622
|
});
|
406
623
|
|
407
|
-
// When updating data classes, destroy old items and make sure new ones
|
624
|
+
// When updating data classes, destroy old items and make sure new ones
|
625
|
+
// are created (#3207)
|
408
626
|
if (newOptions.dataClasses && legend.allItems) {
|
409
627
|
each(legend.allItems, function(item) {
|
410
628
|
if (item.isDataClass && item.legendGroup) {
|
@@ -414,8 +632,8 @@
|
|
414
632
|
chart.isDirtyLegend = true;
|
415
633
|
}
|
416
634
|
|
417
|
-
// Keep the options structure updated for export. Unlike xAxis and
|
418
|
-
// not an array. (#3207)
|
635
|
+
// Keep the options structure updated for export. Unlike xAxis and
|
636
|
+
// yAxis, the colorAxis is not an array. (#3207)
|
419
637
|
chart.options[this.coll] = merge(this.userOptions, newOptions);
|
420
638
|
|
421
639
|
Axis.prototype.update.call(this, newOptions, redraw);
|
@@ -453,7 +671,8 @@
|
|
453
671
|
from = dataClass.from,
|
454
672
|
to = dataClass.to;
|
455
673
|
|
456
|
-
// Assemble the default name. This can be overridden
|
674
|
+
// Assemble the default name. This can be overridden
|
675
|
+
// by legend.options.labelFormatter
|
457
676
|
name = '';
|
458
677
|
if (from === undefined) {
|
459
678
|
name = '< ';
|
@@ -533,8 +752,8 @@
|
|
533
752
|
|
534
753
|
|
535
754
|
/**
|
536
|
-
* Wrap the legend getAllItems method to add the color axis. This also removes
|
537
|
-
* axis' own series to prevent them from showing up individually.
|
755
|
+
* Wrap the legend getAllItems method to add the color axis. This also removes
|
756
|
+
* the axis' own series to prevent them from showing up individually.
|
538
757
|
*/
|
539
758
|
wrap(Legend.prototype, 'getAllItems', function(proceed) {
|
540
759
|
var allItems = [],
|
@@ -544,7 +763,9 @@
|
|
544
763
|
if (colorAxis.options.showInLegend) {
|
545
764
|
// Data classes
|
546
765
|
if (colorAxis.options.dataClasses) {
|
547
|
-
allItems = allItems.concat(
|
766
|
+
allItems = allItems.concat(
|
767
|
+
colorAxis.getDataClassLegendSymbols()
|
768
|
+
);
|
548
769
|
// Gradient legend
|
549
770
|
} else {
|
550
771
|
// Add this axis on top
|
@@ -570,6 +791,15 @@
|
|
570
791
|
}
|
571
792
|
});
|
572
793
|
|
794
|
+
// Updates in the legend need to be reflected in the color axis (6888)
|
795
|
+
wrap(Legend.prototype, 'update', function(proceed) {
|
796
|
+
proceed.apply(this, [].slice.call(arguments, 1));
|
797
|
+
|
798
|
+
if (this.chart.colorAxis[0]) {
|
799
|
+
this.chart.colorAxis[0].update({}, arguments[2]);
|
800
|
+
}
|
801
|
+
});
|
802
|
+
|
573
803
|
}(Highcharts));
|
574
804
|
(function(H) {
|
575
805
|
/**
|
@@ -587,7 +817,8 @@
|
|
587
817
|
*/
|
588
818
|
H.colorPointMixin = {
|
589
819
|
/**
|
590
|
-
* Color points have a value option that determines whether or not it is
|
820
|
+
* Color points have a value option that determines whether or not it is
|
821
|
+
* a null point
|
591
822
|
*/
|
592
823
|
isValid: function() {
|
593
824
|
return this.value !== null;
|
@@ -631,7 +862,8 @@
|
|
631
862
|
|
632
863
|
|
633
864
|
/**
|
634
|
-
* In choropleth maps, the color is a result of the value, so this needs
|
865
|
+
* In choropleth maps, the color is a result of the value, so this needs
|
866
|
+
* translation too
|
635
867
|
*/
|
636
868
|
translateColors: function() {
|
637
869
|
var series = this,
|
@@ -644,7 +876,13 @@
|
|
644
876
|
color;
|
645
877
|
|
646
878
|
color = point.options.color ||
|
647
|
-
(
|
879
|
+
(
|
880
|
+
point.isNull ?
|
881
|
+
nullColor :
|
882
|
+
(colorAxis && value !== undefined) ?
|
883
|
+
colorAxis.toColor(value, point) :
|
884
|
+
point.color || series.color
|
885
|
+
);
|
648
886
|
|
649
887
|
if (color) {
|
650
888
|
point.color = color;
|
@@ -683,40 +921,104 @@
|
|
683
921
|
seriesTypes = H.seriesTypes;
|
684
922
|
|
685
923
|
// The Heatmap series type
|
924
|
+
|
925
|
+
/**
|
926
|
+
* @extends {plotOptions.scatter}
|
927
|
+
* @optionparent plotOptions.heatmap
|
928
|
+
*/
|
686
929
|
seriesType('heatmap', 'scatter', {
|
930
|
+
|
931
|
+
/**
|
932
|
+
*/
|
687
933
|
animation: false,
|
934
|
+
|
935
|
+
/**
|
936
|
+
*/
|
688
937
|
borderWidth: 0,
|
689
938
|
|
939
|
+
|
940
|
+
/**
|
941
|
+
*/
|
690
942
|
nullColor: '#f7f7f7',
|
691
943
|
|
944
|
+
|
945
|
+
/**
|
946
|
+
*/
|
692
947
|
dataLabels: {
|
948
|
+
|
949
|
+
/**
|
950
|
+
*/
|
693
951
|
formatter: function() { // #2945
|
694
952
|
return this.point.value;
|
695
953
|
},
|
954
|
+
|
955
|
+
/**
|
956
|
+
*/
|
696
957
|
inside: true,
|
958
|
+
|
959
|
+
/**
|
960
|
+
*/
|
697
961
|
verticalAlign: 'middle',
|
962
|
+
|
963
|
+
/**
|
964
|
+
*/
|
698
965
|
crop: false,
|
966
|
+
|
967
|
+
/**
|
968
|
+
*/
|
699
969
|
overflow: false,
|
970
|
+
|
971
|
+
/**
|
972
|
+
*/
|
700
973
|
padding: 0 // #3837
|
701
974
|
},
|
975
|
+
|
976
|
+
/**
|
977
|
+
*/
|
702
978
|
marker: null,
|
979
|
+
|
980
|
+
/**
|
981
|
+
*/
|
703
982
|
pointRange: null, // dynamically set to colsize by default
|
983
|
+
|
984
|
+
/**
|
985
|
+
*/
|
704
986
|
tooltip: {
|
987
|
+
|
988
|
+
/**
|
989
|
+
*/
|
705
990
|
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
|
706
991
|
},
|
992
|
+
|
993
|
+
/**
|
994
|
+
*/
|
707
995
|
states: {
|
996
|
+
|
997
|
+
/**
|
998
|
+
*/
|
708
999
|
normal: {
|
1000
|
+
|
1001
|
+
/**
|
1002
|
+
*/
|
709
1003
|
animation: true
|
710
1004
|
},
|
1005
|
+
|
1006
|
+
/**
|
1007
|
+
*/
|
711
1008
|
hover: {
|
1009
|
+
|
1010
|
+
/**
|
1011
|
+
*/
|
712
1012
|
halo: false, // #3406, halo is not required on heatmaps
|
1013
|
+
|
1014
|
+
/**
|
1015
|
+
*/
|
713
1016
|
brightness: 0.2
|
714
1017
|
}
|
715
1018
|
}
|
716
1019
|
}, merge(colorSeriesMixin, {
|
717
1020
|
pointArrayMap: ['y', 'value'],
|
718
1021
|
hasPointSpecificOptions: true,
|
719
|
-
supportsDrilldown: true,
|
720
1022
|
getExtremesFromAll: true,
|
721
1023
|
directTouch: true,
|
722
1024
|
|
@@ -728,7 +1030,8 @@
|
|
728
1030
|
seriesTypes.scatter.prototype.init.apply(this, arguments);
|
729
1031
|
|
730
1032
|
options = this.options;
|
731
|
-
|
1033
|
+
// #3758, prevent resetting in setData
|
1034
|
+
options.pointRange = pick(options.pointRange, options.colsize || 1);
|
732
1035
|
this.yAxis.axisPointRange = options.rowsize || 1; // general point range
|
733
1036
|
},
|
734
1037
|
translate: function() {
|
@@ -745,10 +1048,24 @@
|
|
745
1048
|
each(series.points, function(point) {
|
746
1049
|
var xPad = (options.colsize || 1) / 2,
|
747
1050
|
yPad = (options.rowsize || 1) / 2,
|
748
|
-
x1 = between(
|
749
|
-
|
750
|
-
|
751
|
-
|
1051
|
+
x1 = between(
|
1052
|
+
Math.round(
|
1053
|
+
xAxis.len -
|
1054
|
+
xAxis.translate(point.x - xPad, 0, 1, 0, 1)
|
1055
|
+
), -xAxis.len, 2 * xAxis.len
|
1056
|
+
),
|
1057
|
+
x2 = between(
|
1058
|
+
Math.round(
|
1059
|
+
xAxis.len -
|
1060
|
+
xAxis.translate(point.x + xPad, 0, 1, 0, 1)
|
1061
|
+
), -xAxis.len, 2 * xAxis.len
|
1062
|
+
),
|
1063
|
+
y1 = between(
|
1064
|
+
Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len
|
1065
|
+
),
|
1066
|
+
y2 = between(
|
1067
|
+
Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len
|
1068
|
+
);
|
752
1069
|
|
753
1070
|
// Set plotX and plotY for use in K-D-Tree and more
|
754
1071
|
point.plotX = point.clientX = (x1 + x2) / 2;
|