highcharts-rails 0.1.1 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -1
- data/lib/highcharts/version.rb +1 -1
- data/vendor/assets/javascripts/highcharts.js +11454 -11103
- data/vendor/assets/javascripts/highcharts/adapters/mootools.js +264 -243
- data/vendor/assets/javascripts/highcharts/adapters/prototype.js +331 -284
- data/vendor/assets/javascripts/highcharts/modules/exporting.js +758 -703
- data/vendor/assets/javascripts/highcharts/themes/dark-blue.js +262 -267
- data/vendor/assets/javascripts/highcharts/themes/dark-green.js +262 -267
- data/vendor/assets/javascripts/highcharts/themes/gray.js +262 -262
- data/vendor/assets/javascripts/highcharts/themes/grid.js +96 -97
- metadata +8 -8
@@ -1,703 +1,758 @@
|
|
1
|
-
/**
|
2
|
-
* @license Highcharts JS v2.1.
|
3
|
-
* Exporting module
|
4
|
-
*
|
5
|
-
* (c) 2010-2011 Torstein Hønsi
|
6
|
-
*
|
7
|
-
* License: www.highcharts.com/license
|
8
|
-
*/
|
9
|
-
|
10
|
-
// JSLint options:
|
11
|
-
/*global Highcharts, document, window, Math, setTimeout */
|
12
|
-
|
13
|
-
(function() { // encapsulate
|
14
|
-
|
15
|
-
// create shortcuts
|
16
|
-
var HC = Highcharts,
|
17
|
-
Chart = HC.Chart,
|
18
|
-
addEvent = HC.addEvent,
|
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
|
-
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
53
|
-
// This can be extended later to add control buttons like zoom and pan right click menus.
|
54
|
-
defaultOptions.navigation = {
|
55
|
-
menuStyle: {
|
56
|
-
border: '1px solid #A0A0A0',
|
57
|
-
background: '#FFFFFF'
|
58
|
-
},
|
59
|
-
menuItemStyle: {
|
60
|
-
padding: '0 5px',
|
61
|
-
background: NONE,
|
62
|
-
color: '#303030',
|
63
|
-
fontSize: hasTouch ? '14px' : '11px'
|
64
|
-
},
|
65
|
-
menuItemHoverStyle: {
|
66
|
-
background: '#4572A5',
|
67
|
-
color: '#FFFFFF'
|
68
|
-
},
|
69
|
-
|
70
|
-
buttonOptions: {
|
71
|
-
align: 'right',
|
72
|
-
backgroundColor: {
|
73
|
-
linearGradient: [0, 0, 0, 20],
|
74
|
-
stops: [
|
75
|
-
[0.4, '#F7F7F7'],
|
76
|
-
[0.6, '#E3E3E3']
|
77
|
-
]
|
78
|
-
},
|
79
|
-
borderColor: '#B0B0B0',
|
80
|
-
borderRadius: 3,
|
81
|
-
borderWidth: 1,
|
82
|
-
//enabled: true,
|
83
|
-
height: 20,
|
84
|
-
hoverBorderColor: '#909090',
|
85
|
-
hoverSymbolFill: '#81A7CF',
|
86
|
-
hoverSymbolStroke: '#4572A5',
|
87
|
-
symbolFill: '#E0E0E0',
|
88
|
-
//symbolSize: 12,
|
89
|
-
symbolStroke: '#A0A0A0',
|
90
|
-
//symbolStrokeWidth: 1,
|
91
|
-
symbolX: 11.5,
|
92
|
-
symbolY: 10.5,
|
93
|
-
verticalAlign: 'top',
|
94
|
-
width: 24,
|
95
|
-
y: 10
|
96
|
-
}
|
97
|
-
};
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
// Add the export related options
|
102
|
-
defaultOptions.exporting = {
|
103
|
-
//enabled: true,
|
104
|
-
//filename: 'chart',
|
105
|
-
type: 'image/png',
|
106
|
-
url: 'http://export.highcharts.com/',
|
107
|
-
width: 800,
|
108
|
-
enableImages: false,
|
109
|
-
buttons: {
|
110
|
-
exportButton: {
|
111
|
-
//enabled: true,
|
112
|
-
symbol: 'exportIcon',
|
113
|
-
x: -10,
|
114
|
-
symbolFill: '#A8BF77',
|
115
|
-
hoverSymbolFill: '#768F3E',
|
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
|
-
.replace(
|
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
|
-
options.
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
seriesOptions
|
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
|
-
chartCopy.
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
.replace(/
|
297
|
-
.replace(/
|
298
|
-
.replace(
|
299
|
-
.replace(/
|
300
|
-
|
301
|
-
|
302
|
-
.replace(/
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
//
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
.replace(
|
312
|
-
.replace(
|
313
|
-
|
314
|
-
|
315
|
-
.replace(/
|
316
|
-
.replace(/
|
317
|
-
.replace(/
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
.replace(
|
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
|
-
|
1
|
+
/**
|
2
|
+
* @license Highcharts JS v2.1.9 (2011-11-11)
|
3
|
+
* Exporting module
|
4
|
+
*
|
5
|
+
* (c) 2010-2011 Torstein Hønsi
|
6
|
+
*
|
7
|
+
* License: www.highcharts.com/license
|
8
|
+
*/
|
9
|
+
|
10
|
+
// JSLint options:
|
11
|
+
/*global Highcharts, document, window, Math, setTimeout */
|
12
|
+
|
13
|
+
(function () { // encapsulate
|
14
|
+
|
15
|
+
// create shortcuts
|
16
|
+
var HC = Highcharts,
|
17
|
+
Chart = HC.Chart,
|
18
|
+
addEvent = HC.addEvent,
|
19
|
+
removeEvent = HC.removeEvent,
|
20
|
+
createElement = HC.createElement,
|
21
|
+
discardElement = HC.discardElement,
|
22
|
+
css = HC.css,
|
23
|
+
merge = HC.merge,
|
24
|
+
each = HC.each,
|
25
|
+
extend = HC.extend,
|
26
|
+
math = Math,
|
27
|
+
mathMax = math.max,
|
28
|
+
doc = document,
|
29
|
+
win = window,
|
30
|
+
hasTouch = doc.documentElement.ontouchstart !== undefined,
|
31
|
+
M = 'M',
|
32
|
+
L = 'L',
|
33
|
+
DIV = 'div',
|
34
|
+
HIDDEN = 'hidden',
|
35
|
+
NONE = 'none',
|
36
|
+
PREFIX = 'highcharts-',
|
37
|
+
ABSOLUTE = 'absolute',
|
38
|
+
PX = 'px',
|
39
|
+
UNDEFINED,
|
40
|
+
defaultOptions = HC.getOptions();
|
41
|
+
|
42
|
+
// Add language
|
43
|
+
extend(defaultOptions.lang, {
|
44
|
+
downloadPNG: 'Download PNG image',
|
45
|
+
downloadJPEG: 'Download JPEG image',
|
46
|
+
downloadPDF: 'Download PDF document',
|
47
|
+
downloadSVG: 'Download SVG vector image',
|
48
|
+
exportButtonTitle: 'Export to raster or vector image',
|
49
|
+
printButtonTitle: 'Print the chart'
|
50
|
+
});
|
51
|
+
|
52
|
+
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
53
|
+
// This can be extended later to add control buttons like zoom and pan right click menus.
|
54
|
+
defaultOptions.navigation = {
|
55
|
+
menuStyle: {
|
56
|
+
border: '1px solid #A0A0A0',
|
57
|
+
background: '#FFFFFF'
|
58
|
+
},
|
59
|
+
menuItemStyle: {
|
60
|
+
padding: '0 5px',
|
61
|
+
background: NONE,
|
62
|
+
color: '#303030',
|
63
|
+
fontSize: hasTouch ? '14px' : '11px'
|
64
|
+
},
|
65
|
+
menuItemHoverStyle: {
|
66
|
+
background: '#4572A5',
|
67
|
+
color: '#FFFFFF'
|
68
|
+
},
|
69
|
+
|
70
|
+
buttonOptions: {
|
71
|
+
align: 'right',
|
72
|
+
backgroundColor: {
|
73
|
+
linearGradient: [0, 0, 0, 20],
|
74
|
+
stops: [
|
75
|
+
[0.4, '#F7F7F7'],
|
76
|
+
[0.6, '#E3E3E3']
|
77
|
+
]
|
78
|
+
},
|
79
|
+
borderColor: '#B0B0B0',
|
80
|
+
borderRadius: 3,
|
81
|
+
borderWidth: 1,
|
82
|
+
//enabled: true,
|
83
|
+
height: 20,
|
84
|
+
hoverBorderColor: '#909090',
|
85
|
+
hoverSymbolFill: '#81A7CF',
|
86
|
+
hoverSymbolStroke: '#4572A5',
|
87
|
+
symbolFill: '#E0E0E0',
|
88
|
+
//symbolSize: 12,
|
89
|
+
symbolStroke: '#A0A0A0',
|
90
|
+
//symbolStrokeWidth: 1,
|
91
|
+
symbolX: 11.5,
|
92
|
+
symbolY: 10.5,
|
93
|
+
verticalAlign: 'top',
|
94
|
+
width: 24,
|
95
|
+
y: 10
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
// Add the export related options
|
102
|
+
defaultOptions.exporting = {
|
103
|
+
//enabled: true,
|
104
|
+
//filename: 'chart',
|
105
|
+
type: 'image/png',
|
106
|
+
url: 'http://export.highcharts.com/',
|
107
|
+
width: 800,
|
108
|
+
enableImages: false,
|
109
|
+
buttons: {
|
110
|
+
exportButton: {
|
111
|
+
//enabled: true,
|
112
|
+
symbol: 'exportIcon',
|
113
|
+
x: -10,
|
114
|
+
symbolFill: '#A8BF77',
|
115
|
+
hoverSymbolFill: '#768F3E',
|
116
|
+
_id: 'exportButton',
|
117
|
+
_titleKey: 'exportButtonTitle',
|
118
|
+
menuItems: [{
|
119
|
+
textKey: 'downloadPNG',
|
120
|
+
onclick: function () {
|
121
|
+
this.exportChart();
|
122
|
+
}
|
123
|
+
}, {
|
124
|
+
textKey: 'downloadJPEG',
|
125
|
+
onclick: function () {
|
126
|
+
this.exportChart({
|
127
|
+
type: 'image/jpeg'
|
128
|
+
});
|
129
|
+
}
|
130
|
+
}, {
|
131
|
+
textKey: 'downloadPDF',
|
132
|
+
onclick: function () {
|
133
|
+
this.exportChart({
|
134
|
+
type: 'application/pdf'
|
135
|
+
});
|
136
|
+
}
|
137
|
+
}, {
|
138
|
+
textKey: 'downloadSVG',
|
139
|
+
onclick: function () {
|
140
|
+
this.exportChart({
|
141
|
+
type: 'image/svg+xml'
|
142
|
+
});
|
143
|
+
}
|
144
|
+
}/*, {
|
145
|
+
text: 'View SVG',
|
146
|
+
onclick: function() {
|
147
|
+
var svg = this.getSVG()
|
148
|
+
.replace(/</g, '\n<')
|
149
|
+
.replace(/>/g, '>');
|
150
|
+
|
151
|
+
doc.body.innerHTML = '<pre>'+ svg +'</pre>';
|
152
|
+
}
|
153
|
+
}*/]
|
154
|
+
|
155
|
+
},
|
156
|
+
printButton: {
|
157
|
+
//enabled: true,
|
158
|
+
symbol: 'printIcon',
|
159
|
+
x: -36,
|
160
|
+
symbolFill: '#B5C9DF',
|
161
|
+
hoverSymbolFill: '#779ABF',
|
162
|
+
_id: 'printButton',
|
163
|
+
_titleKey: 'printButtonTitle',
|
164
|
+
onclick: function () {
|
165
|
+
this.print();
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
};
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
extend(Chart.prototype, {
|
174
|
+
/**
|
175
|
+
* Return an SVG representation of the chart
|
176
|
+
*
|
177
|
+
* @param additionalOptions {Object} Additional chart options for the generated SVG representation
|
178
|
+
*/
|
179
|
+
getSVG: function (additionalOptions) {
|
180
|
+
var chart = this,
|
181
|
+
chartCopy,
|
182
|
+
sandbox,
|
183
|
+
svg,
|
184
|
+
seriesOptions,
|
185
|
+
config,
|
186
|
+
pointOptions,
|
187
|
+
pointMarker,
|
188
|
+
options = merge(chart.options, additionalOptions); // copy the options and add extra options
|
189
|
+
|
190
|
+
// IE compatibility hack for generating SVG content that it doesn't really understand
|
191
|
+
if (!doc.createElementNS) {
|
192
|
+
/*jslint unparam: true*//* allow unused parameter ns in function below */
|
193
|
+
doc.createElementNS = function (ns, tagName) {
|
194
|
+
var elem = doc.createElement(tagName);
|
195
|
+
elem.getBBox = function () {
|
196
|
+
return HC.Renderer.prototype.Element.prototype.getBBox.apply({ element: elem });
|
197
|
+
};
|
198
|
+
return elem;
|
199
|
+
};
|
200
|
+
/*jslint unparam: false*/
|
201
|
+
}
|
202
|
+
|
203
|
+
// create a sandbox where a new chart will be generated
|
204
|
+
sandbox = createElement(DIV, null, {
|
205
|
+
position: ABSOLUTE,
|
206
|
+
top: '-9999em',
|
207
|
+
width: chart.chartWidth + PX,
|
208
|
+
height: chart.chartHeight + PX
|
209
|
+
}, doc.body);
|
210
|
+
|
211
|
+
// override some options
|
212
|
+
extend(options.chart, {
|
213
|
+
renderTo: sandbox,
|
214
|
+
forExport: true
|
215
|
+
});
|
216
|
+
options.exporting.enabled = false; // hide buttons in print
|
217
|
+
|
218
|
+
if (!options.exporting.enableImages) {
|
219
|
+
options.chart.plotBackgroundImage = null; // the converter doesn't handle images
|
220
|
+
}
|
221
|
+
|
222
|
+
// prepare for replicating the chart
|
223
|
+
options.series = [];
|
224
|
+
each(chart.series, function (serie) {
|
225
|
+
seriesOptions = serie.options;
|
226
|
+
|
227
|
+
seriesOptions.animation = false; // turn off animation
|
228
|
+
seriesOptions.showCheckbox = false;
|
229
|
+
seriesOptions.visible = serie.visible;
|
230
|
+
|
231
|
+
if (!options.exporting.enableImages) {
|
232
|
+
// remove image markers
|
233
|
+
if (seriesOptions && seriesOptions.marker && /^url\(/.test(seriesOptions.marker.symbol)) {
|
234
|
+
seriesOptions.marker.symbol = 'circle';
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
seriesOptions.data = [];
|
239
|
+
|
240
|
+
each(serie.data, function (point) {
|
241
|
+
|
242
|
+
// extend the options by those values that can be expressed in a number or array config
|
243
|
+
config = point.config;
|
244
|
+
pointOptions = {
|
245
|
+
x: point.x,
|
246
|
+
y: point.y,
|
247
|
+
name: point.name
|
248
|
+
};
|
249
|
+
|
250
|
+
if (typeof config === 'object' && point.config && config.constructor !== Array) {
|
251
|
+
extend(pointOptions, config);
|
252
|
+
}
|
253
|
+
|
254
|
+
pointOptions.visible = point.visible;
|
255
|
+
seriesOptions.data.push(pointOptions); // copy fresh updated data
|
256
|
+
|
257
|
+
if (!options.exporting.enableImages) {
|
258
|
+
// remove image markers
|
259
|
+
pointMarker = point.config && point.config.marker;
|
260
|
+
if (pointMarker && /^url\(/.test(pointMarker.symbol)) {
|
261
|
+
delete pointMarker.symbol;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
});
|
265
|
+
|
266
|
+
options.series.push(seriesOptions);
|
267
|
+
});
|
268
|
+
|
269
|
+
// generate the chart copy
|
270
|
+
chartCopy = new Highcharts.Chart(options);
|
271
|
+
|
272
|
+
// reflect axis extremes in the export
|
273
|
+
each(['xAxis', 'yAxis'], function (axisType) {
|
274
|
+
each(chart[axisType], function (axis, i) {
|
275
|
+
var axisCopy = chartCopy[axisType][i],
|
276
|
+
extremes = axis.getExtremes(),
|
277
|
+
userMin = extremes.userMin,
|
278
|
+
userMax = extremes.userMax;
|
279
|
+
|
280
|
+
if (userMin !== UNDEFINED || userMax !== UNDEFINED) {
|
281
|
+
axisCopy.setExtremes(userMin, userMax, true, false);
|
282
|
+
}
|
283
|
+
});
|
284
|
+
});
|
285
|
+
|
286
|
+
// get the SVG from the container's innerHTML
|
287
|
+
svg = chartCopy.container.innerHTML;
|
288
|
+
|
289
|
+
// free up memory
|
290
|
+
options = null;
|
291
|
+
chartCopy.destroy();
|
292
|
+
discardElement(sandbox);
|
293
|
+
|
294
|
+
// sanitize
|
295
|
+
svg = svg
|
296
|
+
.replace(/zIndex="[^"]+"/g, '')
|
297
|
+
.replace(/isShadow="[^"]+"/g, '')
|
298
|
+
.replace(/symbolName="[^"]+"/g, '')
|
299
|
+
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
300
|
+
.replace(/isTracker="[^"]+"/g, '')
|
301
|
+
.replace(/url\([^#]+#/g, 'url(#')
|
302
|
+
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
303
|
+
.replace(/ href=/g, ' xlink:href=')
|
304
|
+
/*.replace(/preserveAspectRatio="none">/g, 'preserveAspectRatio="none"/>')*/
|
305
|
+
/* This fails in IE < 8
|
306
|
+
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
|
307
|
+
return s2 +'.'+ s3[0];
|
308
|
+
})*/
|
309
|
+
|
310
|
+
// Replace HTML entities, issue #347
|
311
|
+
.replace(/ /g, '\u00A0') // no-break space
|
312
|
+
.replace(/­/g, '\u00AD') // soft hyphen
|
313
|
+
|
314
|
+
// IE specific
|
315
|
+
.replace(/id=([^" >]+)/g, 'id="$1"')
|
316
|
+
.replace(/class=([^" ]+)/g, 'class="$1"')
|
317
|
+
.replace(/ transform /g, ' ')
|
318
|
+
.replace(/:(path|rect)/g, '$1')
|
319
|
+
.replace(/<img ([^>]*)>/gi, '<image $1 />')
|
320
|
+
.replace(/<\/image>/g, '') // remove closing tags for images as they'll never have any content
|
321
|
+
.replace(/<image ([^>]*)([^\/])>/gi, '<image $1$2 />') // closes image tags for firefox
|
322
|
+
.replace(/width=(\d+)/g, 'width="$1"')
|
323
|
+
.replace(/height=(\d+)/g, 'height="$1"')
|
324
|
+
.replace(/hc-svg-href="/g, 'xlink:href="')
|
325
|
+
.replace(/style="([^"]+)"/g, function (s) {
|
326
|
+
return s.toLowerCase();
|
327
|
+
});
|
328
|
+
|
329
|
+
// IE9 beta bugs with innerHTML. Test again with final IE9.
|
330
|
+
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1')
|
331
|
+
.replace(/"/g, "'");
|
332
|
+
if (svg.match(/ xmlns="/g).length === 2) {
|
333
|
+
svg = svg.replace(/xmlns="[^"]+"/, '');
|
334
|
+
}
|
335
|
+
|
336
|
+
return svg;
|
337
|
+
},
|
338
|
+
|
339
|
+
/**
|
340
|
+
* Submit the SVG representation of the chart to the server
|
341
|
+
* @param {Object} options Exporting options. Possible members are url, type and width.
|
342
|
+
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart
|
343
|
+
*/
|
344
|
+
exportChart: function (options, chartOptions) {
|
345
|
+
var form,
|
346
|
+
chart = this,
|
347
|
+
svg = chart.getSVG(chartOptions);
|
348
|
+
|
349
|
+
// merge the options
|
350
|
+
options = merge(chart.options.exporting, options);
|
351
|
+
|
352
|
+
// create the form
|
353
|
+
form = createElement('form', {
|
354
|
+
method: 'post',
|
355
|
+
action: options.url
|
356
|
+
}, {
|
357
|
+
display: NONE
|
358
|
+
}, doc.body);
|
359
|
+
|
360
|
+
// add the values
|
361
|
+
each(['filename', 'type', 'width', 'svg'], function (name) {
|
362
|
+
createElement('input', {
|
363
|
+
type: HIDDEN,
|
364
|
+
name: name,
|
365
|
+
value: {
|
366
|
+
filename: options.filename || 'chart',
|
367
|
+
type: options.type,
|
368
|
+
width: options.width,
|
369
|
+
svg: svg
|
370
|
+
}[name]
|
371
|
+
}, null, form);
|
372
|
+
});
|
373
|
+
|
374
|
+
// submit
|
375
|
+
form.submit();
|
376
|
+
|
377
|
+
// clean up
|
378
|
+
discardElement(form);
|
379
|
+
},
|
380
|
+
|
381
|
+
/**
|
382
|
+
* Print the chart
|
383
|
+
*/
|
384
|
+
print: function () {
|
385
|
+
|
386
|
+
var chart = this,
|
387
|
+
container = chart.container,
|
388
|
+
origDisplay = [],
|
389
|
+
origParent = container.parentNode,
|
390
|
+
body = doc.body,
|
391
|
+
childNodes = body.childNodes;
|
392
|
+
|
393
|
+
if (chart.isPrinting) { // block the button while in printing mode
|
394
|
+
return;
|
395
|
+
}
|
396
|
+
|
397
|
+
chart.isPrinting = true;
|
398
|
+
|
399
|
+
// hide all body content
|
400
|
+
each(childNodes, function (node, i) {
|
401
|
+
if (node.nodeType === 1) {
|
402
|
+
origDisplay[i] = node.style.display;
|
403
|
+
node.style.display = NONE;
|
404
|
+
}
|
405
|
+
});
|
406
|
+
|
407
|
+
// pull out the chart
|
408
|
+
body.appendChild(container);
|
409
|
+
|
410
|
+
// print
|
411
|
+
win.print();
|
412
|
+
|
413
|
+
// allow the browser to prepare before reverting
|
414
|
+
setTimeout(function () {
|
415
|
+
|
416
|
+
// put the chart back in
|
417
|
+
origParent.appendChild(container);
|
418
|
+
|
419
|
+
// restore all body content
|
420
|
+
each(childNodes, function (node, i) {
|
421
|
+
if (node.nodeType === 1) {
|
422
|
+
node.style.display = origDisplay[i];
|
423
|
+
}
|
424
|
+
});
|
425
|
+
|
426
|
+
chart.isPrinting = false;
|
427
|
+
|
428
|
+
}, 1000);
|
429
|
+
|
430
|
+
},
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Display a popup menu for choosing the export type
|
434
|
+
*
|
435
|
+
* @param {String} name An identifier for the menu
|
436
|
+
* @param {Array} items A collection with text and onclicks for the items
|
437
|
+
* @param {Number} x The x position of the opener button
|
438
|
+
* @param {Number} y The y position of the opener button
|
439
|
+
* @param {Number} width The width of the opener button
|
440
|
+
* @param {Number} height The height of the opener button
|
441
|
+
*/
|
442
|
+
contextMenu: function (name, items, x, y, width, height) {
|
443
|
+
var chart = this,
|
444
|
+
navOptions = chart.options.navigation,
|
445
|
+
menuItemStyle = navOptions.menuItemStyle,
|
446
|
+
chartWidth = chart.chartWidth,
|
447
|
+
chartHeight = chart.chartHeight,
|
448
|
+
cacheName = 'cache-' + name,
|
449
|
+
menu = chart[cacheName],
|
450
|
+
menuPadding = mathMax(width, height), // for mouse leave detection
|
451
|
+
boxShadow = '3px 3px 10px #888',
|
452
|
+
innerMenu,
|
453
|
+
hide,
|
454
|
+
menuStyle;
|
455
|
+
|
456
|
+
// create the menu only the first time
|
457
|
+
if (!menu) {
|
458
|
+
|
459
|
+
// create a HTML element above the SVG
|
460
|
+
chart[cacheName] = menu = createElement(DIV, {
|
461
|
+
className: PREFIX + name
|
462
|
+
}, {
|
463
|
+
position: ABSOLUTE,
|
464
|
+
zIndex: 1000,
|
465
|
+
padding: menuPadding + PX
|
466
|
+
}, chart.container);
|
467
|
+
|
468
|
+
innerMenu = createElement(DIV, null,
|
469
|
+
extend({
|
470
|
+
MozBoxShadow: boxShadow,
|
471
|
+
WebkitBoxShadow: boxShadow,
|
472
|
+
boxShadow: boxShadow
|
473
|
+
}, navOptions.menuStyle), menu);
|
474
|
+
|
475
|
+
// hide on mouse out
|
476
|
+
hide = function () {
|
477
|
+
css(menu, { display: NONE });
|
478
|
+
};
|
479
|
+
|
480
|
+
addEvent(menu, 'mouseleave', hide);
|
481
|
+
|
482
|
+
|
483
|
+
// create the items
|
484
|
+
each(items, function (item) {
|
485
|
+
if (item) {
|
486
|
+
var div = createElement(DIV, {
|
487
|
+
onmouseover: function () {
|
488
|
+
css(this, navOptions.menuItemHoverStyle);
|
489
|
+
},
|
490
|
+
onmouseout: function () {
|
491
|
+
css(this, menuItemStyle);
|
492
|
+
},
|
493
|
+
innerHTML: item.text || chart.options.lang[item.textKey]
|
494
|
+
}, extend({
|
495
|
+
cursor: 'pointer'
|
496
|
+
}, menuItemStyle), innerMenu);
|
497
|
+
|
498
|
+
div[hasTouch ? 'ontouchstart' : 'onclick'] = function () {
|
499
|
+
hide();
|
500
|
+
item.onclick.apply(chart, arguments);
|
501
|
+
};
|
502
|
+
|
503
|
+
// Keep references to menu divs to be able to destroy them
|
504
|
+
chart.exportDivElements.push(div);
|
505
|
+
}
|
506
|
+
});
|
507
|
+
|
508
|
+
// Keep references to menu and innerMenu div to be able to destroy them
|
509
|
+
chart.exportDivElements.push(innerMenu, menu);
|
510
|
+
|
511
|
+
chart.exportMenuWidth = menu.offsetWidth;
|
512
|
+
chart.exportMenuHeight = menu.offsetHeight;
|
513
|
+
}
|
514
|
+
|
515
|
+
menuStyle = { display: 'block' };
|
516
|
+
|
517
|
+
// if outside right, right align it
|
518
|
+
if (x + chart.exportMenuWidth > chartWidth) {
|
519
|
+
menuStyle.right = (chartWidth - x - width - menuPadding) + PX;
|
520
|
+
} else {
|
521
|
+
menuStyle.left = (x - menuPadding) + PX;
|
522
|
+
}
|
523
|
+
// if outside bottom, bottom align it
|
524
|
+
if (y + height + chart.exportMenuHeight > chartHeight) {
|
525
|
+
menuStyle.bottom = (chartHeight - y - menuPadding) + PX;
|
526
|
+
} else {
|
527
|
+
menuStyle.top = (y + height - menuPadding) + PX;
|
528
|
+
}
|
529
|
+
|
530
|
+
css(menu, menuStyle);
|
531
|
+
},
|
532
|
+
|
533
|
+
/**
|
534
|
+
* Add the export button to the chart
|
535
|
+
*/
|
536
|
+
addButton: function (options) {
|
537
|
+
var chart = this,
|
538
|
+
renderer = chart.renderer,
|
539
|
+
btnOptions = merge(chart.options.navigation.buttonOptions, options),
|
540
|
+
onclick = btnOptions.onclick,
|
541
|
+
menuItems = btnOptions.menuItems,
|
542
|
+
/*position = chart.getAlignment(btnOptions),
|
543
|
+
buttonLeft = position.x,
|
544
|
+
buttonTop = position.y,*/
|
545
|
+
buttonWidth = btnOptions.width,
|
546
|
+
buttonHeight = btnOptions.height,
|
547
|
+
box,
|
548
|
+
symbol,
|
549
|
+
button,
|
550
|
+
borderWidth = btnOptions.borderWidth,
|
551
|
+
boxAttr = {
|
552
|
+
stroke: btnOptions.borderColor
|
553
|
+
|
554
|
+
},
|
555
|
+
symbolAttr = {
|
556
|
+
stroke: btnOptions.symbolStroke,
|
557
|
+
fill: btnOptions.symbolFill
|
558
|
+
};
|
559
|
+
|
560
|
+
// Keeps references to the button elements
|
561
|
+
if (!chart.exportDivElements) {
|
562
|
+
chart.exportDivElements = [];
|
563
|
+
chart.exportSVGElements = [];
|
564
|
+
}
|
565
|
+
|
566
|
+
if (btnOptions.enabled === false) {
|
567
|
+
return;
|
568
|
+
}
|
569
|
+
|
570
|
+
// element to capture the click
|
571
|
+
function revert() {
|
572
|
+
symbol.attr(symbolAttr);
|
573
|
+
box.attr(boxAttr);
|
574
|
+
}
|
575
|
+
|
576
|
+
// the box border
|
577
|
+
box = renderer.rect(
|
578
|
+
0,
|
579
|
+
0,
|
580
|
+
buttonWidth,
|
581
|
+
buttonHeight,
|
582
|
+
btnOptions.borderRadius,
|
583
|
+
borderWidth
|
584
|
+
)
|
585
|
+
//.translate(buttonLeft, buttonTop) // to allow gradients
|
586
|
+
.align(btnOptions, true)
|
587
|
+
.attr(extend({
|
588
|
+
fill: btnOptions.backgroundColor,
|
589
|
+
'stroke-width': borderWidth,
|
590
|
+
zIndex: 19
|
591
|
+
}, boxAttr)).add();
|
592
|
+
|
593
|
+
// the invisible element to track the clicks
|
594
|
+
button = renderer.rect(
|
595
|
+
0,
|
596
|
+
0,
|
597
|
+
buttonWidth,
|
598
|
+
buttonHeight,
|
599
|
+
0
|
600
|
+
)
|
601
|
+
.align(btnOptions)
|
602
|
+
.attr({
|
603
|
+
id: btnOptions._id,
|
604
|
+
fill: 'rgba(255, 255, 255, 0.001)',
|
605
|
+
title: chart.options.lang[btnOptions._titleKey],
|
606
|
+
zIndex: 21
|
607
|
+
}).css({
|
608
|
+
cursor: 'pointer'
|
609
|
+
})
|
610
|
+
.on('mouseover', function () {
|
611
|
+
symbol.attr({
|
612
|
+
stroke: btnOptions.hoverSymbolStroke,
|
613
|
+
fill: btnOptions.hoverSymbolFill
|
614
|
+
});
|
615
|
+
box.attr({
|
616
|
+
stroke: btnOptions.hoverBorderColor
|
617
|
+
});
|
618
|
+
})
|
619
|
+
.on('mouseout', revert)
|
620
|
+
.on('click', revert)
|
621
|
+
.add();
|
622
|
+
|
623
|
+
//addEvent(button.element, 'click', revert);
|
624
|
+
|
625
|
+
// add the click event
|
626
|
+
if (menuItems) {
|
627
|
+
onclick = function () {
|
628
|
+
revert();
|
629
|
+
var bBox = button.getBBox();
|
630
|
+
chart.contextMenu('export-menu', menuItems, bBox.x, bBox.y, buttonWidth, buttonHeight);
|
631
|
+
};
|
632
|
+
}
|
633
|
+
/*addEvent(button.element, 'click', function() {
|
634
|
+
onclick.apply(chart, arguments);
|
635
|
+
});*/
|
636
|
+
button.on('click', function () {
|
637
|
+
onclick.apply(chart, arguments);
|
638
|
+
});
|
639
|
+
|
640
|
+
// the icon
|
641
|
+
symbol = renderer.symbol(
|
642
|
+
btnOptions.symbol,
|
643
|
+
btnOptions.symbolX,
|
644
|
+
btnOptions.symbolY,
|
645
|
+
(btnOptions.symbolSize || 12) / 2
|
646
|
+
)
|
647
|
+
.align(btnOptions, true)
|
648
|
+
.attr(extend(symbolAttr, {
|
649
|
+
'stroke-width': btnOptions.symbolStrokeWidth || 1,
|
650
|
+
zIndex: 20
|
651
|
+
})).add();
|
652
|
+
|
653
|
+
// Keep references to the renderer element so to be able to destroy them later.
|
654
|
+
chart.exportSVGElements.push(box, button, symbol);
|
655
|
+
},
|
656
|
+
|
657
|
+
/**
|
658
|
+
* Destroy the buttons.
|
659
|
+
*/
|
660
|
+
destroyExport: function () {
|
661
|
+
var i,
|
662
|
+
chart = this,
|
663
|
+
elem;
|
664
|
+
|
665
|
+
// Destroy the extra buttons added
|
666
|
+
for (i = 0; i < chart.exportSVGElements.length; i++) {
|
667
|
+
elem = chart.exportSVGElements[i];
|
668
|
+
// Destroy and null the svg/vml elements
|
669
|
+
elem.onclick = elem.ontouchstart = null;
|
670
|
+
chart.exportSVGElements[i] = elem.destroy();
|
671
|
+
}
|
672
|
+
|
673
|
+
// Destroy the divs for the menu
|
674
|
+
for (i = 0; i < chart.exportDivElements.length; i++) {
|
675
|
+
elem = chart.exportDivElements[i];
|
676
|
+
|
677
|
+
// Remove the event handler
|
678
|
+
removeEvent(elem, 'mouseleave');
|
679
|
+
|
680
|
+
// Remove inline events
|
681
|
+
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
|
682
|
+
|
683
|
+
// Destroy the div by moving to garbage bin
|
684
|
+
discardElement(elem);
|
685
|
+
}
|
686
|
+
}
|
687
|
+
});
|
688
|
+
|
689
|
+
// Create the export icon
|
690
|
+
HC.Renderer.prototype.symbols.exportIcon = function (x, y, radius) {
|
691
|
+
return [
|
692
|
+
M, // the disk
|
693
|
+
x - radius, y + radius,
|
694
|
+
L,
|
695
|
+
x + radius, y + radius,
|
696
|
+
x + radius, y + radius * 0.5,
|
697
|
+
x - radius, y + radius * 0.5,
|
698
|
+
'Z',
|
699
|
+
M, // the arrow
|
700
|
+
x, y + radius * 0.5,
|
701
|
+
L,
|
702
|
+
x - radius * 0.5, y - radius / 3,
|
703
|
+
x - radius / 6, y - radius / 3,
|
704
|
+
x - radius / 6, y - radius,
|
705
|
+
x + radius / 6, y - radius,
|
706
|
+
x + radius / 6, y - radius / 3,
|
707
|
+
x + radius * 0.5, y - radius / 3,
|
708
|
+
'Z'
|
709
|
+
];
|
710
|
+
};
|
711
|
+
// Create the print icon
|
712
|
+
HC.Renderer.prototype.symbols.printIcon = function (x, y, radius) {
|
713
|
+
return [
|
714
|
+
M, // the printer
|
715
|
+
x - radius, y + radius * 0.5,
|
716
|
+
L,
|
717
|
+
x + radius, y + radius * 0.5,
|
718
|
+
x + radius, y - radius / 3,
|
719
|
+
x - radius, y - radius / 3,
|
720
|
+
'Z',
|
721
|
+
M, // the upper sheet
|
722
|
+
x - radius * 0.5, y - radius / 3,
|
723
|
+
L,
|
724
|
+
x - radius * 0.5, y - radius,
|
725
|
+
x + radius * 0.5, y - radius,
|
726
|
+
x + radius * 0.5, y - radius / 3,
|
727
|
+
'Z',
|
728
|
+
M, // the lower sheet
|
729
|
+
x - radius * 0.5, y + radius * 0.5,
|
730
|
+
L,
|
731
|
+
x - radius * 0.75, y + radius,
|
732
|
+
x + radius * 0.75, y + radius,
|
733
|
+
x + radius * 0.5, y + radius * 0.5,
|
734
|
+
'Z'
|
735
|
+
];
|
736
|
+
};
|
737
|
+
|
738
|
+
|
739
|
+
// Add the buttons on chart load
|
740
|
+
Chart.prototype.callbacks.push(function (chart) {
|
741
|
+
var n,
|
742
|
+
exportingOptions = chart.options.exporting,
|
743
|
+
buttons = exportingOptions.buttons;
|
744
|
+
|
745
|
+
if (exportingOptions.enabled !== false) {
|
746
|
+
|
747
|
+
for (n in buttons) {
|
748
|
+
chart.addButton(buttons[n]);
|
749
|
+
}
|
750
|
+
|
751
|
+
// Destroy the export elements at chart destroy
|
752
|
+
addEvent(chart, 'destroy', chart.destroyExport);
|
753
|
+
}
|
754
|
+
|
755
|
+
});
|
756
|
+
|
757
|
+
|
758
|
+
}());
|