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,731 +1,791 @@
|
|
1
1
|
/**
|
2
|
+
* @license Highcharts JS v5.0.0 (2016-09-29)
|
2
3
|
* Highcharts Drilldown module
|
3
4
|
*
|
4
5
|
* Author: Torstein Honsi
|
5
6
|
* License: www.highcharts.com/license
|
6
7
|
*
|
7
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
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
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
|
+
* Highcharts Drilldown module
|
19
|
+
*
|
20
|
+
* Author: Torstein Honsi
|
21
|
+
* License: www.highcharts.com/license
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
|
25
|
+
'use strict';
|
26
|
+
|
27
|
+
var noop = H.noop,
|
28
|
+
color = H.color,
|
29
|
+
defaultOptions = H.defaultOptions,
|
30
|
+
each = H.each,
|
31
|
+
extend = H.extend,
|
32
|
+
format = H.format,
|
33
|
+
pick = H.pick,
|
34
|
+
wrap = H.wrap,
|
35
|
+
Chart = H.Chart,
|
36
|
+
seriesTypes = H.seriesTypes,
|
37
|
+
PieSeries = seriesTypes.pie,
|
38
|
+
ColumnSeries = seriesTypes.column,
|
39
|
+
Tick = H.Tick,
|
40
|
+
fireEvent = H.fireEvent,
|
41
|
+
inArray = H.inArray,
|
42
|
+
ddSeriesId = 1;
|
43
|
+
|
44
|
+
// Utilities
|
45
|
+
/*
|
46
|
+
* Return an intermediate color between two colors, according to pos where 0
|
47
|
+
* is the from color and 1 is the to color. This method is copied from ColorAxis.js
|
48
|
+
* and should always be kept updated, until we get AMD support.
|
49
|
+
*/
|
50
|
+
function tweenColors(from, to, pos) {
|
51
|
+
// Check for has alpha, because rgba colors perform worse due to lack of
|
52
|
+
// support in WebKit.
|
53
|
+
var hasAlpha,
|
54
|
+
ret;
|
55
|
+
|
56
|
+
// Unsupported color, return to-color (#3920)
|
57
|
+
if (!to.rgba.length || !from.rgba.length) {
|
58
|
+
ret = to.input || 'none';
|
59
|
+
|
60
|
+
// Interpolate
|
61
|
+
} else {
|
62
|
+
from = from.rgba;
|
63
|
+
to = to.rgba;
|
64
|
+
hasAlpha = (to[3] !== 1 || from[3] !== 1);
|
65
|
+
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
|
66
|
+
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
|
67
|
+
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
|
68
|
+
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
|
69
|
+
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
|
70
|
+
}
|
71
|
+
return ret;
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* Handle animation of the color attributes directly
|
75
|
+
*/
|
76
|
+
each(['fill', 'stroke'], function(prop) {
|
77
|
+
H.Fx.prototype[prop + 'Setter'] = function() {
|
78
|
+
this.elem.attr(prop, tweenColors(color(this.start), color(this.end), this.pos));
|
79
|
+
};
|
80
|
+
});
|
81
|
+
|
82
|
+
// Add language
|
83
|
+
extend(defaultOptions.lang, {
|
84
|
+
drillUpText: '◁ Back to {series.name}'
|
85
|
+
});
|
86
|
+
defaultOptions.drilldown = {
|
87
|
+
|
88
|
+
activeAxisLabelStyle: {
|
89
|
+
cursor: 'pointer',
|
90
|
+
color: '#003399',
|
91
|
+
fontWeight: 'bold',
|
92
|
+
textDecoration: 'underline'
|
93
|
+
},
|
94
|
+
activeDataLabelStyle: {
|
95
|
+
cursor: 'pointer',
|
96
|
+
color: '#003399',
|
97
|
+
fontWeight: 'bold',
|
98
|
+
textDecoration: 'underline'
|
99
|
+
},
|
100
|
+
|
101
|
+
animation: {
|
102
|
+
duration: 500
|
103
|
+
},
|
104
|
+
drillUpButton: {
|
105
|
+
position: {
|
106
|
+
align: 'right',
|
107
|
+
x: -10,
|
108
|
+
y: 10
|
109
|
+
}
|
110
|
+
// relativeTo: 'plotBox'
|
111
|
+
// theme
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
/**
|
116
|
+
* A general fadeIn method
|
117
|
+
*/
|
118
|
+
H.SVGRenderer.prototype.Element.prototype.fadeIn = function(animation) {
|
119
|
+
this
|
120
|
+
.attr({
|
121
|
+
opacity: 0.1,
|
122
|
+
visibility: 'inherit'
|
123
|
+
})
|
124
|
+
.animate({
|
125
|
+
opacity: pick(this.newOpacity, 1) // newOpacity used in maps
|
126
|
+
}, animation || {
|
127
|
+
duration: 250
|
128
|
+
});
|
129
|
+
};
|
130
|
+
|
131
|
+
Chart.prototype.addSeriesAsDrilldown = function(point, ddOptions) {
|
132
|
+
this.addSingleSeriesAsDrilldown(point, ddOptions);
|
133
|
+
this.applyDrilldown();
|
134
|
+
};
|
135
|
+
Chart.prototype.addSingleSeriesAsDrilldown = function(point, ddOptions) {
|
136
|
+
var oldSeries = point.series,
|
137
|
+
xAxis = oldSeries.xAxis,
|
138
|
+
yAxis = oldSeries.yAxis,
|
139
|
+
newSeries,
|
140
|
+
pointIndex,
|
141
|
+
levelSeries = [],
|
142
|
+
levelSeriesOptions = [],
|
143
|
+
level,
|
144
|
+
levelNumber,
|
145
|
+
last,
|
146
|
+
colorProp;
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
colorProp = {
|
151
|
+
color: point.color || oldSeries.color
|
152
|
+
};
|
153
|
+
|
154
|
+
|
155
|
+
if (!this.drilldownLevels) {
|
156
|
+
this.drilldownLevels = [];
|
157
|
+
}
|
158
|
+
|
159
|
+
levelNumber = oldSeries.options._levelNumber || 0;
|
160
|
+
|
161
|
+
// See if we can reuse the registered series from last run
|
162
|
+
last = this.drilldownLevels[this.drilldownLevels.length - 1];
|
163
|
+
if (last && last.levelNumber !== levelNumber) {
|
164
|
+
last = undefined;
|
165
|
+
}
|
166
|
+
|
167
|
+
ddOptions = extend(extend({
|
168
|
+
_ddSeriesId: ddSeriesId++
|
169
|
+
}, colorProp), ddOptions);
|
170
|
+
pointIndex = inArray(point, oldSeries.points);
|
171
|
+
|
172
|
+
// Record options for all current series
|
173
|
+
each(oldSeries.chart.series, function(series) {
|
174
|
+
if (series.xAxis === xAxis && !series.isDrilling) {
|
175
|
+
series.options._ddSeriesId = series.options._ddSeriesId || ddSeriesId++;
|
176
|
+
series.options._colorIndex = series.userOptions._colorIndex;
|
177
|
+
series.options._levelNumber = series.options._levelNumber || levelNumber; // #3182
|
178
|
+
|
179
|
+
if (last) {
|
180
|
+
levelSeries = last.levelSeries;
|
181
|
+
levelSeriesOptions = last.levelSeriesOptions;
|
182
|
+
} else {
|
183
|
+
levelSeries.push(series);
|
184
|
+
levelSeriesOptions.push(series.options);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
});
|
188
|
+
|
189
|
+
// Add a record of properties for each drilldown level
|
190
|
+
level = extend({
|
191
|
+
levelNumber: levelNumber,
|
192
|
+
seriesOptions: oldSeries.options,
|
193
|
+
levelSeriesOptions: levelSeriesOptions,
|
194
|
+
levelSeries: levelSeries,
|
195
|
+
shapeArgs: point.shapeArgs,
|
196
|
+
bBox: point.graphic ? point.graphic.getBBox() : {}, // no graphic in line series with markers disabled
|
197
|
+
lowerSeriesOptions: ddOptions,
|
198
|
+
pointOptions: oldSeries.options.data[pointIndex],
|
199
|
+
pointIndex: pointIndex,
|
200
|
+
oldExtremes: {
|
201
|
+
xMin: xAxis && xAxis.userMin,
|
202
|
+
xMax: xAxis && xAxis.userMax,
|
203
|
+
yMin: yAxis && yAxis.userMin,
|
204
|
+
yMax: yAxis && yAxis.userMax
|
205
|
+
}
|
206
|
+
}, colorProp);
|
207
|
+
|
208
|
+
// Push it to the lookup array
|
209
|
+
this.drilldownLevels.push(level);
|
210
|
+
|
211
|
+
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
|
212
|
+
newSeries.options._levelNumber = levelNumber + 1;
|
213
|
+
if (xAxis) {
|
214
|
+
xAxis.oldPos = xAxis.pos;
|
215
|
+
xAxis.userMin = xAxis.userMax = null;
|
216
|
+
yAxis.userMin = yAxis.userMax = null;
|
217
|
+
}
|
218
|
+
|
219
|
+
// Run fancy cross-animation on supported and equal types
|
220
|
+
if (oldSeries.type === newSeries.type) {
|
221
|
+
newSeries.animate = newSeries.animateDrilldown || noop;
|
222
|
+
newSeries.options.animation = true;
|
223
|
+
}
|
224
|
+
};
|
225
|
+
|
226
|
+
Chart.prototype.applyDrilldown = function() {
|
227
|
+
var drilldownLevels = this.drilldownLevels,
|
228
|
+
levelToRemove;
|
229
|
+
|
230
|
+
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
|
231
|
+
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
|
232
|
+
each(this.drilldownLevels, function(level) {
|
233
|
+
if (level.levelNumber === levelToRemove) {
|
234
|
+
each(level.levelSeries, function(series) {
|
235
|
+
if (series.options && series.options._levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
|
236
|
+
series.remove(false);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
}
|
240
|
+
});
|
241
|
+
}
|
242
|
+
|
243
|
+
this.redraw();
|
244
|
+
this.showDrillUpButton();
|
245
|
+
};
|
246
|
+
|
247
|
+
Chart.prototype.getDrilldownBackText = function() {
|
248
|
+
var drilldownLevels = this.drilldownLevels,
|
249
|
+
lastLevel;
|
250
|
+
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
|
251
|
+
lastLevel = drilldownLevels[drilldownLevels.length - 1];
|
252
|
+
lastLevel.series = lastLevel.seriesOptions;
|
253
|
+
return format(this.options.lang.drillUpText, lastLevel);
|
254
|
+
}
|
255
|
+
|
256
|
+
};
|
257
|
+
|
258
|
+
Chart.prototype.showDrillUpButton = function() {
|
259
|
+
var chart = this,
|
260
|
+
backText = this.getDrilldownBackText(),
|
261
|
+
buttonOptions = chart.options.drilldown.drillUpButton,
|
262
|
+
attr,
|
263
|
+
states;
|
264
|
+
|
265
|
+
|
266
|
+
if (!this.drillUpButton) {
|
267
|
+
attr = buttonOptions.theme;
|
268
|
+
states = attr && attr.states;
|
269
|
+
|
270
|
+
this.drillUpButton = this.renderer.button(
|
271
|
+
backText,
|
272
|
+
null,
|
273
|
+
null,
|
274
|
+
function() {
|
275
|
+
chart.drillUp();
|
276
|
+
},
|
277
|
+
attr,
|
278
|
+
states && states.hover,
|
279
|
+
states && states.select
|
280
|
+
)
|
281
|
+
.addClass('highcharts-drillup-button')
|
282
|
+
.attr({
|
283
|
+
align: buttonOptions.position.align,
|
284
|
+
zIndex: 7
|
285
|
+
})
|
286
|
+
.add()
|
287
|
+
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
|
288
|
+
} else {
|
289
|
+
this.drillUpButton.attr({
|
290
|
+
text: backText
|
291
|
+
})
|
292
|
+
.align();
|
293
|
+
}
|
294
|
+
};
|
295
|
+
|
296
|
+
Chart.prototype.drillUp = function() {
|
297
|
+
var chart = this,
|
298
|
+
drilldownLevels = chart.drilldownLevels,
|
299
|
+
levelNumber = drilldownLevels[drilldownLevels.length - 1].levelNumber,
|
300
|
+
i = drilldownLevels.length,
|
301
|
+
chartSeries = chart.series,
|
302
|
+
seriesI,
|
303
|
+
level,
|
304
|
+
oldSeries,
|
305
|
+
newSeries,
|
306
|
+
oldExtremes,
|
307
|
+
addSeries = function(seriesOptions) {
|
308
|
+
var addedSeries;
|
309
|
+
each(chartSeries, function(series) {
|
310
|
+
if (series.options._ddSeriesId === seriesOptions._ddSeriesId) {
|
311
|
+
addedSeries = series;
|
312
|
+
}
|
313
|
+
});
|
314
|
+
|
315
|
+
addedSeries = addedSeries || chart.addSeries(seriesOptions, false);
|
316
|
+
if (addedSeries.type === oldSeries.type && addedSeries.animateDrillupTo) {
|
317
|
+
addedSeries.animate = addedSeries.animateDrillupTo;
|
318
|
+
}
|
319
|
+
if (seriesOptions === level.seriesOptions) {
|
320
|
+
newSeries = addedSeries;
|
321
|
+
}
|
322
|
+
};
|
323
|
+
|
324
|
+
while (i--) {
|
325
|
+
|
326
|
+
level = drilldownLevels[i];
|
327
|
+
if (level.levelNumber === levelNumber) {
|
328
|
+
drilldownLevels.pop();
|
329
|
+
|
330
|
+
// Get the lower series by reference or id
|
331
|
+
oldSeries = level.lowerSeries;
|
332
|
+
if (!oldSeries.chart) { // #2786
|
333
|
+
seriesI = chartSeries.length; // #2919
|
334
|
+
while (seriesI--) {
|
335
|
+
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id &&
|
336
|
+
chartSeries[seriesI].options._levelNumber === levelNumber + 1) { // #3867
|
337
|
+
oldSeries = chartSeries[seriesI];
|
338
|
+
break;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
oldSeries.xData = []; // Overcome problems with minRange (#2898)
|
343
|
+
|
344
|
+
each(level.levelSeriesOptions, addSeries);
|
345
|
+
|
346
|
+
fireEvent(chart, 'drillup', {
|
347
|
+
seriesOptions: level.seriesOptions
|
348
|
+
});
|
349
|
+
|
350
|
+
if (newSeries.type === oldSeries.type) {
|
351
|
+
newSeries.drilldownLevel = level;
|
352
|
+
newSeries.options.animation = chart.options.drilldown.animation;
|
353
|
+
|
354
|
+
if (oldSeries.animateDrillupFrom && oldSeries.chart) { // #2919
|
355
|
+
oldSeries.animateDrillupFrom(level);
|
356
|
+
}
|
357
|
+
}
|
358
|
+
newSeries.options._levelNumber = levelNumber;
|
359
|
+
|
360
|
+
oldSeries.remove(false);
|
361
|
+
|
362
|
+
// Reset the zoom level of the upper series
|
363
|
+
if (newSeries.xAxis) {
|
364
|
+
oldExtremes = level.oldExtremes;
|
365
|
+
newSeries.xAxis.setExtremes(oldExtremes.xMin, oldExtremes.xMax, false);
|
366
|
+
newSeries.yAxis.setExtremes(oldExtremes.yMin, oldExtremes.yMax, false);
|
367
|
+
}
|
368
|
+
}
|
369
|
+
}
|
370
|
+
|
371
|
+
// Fire a once-off event after all series have been drilled up (#5158)
|
372
|
+
fireEvent(chart, 'drillupall');
|
373
|
+
|
374
|
+
this.redraw();
|
375
|
+
|
376
|
+
if (this.drilldownLevels.length === 0) {
|
377
|
+
this.drillUpButton = this.drillUpButton.destroy();
|
378
|
+
} else {
|
379
|
+
this.drillUpButton.attr({
|
380
|
+
text: this.getDrilldownBackText()
|
381
|
+
})
|
382
|
+
.align();
|
383
|
+
}
|
384
|
+
|
385
|
+
this.ddDupes.length = []; // #3315
|
386
|
+
};
|
387
|
+
|
388
|
+
|
389
|
+
ColumnSeries.prototype.supportsDrilldown = true;
|
390
|
+
|
391
|
+
/**
|
392
|
+
* When drilling up, keep the upper series invisible until the lower series has
|
393
|
+
* moved into place
|
394
|
+
*/
|
395
|
+
ColumnSeries.prototype.animateDrillupTo = function(init) {
|
396
|
+
if (!init) {
|
397
|
+
var newSeries = this,
|
398
|
+
level = newSeries.drilldownLevel;
|
399
|
+
|
400
|
+
each(this.points, function(point) {
|
401
|
+
if (point.graphic) { // #3407
|
402
|
+
point.graphic.hide();
|
403
|
+
}
|
404
|
+
if (point.dataLabel) {
|
405
|
+
point.dataLabel.hide();
|
406
|
+
}
|
407
|
+
if (point.connector) {
|
408
|
+
point.connector.hide();
|
409
|
+
}
|
410
|
+
});
|
411
|
+
|
412
|
+
|
413
|
+
// Do dummy animation on first point to get to complete
|
414
|
+
setTimeout(function() {
|
415
|
+
if (newSeries.points) { // May be destroyed in the meantime, #3389
|
416
|
+
each(newSeries.points, function(point, i) {
|
417
|
+
// Fade in other points
|
418
|
+
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
|
419
|
+
inherit = verb === 'show' ? true : undefined;
|
420
|
+
if (point.graphic) { // #3407
|
421
|
+
point.graphic[verb](inherit);
|
422
|
+
}
|
423
|
+
if (point.dataLabel) {
|
424
|
+
point.dataLabel[verb](inherit);
|
425
|
+
}
|
426
|
+
if (point.connector) {
|
427
|
+
point.connector[verb](inherit);
|
428
|
+
}
|
429
|
+
});
|
430
|
+
}
|
431
|
+
}, Math.max(this.chart.options.drilldown.animation.duration - 50, 0));
|
432
|
+
|
433
|
+
// Reset
|
434
|
+
this.animate = noop;
|
435
|
+
}
|
436
|
+
|
437
|
+
};
|
438
|
+
|
439
|
+
ColumnSeries.prototype.animateDrilldown = function(init) {
|
440
|
+
var series = this,
|
441
|
+
drilldownLevels = this.chart.drilldownLevels,
|
442
|
+
animateFrom,
|
443
|
+
animationOptions = this.chart.options.drilldown.animation,
|
444
|
+
xAxis = this.xAxis;
|
445
|
+
|
446
|
+
if (!init) {
|
447
|
+
each(drilldownLevels, function(level) {
|
448
|
+
if (series.options._ddSeriesId === level.lowerSeriesOptions._ddSeriesId) {
|
449
|
+
animateFrom = level.shapeArgs;
|
450
|
+
|
451
|
+
// Add the point colors to animate from
|
452
|
+
animateFrom.fill = level.color;
|
453
|
+
|
454
|
+
}
|
455
|
+
});
|
456
|
+
|
457
|
+
animateFrom.x += (pick(xAxis.oldPos, xAxis.pos) - xAxis.pos);
|
458
|
+
|
459
|
+
each(this.points, function(point) {
|
460
|
+
var animateTo = point.shapeArgs;
|
461
|
+
|
462
|
+
|
463
|
+
// Add the point colors to animate to
|
464
|
+
animateTo.fill = point.color;
|
465
|
+
|
466
|
+
|
467
|
+
if (point.graphic) {
|
468
|
+
point.graphic
|
469
|
+
.attr(animateFrom)
|
470
|
+
.animate(
|
471
|
+
extend(point.shapeArgs, {
|
472
|
+
fill: point.color || series.color
|
473
|
+
}),
|
474
|
+
animationOptions
|
475
|
+
);
|
476
|
+
}
|
477
|
+
if (point.dataLabel) {
|
478
|
+
point.dataLabel.fadeIn(animationOptions);
|
479
|
+
}
|
480
|
+
});
|
481
|
+
this.animate = null;
|
482
|
+
}
|
483
|
+
|
484
|
+
};
|
485
|
+
|
486
|
+
/**
|
487
|
+
* When drilling up, pull out the individual point graphics from the lower series
|
488
|
+
* and animate them into the origin point in the upper series.
|
489
|
+
*/
|
490
|
+
ColumnSeries.prototype.animateDrillupFrom = function(level) {
|
491
|
+
var animationOptions = this.chart.options.drilldown.animation,
|
492
|
+
group = this.group,
|
493
|
+
series = this;
|
494
|
+
|
495
|
+
// Cancel mouse events on the series group (#2787)
|
496
|
+
each(series.trackerGroups, function(key) {
|
497
|
+
if (series[key]) { // we don't always have dataLabelsGroup
|
498
|
+
series[key].on('mouseover');
|
499
|
+
}
|
500
|
+
});
|
501
|
+
|
502
|
+
|
503
|
+
delete this.group;
|
504
|
+
each(this.points, function(point) {
|
505
|
+
var graphic = point.graphic,
|
506
|
+
animateTo = level.shapeArgs,
|
507
|
+
complete = function() {
|
508
|
+
graphic.destroy();
|
509
|
+
if (group) {
|
510
|
+
group = group.destroy();
|
511
|
+
}
|
512
|
+
};
|
513
|
+
|
514
|
+
if (graphic) {
|
515
|
+
|
516
|
+
delete point.graphic;
|
517
|
+
|
518
|
+
|
519
|
+
animateTo.fill = level.color;
|
520
|
+
|
521
|
+
|
522
|
+
if (animationOptions) {
|
523
|
+
graphic.animate(
|
524
|
+
animateTo,
|
525
|
+
H.merge(animationOptions, {
|
526
|
+
complete: complete
|
527
|
+
})
|
528
|
+
);
|
529
|
+
} else {
|
530
|
+
graphic.attr(animateTo);
|
531
|
+
complete();
|
532
|
+
}
|
533
|
+
}
|
534
|
+
});
|
535
|
+
};
|
536
|
+
|
537
|
+
if (PieSeries) {
|
538
|
+
extend(PieSeries.prototype, {
|
539
|
+
supportsDrilldown: true,
|
540
|
+
animateDrillupTo: ColumnSeries.prototype.animateDrillupTo,
|
541
|
+
animateDrillupFrom: ColumnSeries.prototype.animateDrillupFrom,
|
542
|
+
|
543
|
+
animateDrilldown: function(init) {
|
544
|
+
var level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
|
545
|
+
animationOptions = this.chart.options.drilldown.animation,
|
546
|
+
animateFrom = level.shapeArgs,
|
547
|
+
start = animateFrom.start,
|
548
|
+
angle = animateFrom.end - start,
|
549
|
+
startAngle = angle / this.points.length;
|
550
|
+
|
551
|
+
if (!init) {
|
552
|
+
each(this.points, function(point, i) {
|
553
|
+
var animateTo = point.shapeArgs;
|
554
|
+
|
555
|
+
|
556
|
+
animateFrom.fill = level.color;
|
557
|
+
animateTo.fill = point.color;
|
558
|
+
|
559
|
+
|
560
|
+
if (point.graphic) {
|
561
|
+
point.graphic
|
562
|
+
.attr(H.merge(animateFrom, {
|
563
|
+
start: start + i * startAngle,
|
564
|
+
end: start + (i + 1) * startAngle
|
565
|
+
}))[animationOptions ? 'animate' : 'attr'](
|
566
|
+
animateTo,
|
567
|
+
animationOptions
|
568
|
+
);
|
569
|
+
}
|
570
|
+
});
|
571
|
+
this.animate = null;
|
572
|
+
}
|
573
|
+
}
|
574
|
+
});
|
575
|
+
}
|
576
|
+
|
577
|
+
H.Point.prototype.doDrilldown = function(_holdRedraw, category, originalEvent) {
|
578
|
+
var series = this.series,
|
579
|
+
chart = series.chart,
|
580
|
+
drilldown = chart.options.drilldown,
|
581
|
+
i = (drilldown.series || []).length,
|
582
|
+
seriesOptions;
|
583
|
+
|
584
|
+
if (!chart.ddDupes) {
|
585
|
+
chart.ddDupes = [];
|
586
|
+
}
|
587
|
+
|
588
|
+
while (i-- && !seriesOptions) {
|
589
|
+
if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, chart.ddDupes) === -1) {
|
590
|
+
seriesOptions = drilldown.series[i];
|
591
|
+
chart.ddDupes.push(this.drilldown);
|
592
|
+
}
|
593
|
+
}
|
594
|
+
|
595
|
+
// Fire the event. If seriesOptions is undefined, the implementer can check for
|
596
|
+
// seriesOptions, and call addSeriesAsDrilldown async if necessary.
|
597
|
+
fireEvent(chart, 'drilldown', {
|
598
|
+
point: this,
|
599
|
+
seriesOptions: seriesOptions,
|
600
|
+
category: category,
|
601
|
+
originalEvent: originalEvent,
|
602
|
+
points: category !== undefined && this.series.xAxis.getDDPoints(category).slice(0)
|
603
|
+
}, function(e) {
|
604
|
+
var chart = e.point.series && e.point.series.chart,
|
605
|
+
seriesOptions = e.seriesOptions;
|
606
|
+
if (chart && seriesOptions) {
|
607
|
+
if (_holdRedraw) {
|
608
|
+
chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
|
609
|
+
} else {
|
610
|
+
chart.addSeriesAsDrilldown(e.point, seriesOptions);
|
611
|
+
}
|
612
|
+
}
|
613
|
+
});
|
614
|
+
|
615
|
+
|
616
|
+
};
|
617
|
+
|
618
|
+
/**
|
619
|
+
* Drill down to a given category. This is the same as clicking on an axis label.
|
620
|
+
*/
|
621
|
+
H.Axis.prototype.drilldownCategory = function(x, e) {
|
622
|
+
var key,
|
623
|
+
point,
|
624
|
+
ddPointsX = this.getDDPoints(x);
|
625
|
+
for (key in ddPointsX) {
|
626
|
+
point = ddPointsX[key];
|
627
|
+
if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
|
628
|
+
point.doDrilldown(true, x, e);
|
629
|
+
}
|
630
|
+
}
|
631
|
+
this.chart.applyDrilldown();
|
632
|
+
};
|
633
|
+
|
634
|
+
/**
|
635
|
+
* Return drillable points for this specific X value
|
636
|
+
*/
|
637
|
+
H.Axis.prototype.getDDPoints = function(x) {
|
638
|
+
var ret = [];
|
639
|
+
each(this.series, function(series) {
|
640
|
+
var i,
|
641
|
+
xData = series.xData,
|
642
|
+
points = series.points;
|
643
|
+
|
644
|
+
for (i = 0; i < xData.length; i++) {
|
645
|
+
if (xData[i] === x && series.options.data[i].drilldown) {
|
646
|
+
ret.push(points ? points[i] : true);
|
647
|
+
break;
|
648
|
+
}
|
649
|
+
}
|
650
|
+
});
|
651
|
+
return ret;
|
652
|
+
};
|
653
|
+
|
654
|
+
|
655
|
+
/**
|
656
|
+
* Make a tick label drillable, or remove drilling on update
|
657
|
+
*/
|
658
|
+
Tick.prototype.drillable = function() {
|
659
|
+
var pos = this.pos,
|
660
|
+
label = this.label,
|
661
|
+
axis = this.axis,
|
662
|
+
isDrillable = axis.coll === 'xAxis' && axis.getDDPoints,
|
663
|
+
ddPointsX = isDrillable && axis.getDDPoints(pos);
|
664
|
+
|
665
|
+
if (isDrillable) {
|
666
|
+
if (label && ddPointsX.length) {
|
667
|
+
label.drillable = true;
|
668
|
+
|
669
|
+
|
670
|
+
if (!label.basicStyles) {
|
671
|
+
label.basicStyles = H.merge(label.styles);
|
672
|
+
}
|
673
|
+
|
674
|
+
|
675
|
+
label
|
676
|
+
.addClass('highcharts-drilldown-axis-label')
|
677
|
+
|
678
|
+
.css(axis.chart.options.drilldown.activeAxisLabelStyle)
|
679
|
+
|
680
|
+
.on('click', function(e) {
|
681
|
+
axis.drilldownCategory(pos, e);
|
682
|
+
});
|
683
|
+
|
684
|
+
} else if (label && label.drillable) {
|
685
|
+
|
686
|
+
|
687
|
+
label.styles = {}; // reset for full overwrite of styles
|
688
|
+
label.css(label.basicStyles);
|
689
|
+
|
690
|
+
|
691
|
+
label.on('click', null); // #3806
|
692
|
+
label.removeClass('highcharts-drilldown-axis-label');
|
693
|
+
}
|
694
|
+
}
|
695
|
+
};
|
696
|
+
|
697
|
+
/**
|
698
|
+
* Always keep the drillability updated (#3951)
|
699
|
+
*/
|
700
|
+
wrap(Tick.prototype, 'addLabel', function(proceed) {
|
701
|
+
proceed.call(this);
|
702
|
+
this.drillable();
|
703
|
+
});
|
704
|
+
|
705
|
+
|
706
|
+
/**
|
707
|
+
* On initialization of each point, identify its label and make it clickable. Also, provide a
|
708
|
+
* list of points associated to that label.
|
709
|
+
*/
|
710
|
+
wrap(H.Point.prototype, 'init', function(proceed, series, options, x) {
|
711
|
+
var point = proceed.call(this, series, options, x),
|
712
|
+
xAxis = series.xAxis,
|
713
|
+
tick = xAxis && xAxis.ticks[x];
|
714
|
+
|
715
|
+
if (point.drilldown) {
|
716
|
+
|
717
|
+
// Add the click event to the point
|
718
|
+
H.addEvent(point, 'click', function(e) {
|
719
|
+
if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
|
720
|
+
series.xAxis.drilldownCategory(x, e);
|
721
|
+
} else {
|
722
|
+
point.doDrilldown(undefined, undefined, e);
|
723
|
+
}
|
724
|
+
});
|
725
|
+
/*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
|
726
|
+
if (!this.hasImportedEvents) {
|
727
|
+
proceed.call(this);
|
728
|
+
H.addEvent(this, 'click', function () {
|
729
|
+
this.doDrilldown();
|
730
|
+
});
|
731
|
+
}
|
732
|
+
});*/
|
733
|
+
|
734
|
+
}
|
735
|
+
|
736
|
+
// Add or remove click handler and style on the tick label
|
737
|
+
if (tick) {
|
738
|
+
tick.drillable();
|
739
|
+
}
|
740
|
+
|
741
|
+
return point;
|
742
|
+
});
|
743
|
+
|
744
|
+
wrap(H.Series.prototype, 'drawDataLabels', function(proceed) {
|
745
|
+
var css = this.chart.options.drilldown.activeDataLabelStyle,
|
746
|
+
renderer = this.chart.renderer;
|
747
|
+
|
748
|
+
proceed.call(this);
|
749
|
+
|
750
|
+
each(this.points, function(point) {
|
751
|
+
var pointCSS = {};
|
752
|
+
if (point.drilldown && point.dataLabel) {
|
753
|
+
if (css.color === 'contrast') {
|
754
|
+
pointCSS.color = renderer.getContrast(point.color || this.color);
|
755
|
+
}
|
756
|
+
point.dataLabel
|
757
|
+
.addClass('highcharts-drilldown-data-label');
|
758
|
+
|
759
|
+
|
760
|
+
point.dataLabel
|
761
|
+
.css(css)
|
762
|
+
.css(pointCSS);
|
763
|
+
|
764
|
+
}
|
765
|
+
}, this);
|
766
|
+
});
|
767
|
+
|
768
|
+
// Mark the trackers with a pointer
|
769
|
+
var type,
|
770
|
+
drawTrackerWrapper = function(proceed) {
|
771
|
+
proceed.call(this);
|
772
|
+
each(this.points, function(point) {
|
773
|
+
if (point.drilldown && point.graphic) {
|
774
|
+
point.graphic.addClass('highcharts-drilldown-point');
|
775
|
+
|
776
|
+
|
777
|
+
point.graphic.css({
|
778
|
+
cursor: 'pointer'
|
779
|
+
});
|
780
|
+
|
781
|
+
}
|
782
|
+
});
|
783
|
+
};
|
784
|
+
for (type in seriesTypes) {
|
785
|
+
if (seriesTypes[type].prototype.supportsDrilldown) {
|
786
|
+
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
|
787
|
+
}
|
788
|
+
}
|
789
|
+
|
790
|
+
}(Highcharts));
|
731
791
|
}));
|