highcharts-rails 5.0.14 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.markdown +60 -0
  3. data/Rakefile +54 -5
  4. data/app/assets/images/highcharts/earth.svg +432 -0
  5. data/app/assets/javascripts/highcharts.js +5103 -3147
  6. data/app/assets/javascripts/highcharts/highcharts-3d.js +930 -277
  7. data/app/assets/javascripts/highcharts/highcharts-more.js +1374 -249
  8. data/app/assets/javascripts/highcharts/lib/canvg.js +3073 -0
  9. data/app/assets/javascripts/highcharts/lib/jspdf.js +16624 -0
  10. data/app/assets/javascripts/highcharts/lib/rgbcolor.js +299 -0
  11. data/app/assets/javascripts/highcharts/lib/svg2pdf.js +3488 -0
  12. data/app/assets/javascripts/highcharts/modules/accessibility.js +654 -212
  13. data/app/assets/javascripts/highcharts/modules/annotations.js +1552 -274
  14. data/app/assets/javascripts/highcharts/modules/boost-canvas.js +773 -0
  15. data/app/assets/javascripts/highcharts/modules/boost.js +636 -210
  16. data/app/assets/javascripts/highcharts/modules/broken-axis.js +2 -2
  17. data/app/assets/javascripts/highcharts/modules/bullet.js +364 -0
  18. data/app/assets/javascripts/highcharts/modules/data.js +766 -38
  19. data/app/assets/javascripts/highcharts/modules/drag-panes.js +588 -0
  20. data/app/assets/javascripts/highcharts/modules/drilldown.js +106 -36
  21. data/app/assets/javascripts/highcharts/modules/export-data.js +597 -0
  22. data/app/assets/javascripts/highcharts/modules/exporting.js +424 -162
  23. data/app/assets/javascripts/highcharts/modules/funnel.js +144 -22
  24. data/app/assets/javascripts/highcharts/modules/gantt.js +1154 -0
  25. data/app/assets/javascripts/highcharts/modules/grid-axis.js +1 -1
  26. data/app/assets/javascripts/highcharts/modules/heatmap.js +406 -80
  27. data/app/assets/javascripts/highcharts/modules/histogram-bellcurve.js +513 -0
  28. data/app/assets/javascripts/highcharts/modules/item-series.js +126 -0
  29. data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +31 -13
  30. data/app/assets/javascripts/highcharts/modules/offline-exporting.js +179 -57
  31. data/app/assets/javascripts/highcharts/modules/oldie.js +1378 -0
  32. data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +8 -6
  33. data/app/assets/javascripts/highcharts/modules/parallel-coordinates.js +494 -0
  34. data/app/assets/javascripts/highcharts/modules/pareto.js +275 -0
  35. data/app/assets/javascripts/highcharts/modules/sankey.js +641 -0
  36. data/app/assets/javascripts/highcharts/modules/series-label.js +355 -145
  37. data/app/assets/javascripts/highcharts/modules/solid-gauge.js +122 -1
  38. data/app/assets/javascripts/highcharts/modules/static-scale.js +64 -0
  39. data/app/assets/javascripts/highcharts/modules/stock.js +1944 -676
  40. data/app/assets/javascripts/highcharts/modules/streamgraph.js +139 -0
  41. data/app/assets/javascripts/highcharts/modules/sunburst.js +2403 -0
  42. data/app/assets/javascripts/highcharts/modules/tilemap.js +1199 -0
  43. data/app/assets/javascripts/highcharts/modules/treemap.js +538 -134
  44. data/app/assets/javascripts/highcharts/modules/variable-pie.js +490 -0
  45. data/app/assets/javascripts/highcharts/modules/variwide.js +283 -0
  46. data/app/assets/javascripts/highcharts/modules/vector.js +294 -0
  47. data/app/assets/javascripts/highcharts/modules/windbarb.js +490 -0
  48. data/app/assets/javascripts/highcharts/modules/wordcloud.js +681 -0
  49. data/app/assets/javascripts/highcharts/modules/xrange.js +615 -0
  50. data/app/assets/javascripts/highcharts/themes/avocado.js +54 -0
  51. data/app/assets/javascripts/highcharts/themes/dark-blue.js +6 -6
  52. data/app/assets/javascripts/highcharts/themes/dark-green.js +6 -6
  53. data/app/assets/javascripts/highcharts/themes/dark-unica.js +6 -6
  54. data/app/assets/javascripts/highcharts/themes/gray.js +14 -10
  55. data/app/assets/javascripts/highcharts/themes/grid-light.js +6 -6
  56. data/app/assets/javascripts/highcharts/themes/grid.js +7 -5
  57. data/app/assets/javascripts/highcharts/themes/sand-signika.js +8 -7
  58. data/app/assets/javascripts/highcharts/themes/skies.js +15 -9
  59. data/app/assets/javascripts/highcharts/themes/sunset.js +53 -0
  60. data/app/assets/stylesheets/highcharts/highcharts.css +802 -0
  61. data/app/assets/stylesheets/highcharts/highcharts.scss +665 -0
  62. data/lib/highcharts/version.rb +1 -1
  63. metadata +31 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v5.0.14 (2017-07-28)
2
+ * @license Highcharts JS v6.0.0 (2017-10-04)
3
3
  * Exporting module
4
4
  *
5
5
  * (c) 2010-2017 Torstein Honsi
@@ -49,36 +49,213 @@
49
49
  isFirefoxBrowser = /firefox/i.test(userAgent);
50
50
 
51
51
  // Add language
52
- /**
53
- * @apioption lang
54
- */
55
52
  extend(defaultOptions.lang, {
53
+ /**
54
+ * Exporting module only. The text for the menu item to print the chart.
55
+ *
56
+ * @type {String}
57
+ * @default Print chart
58
+ * @since 3.0.1
59
+ * @apioption lang.printChart
60
+ */
56
61
  printChart: 'Print chart',
62
+ /**
63
+ * Exporting module only. The text for the PNG download menu item.
64
+ *
65
+ * @type {String}
66
+ * @default Download PNG image
67
+ * @since 2.0
68
+ * @apioption lang.downloadPNG
69
+ */
57
70
  downloadPNG: 'Download PNG image',
71
+ /**
72
+ * Exporting module only. The text for the JPEG download menu item.
73
+ *
74
+ * @type {String}
75
+ * @default Download JPEG image
76
+ * @since 2.0
77
+ * @apioption lang.downloadJPEG
78
+ */
58
79
  downloadJPEG: 'Download JPEG image',
80
+ /**
81
+ * Exporting module only. The text for the PDF download menu item.
82
+ *
83
+ * @type {String}
84
+ * @default Download PDF document
85
+ * @since 2.0
86
+ * @apioption lang.downloadPDF
87
+ */
59
88
  downloadPDF: 'Download PDF document',
89
+ /**
90
+ * Exporting module only. The text for the SVG download menu item.
91
+ *
92
+ * @type {String}
93
+ * @default Download SVG vector image
94
+ * @since 2.0
95
+ * @apioption lang.downloadSVG
96
+ */
60
97
  downloadSVG: 'Download SVG vector image',
98
+ /**
99
+ * Exporting module menu. The tooltip title for the context menu holding
100
+ * print and export menu items.
101
+ *
102
+ * @type {String}
103
+ * @default Chart context menu
104
+ * @since 3.0
105
+ * @apioption lang.contextButtonTitle
106
+ */
61
107
  contextButtonTitle: 'Chart context menu'
62
108
  });
63
109
 
64
110
  // Buttons and menus are collected in a separate config option set called 'navigation'.
65
111
  // This can be extended later to add control buttons like zoom and pan right click menus.
66
-
67
- /**
68
- * @apioption navigation
69
- */
70
112
  defaultOptions.navigation = {
71
113
  buttonOptions: {
72
114
  theme: {},
115
+
116
+ /**
117
+ * Whether to enable buttons.
118
+ *
119
+ * @type {Boolean}
120
+ * @sample {highcharts} highcharts/navigation/buttonoptions-enabled/ Exporting module loaded but buttons disabled
121
+ * @sample {highstock} highcharts/navigation/buttonoptions-enabled/ Exporting module loaded but buttons disabled
122
+ * @sample {highmaps} highcharts/navigation/buttonoptions-enabled/ Exporting module loaded but buttons disabled
123
+ * @default true
124
+ * @since 2.0
125
+ * @apioption navigation.buttonOptions.enabled
126
+ */
127
+
128
+ /**
129
+ * The pixel size of the symbol on the button.
130
+ *
131
+ * @type {Number}
132
+ * @sample {highcharts} highcharts/navigation/buttonoptions-height/ Bigger buttons
133
+ * @sample {highstock} highcharts/navigation/buttonoptions-height/ Bigger buttons
134
+ * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
135
+ * @default 14
136
+ * @since 2.0
137
+ * @apioption navigation.buttonOptions.symbolSize
138
+ */
73
139
  symbolSize: 14,
140
+
141
+ /**
142
+ * The x position of the center of the symbol inside the button.
143
+ *
144
+ * @type {Number}
145
+ * @sample {highcharts} highcharts/navigation/buttonoptions-height/ Bigger buttons
146
+ * @sample {highstock} highcharts/navigation/buttonoptions-height/ Bigger buttons
147
+ * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
148
+ * @default 12.5
149
+ * @since 2.0
150
+ * @apioption navigation.buttonOptions.symbolX
151
+ */
74
152
  symbolX: 12.5,
153
+
154
+ /**
155
+ * The y position of the center of the symbol inside the button.
156
+ *
157
+ * @type {Number}
158
+ * @sample {highcharts} highcharts/navigation/buttonoptions-height/ Bigger buttons
159
+ * @sample {highstock} highcharts/navigation/buttonoptions-height/ Bigger buttons
160
+ * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
161
+ * @default 10.5
162
+ * @since 2.0
163
+ * @apioption navigation.buttonOptions.symbolY
164
+ */
75
165
  symbolY: 10.5,
166
+
167
+ /**
168
+ * Alignment for the buttons.
169
+ *
170
+ * @validvalue ["left", "center", "right"]
171
+ * @type {String}
172
+ * @sample {highcharts} highcharts/navigation/buttonoptions-align/ Center aligned
173
+ * @sample {highstock} highcharts/navigation/buttonoptions-align/ Center aligned
174
+ * @sample {highmaps} highcharts/navigation/buttonoptions-align/ Center aligned
175
+ * @default right
176
+ * @since 2.0
177
+ * @apioption navigation.buttonOptions.align
178
+ */
76
179
  align: 'right',
180
+
181
+ /**
182
+ * The pixel spacing between buttons.
183
+ *
184
+ * @type {Number}
185
+ * @default 3
186
+ * @since 2.0
187
+ * @apioption navigation.buttonOptions.buttonSpacing
188
+ */
77
189
  buttonSpacing: 3,
190
+
191
+ /**
192
+ * Pixel height of the buttons.
193
+ *
194
+ * @type {Number}
195
+ * @sample {highcharts} highcharts/navigation/buttonoptions-height/ Bigger buttons
196
+ * @sample {highstock} highcharts/navigation/buttonoptions-height/ Bigger buttons
197
+ * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
198
+ * @default 22
199
+ * @since 2.0
200
+ * @apioption navigation.buttonOptions.height
201
+ */
78
202
  height: 22,
79
- // text: null,
203
+
204
+ /**
205
+ * A text string to add to the individual button.
206
+ *
207
+ * @type {String}
208
+ * @sample {highcharts} highcharts/exporting/buttons-text/ Full text button
209
+ * @sample {highcharts} highcharts/exporting/buttons-text-symbol/ Combined symbol and text
210
+ * @sample {highstock} highcharts/exporting/buttons-text/ Full text button
211
+ * @sample {highstock} highcharts/exporting/buttons-text-symbol/ Combined symbol and text
212
+ * @sample {highmaps} highcharts/exporting/buttons-text/ Full text button
213
+ * @sample {highmaps} highcharts/exporting/buttons-text-symbol/ Combined symbol and text
214
+ * @default null
215
+ * @since 3.0
216
+ * @apioption navigation.buttonOptions.text
217
+ */
218
+
219
+ /**
220
+ * The vertical alignment of the buttons. Can be one of "top", "middle"
221
+ * or "bottom".
222
+ *
223
+ * @validvalue ["top", "middle", "bottom"]
224
+ * @type {String}
225
+ * @sample {highcharts} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
226
+ * @sample {highstock} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
227
+ * @sample {highmaps} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
228
+ * @default top
229
+ * @since 2.0
230
+ * @apioption navigation.buttonOptions.verticalAlign
231
+ */
80
232
  verticalAlign: 'top',
233
+
234
+ /**
235
+ * The pixel width of the button.
236
+ *
237
+ * @type {Number}
238
+ * @sample {highcharts} highcharts/navigation/buttonoptions-height/ Bigger buttons
239
+ * @sample {highstock} highcharts/navigation/buttonoptions-height/ Bigger buttons
240
+ * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
241
+ * @default 24
242
+ * @since 2.0
243
+ * @apioption navigation.buttonOptions.width
244
+ */
81
245
  width: 24
246
+
247
+ /**
248
+ * The vertical offset of the button's position relative to its
249
+ * `verticalAlign`.
250
+ *
251
+ * @type {Number}
252
+ * @sample {highcharts} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
253
+ * @sample {highstock} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
254
+ * @sample {highmaps} highcharts/navigation/buttonoptions-verticalalign/ Buttons at lower right
255
+ * @default 0
256
+ * @since 2.0
257
+ * @apioption navigation.buttonOptions.y
258
+ */
82
259
  }
83
260
  };
84
261
 
@@ -98,28 +275,17 @@
98
275
  * icon is clicked. This menu is rendered in HTML.
99
276
  *
100
277
  * @type {CSSObject}
101
- * @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
102
- * style/style-by-css), the menu is styled with the `.highcharts-menu`
278
+ * @see In styled mode, the menu is styled with the `.highcharts-menu`
103
279
  * class.
104
280
  * @sample {highcharts} highcharts/navigation/menustyle/ Light gray menu background
105
281
  * @sample {highstock} highcharts/navigation/menustyle/ Light gray menu background
106
282
  * @sample {highmaps} highcharts/navigation/menustyle/ Light gray menu background
107
283
  * @default { "border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0" }
108
284
  * @since 2.0
109
- * @product highcharts highstock highmaps
110
285
  */
111
286
  menuStyle: {
112
-
113
- /**
114
- */
115
287
  border: '1px solid #999999',
116
-
117
- /**
118
- */
119
288
  background: '#ffffff',
120
-
121
- /**
122
- */
123
289
  padding: '5px 0'
124
290
  },
125
291
 
@@ -129,36 +295,22 @@
129
295
  * in HTML.
130
296
  *
131
297
  * @type {CSSObject}
132
- * @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
133
- * style/style-by-css), the menu items are styled with the `.highcharts-
134
- * menu-item` class.
298
+ * @see In styled mode, the menu items are styled with the `.highcharts-menu-item` class.
135
299
  * @sample {highcharts} highcharts/navigation/menuitemstyle/ Add a grey stripe to the left
136
300
  * @sample {highstock} highcharts/navigation/menuitemstyle/ Add a grey stripe to the left
137
301
  * @sample {highmaps} highcharts/navigation/menuitemstyle/ Add a grey stripe to the left
138
302
  * @default { "padding": "0.5em 1em", "color": "#333333", "background": "none" }
139
303
  * @since 2.0
140
- * @product highcharts highstock highmaps
141
304
  */
142
305
  menuItemStyle: {
143
-
144
- /**
145
- */
146
306
  padding: '0.5em 1em',
147
-
148
- /**
149
- */
150
307
  background: 'none',
151
-
152
- /**
153
- */
154
308
  color: '#333333',
155
-
156
309
  /**
310
+ * Defaults to `14px` on touch devices and `11px` on desktop.
311
+ * @type {String}
157
312
  */
158
313
  fontSize: isTouchDevice ? '14px' : '11px',
159
-
160
- /**
161
- */
162
314
  transition: 'background 250ms, color 250ms'
163
315
  },
164
316
 
@@ -168,24 +320,15 @@
168
320
  * The menu items are rendered in HTML.
169
321
  *
170
322
  * @type {CSSObject}
171
- * @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
172
- * style/style-by-css), the menu items are styled with the `.highcharts-
173
- * menu-item` class.
323
+ * @see In styled mode, the menu items are styled with the `.highcharts-menu-item` class.
174
324
  * @sample {highcharts} highcharts/navigation/menuitemhoverstyle/ Bold text on hover
175
325
  * @sample {highstock} highcharts/navigation/menuitemhoverstyle/ Bold text on hover
176
326
  * @sample {highmaps} highcharts/navigation/menuitemhoverstyle/ Bold text on hover
177
327
  * @default { "background": "#335cad", "color": "#ffffff" }
178
328
  * @since 2.0
179
- * @product highcharts highstock highmaps
180
329
  */
181
330
  menuItemHoverStyle: {
182
-
183
- /**
184
- */
185
331
  background: '#335cad',
186
-
187
- /**
188
- */
189
332
  color: '#ffffff'
190
333
  },
191
334
 
@@ -193,11 +336,8 @@
193
336
  * A collection of options for buttons appearing in the exporting module.
194
337
  *
195
338
  *
196
- * In [styled mode](http://www.highcharts.com/docs/chart-design-and-
197
- * style/style-by-css), the buttons are styled with the `.highcharts-
198
- * contextbutton` and `.highcharts-button-symbol` class.
199
- *
200
- * @product highcharts highstock highmaps
339
+ * In styled mode, the buttons are styled with the `.highcharts-contextbutton` and `.highcharts-button-symbol` class.
340
+ *
201
341
  */
202
342
  buttonOptions: {
203
343
 
@@ -210,7 +350,6 @@
210
350
  * @sample {highmaps} highcharts/navigation/buttonoptions-symbolfill/ Blue symbol stroke for one of the buttons
211
351
  * @default #666666
212
352
  * @since 2.0
213
- * @product highcharts highstock highmaps
214
353
  */
215
354
  symbolFill: '#666666',
216
355
 
@@ -223,7 +362,6 @@
223
362
  * @sample {highmaps} highcharts/navigation/buttonoptions-symbolstroke/ Blue symbol stroke
224
363
  * @default #666666
225
364
  * @since 2.0
226
- * @product highcharts highstock highmaps
227
365
  */
228
366
  symbolStroke: '#666666',
229
367
 
@@ -236,7 +374,6 @@
236
374
  * @sample {highmaps} highcharts/navigation/buttonoptions-height/ Bigger buttons
237
375
  * @default 1
238
376
  * @since 2.0
239
- * @product highcharts highstock highmaps
240
377
  */
241
378
  symbolStrokeWidth: 3,
242
379
 
@@ -251,19 +388,20 @@
251
388
  * @sample {highstock} highcharts/navigation/buttonoptions-theme/ Theming the buttons
252
389
  * @sample {highmaps} highcharts/navigation/buttonoptions-theme/ Theming the buttons
253
390
  * @since 3.0
254
- * @product highcharts highstock highmaps
255
391
  */
256
392
  theme: {
257
-
258
393
  /**
394
+ * The default fill exists only to capture hover events.
395
+ * @type {String}
259
396
  */
260
- fill: '#ffffff', // capture hover
261
-
397
+ fill: '#ffffff',
262
398
  /**
399
+ * @type {String}
263
400
  */
264
401
  stroke: 'none',
265
-
266
402
  /**
403
+ * @type {Number}
404
+ * @default 5
267
405
  */
268
406
  padding: 5
269
407
  }
@@ -280,8 +418,148 @@
280
418
  * @optionparent exporting
281
419
  */
282
420
  defaultOptions.exporting = {
283
- //enabled: true,
284
- //filename: 'chart',
421
+
422
+ /**
423
+ * Experimental setting to allow HTML inside the chart (added through
424
+ * the `useHTML` options), directly in the exported image. This allows
425
+ * you to preserve complicated HTML structures like tables or bi-directional
426
+ * text in exported charts.
427
+ *
428
+ * Disclaimer: The HTML is rendered in a `foreignObject` tag in the
429
+ * generated SVG. The official export server is based on PhantomJS,
430
+ * which supports this, but other SVG clients, like Batik, does not
431
+ * support it. This also applies to downloaded SVG that you want to
432
+ * open in a desktop client.
433
+ *
434
+ * @type {Boolean}
435
+ * @default false
436
+ * @since 4.1.8
437
+ * @apioption exporting.allowHTML
438
+ */
439
+
440
+ /**
441
+ * Additional chart options to be merged into an exported chart. For
442
+ * example, a common use case is to add data labels to improve readability
443
+ * of the exported chart, or to add a printer-friendly color scheme.
444
+ *
445
+ * @type {Object}
446
+ * @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
447
+ * Added data labels
448
+ * @sample {highstock} highcharts/exporting/chartoptions-data-labels/
449
+ * Added data labels
450
+ * @default null
451
+ * @apioption exporting.chartOptions
452
+ */
453
+
454
+ /**
455
+ * Whether to enable the exporting module. Disabling the module will
456
+ * hide the context button, but API methods will still be available.
457
+ *
458
+ * @type {Boolean}
459
+ * @sample {highcharts} highcharts/exporting/enabled-false/
460
+ * Exporting module is loaded but disabled
461
+ * @sample {highstock} highcharts/exporting/enabled-false/
462
+ * Exporting module is loaded but disabled
463
+ * @default true
464
+ * @since 2.0
465
+ * @apioption exporting.enabled
466
+ */
467
+
468
+ /**
469
+ * Function to call if the offline-exporting module fails to export
470
+ * a chart on the client side, and [fallbackToExportServer](#exporting.
471
+ * fallbackToExportServer) is disabled. If left undefined, an exception
472
+ * is thrown instead.
473
+ *
474
+ * @type {Function}
475
+ * @see [fallbackToExportServer](#exporting.fallbackToExportServer)
476
+ * @default undefined
477
+ * @since 5.0.0
478
+ * @apioption exporting.error
479
+ */
480
+
481
+ /**
482
+ * Whether or not to fall back to the export server if the offline-exporting
483
+ * module is unable to export the chart on the client side.
484
+ *
485
+ * @type {Boolean}
486
+ * @default true
487
+ * @since 4.1.8
488
+ * @apioption exporting.fallbackToExportServer
489
+ */
490
+
491
+ /**
492
+ * The filename, without extension, to use for the exported chart.
493
+ *
494
+ * @type {String}
495
+ * @sample {highcharts} highcharts/exporting/filename/ Custom file name
496
+ * @sample {highstock} highcharts/exporting/filename/ Custom file name
497
+ * @default chart
498
+ * @since 2.0
499
+ * @apioption exporting.filename
500
+ */
501
+
502
+ /**
503
+ * An object containing additional attributes for the POST form that
504
+ * sends the SVG to the export server. For example, a `target` can be
505
+ * set to make sure the generated image is received in another frame,
506
+ * or a custom `enctype` or `encoding` can be set.
507
+ *
508
+ * @type {Object}
509
+ * @since 3.0.8
510
+ * @apioption exporting.formAttributes
511
+ */
512
+
513
+ /**
514
+ * Path where Highcharts will look for export module dependencies to
515
+ * load on demand if they don't already exist on `window`. Should currently
516
+ * point to location of [CanVG](https://github.com/canvg/canvg) library,
517
+ * [RGBColor.js](https://github.com/canvg/canvg), [jsPDF](https://github.
518
+ * com/yWorks/jsPDF) and [svg2pdf.js](https://github.com/yWorks/svg2pdf.
519
+ * js), required for client side export in certain browsers.
520
+ *
521
+ * @type {String}
522
+ * @default https://code.highcharts.com/{version}/lib
523
+ * @since 5.0.0
524
+ * @apioption exporting.libURL
525
+ */
526
+
527
+ /**
528
+ * Analogous to [sourceWidth](#exporting.sourceWidth).
529
+ *
530
+ * @type {Number}
531
+ * @since 3.0
532
+ * @apioption exporting.sourceHeight
533
+ */
534
+
535
+ /**
536
+ * The width of the original chart when exported, unless an explicit
537
+ * [chart.width](#chart.width) is set. The width exported raster image
538
+ * is then multiplied by [scale](#exporting.scale).
539
+ *
540
+ * @type {Number}
541
+ * @sample {highcharts} highcharts/exporting/sourcewidth/ Source size demo
542
+ * @sample {highstock} highcharts/exporting/sourcewidth/ Source size demo
543
+ * @sample {highmaps} maps/exporting/sourcewidth/ Source size demo
544
+ * @since 3.0
545
+ * @apioption exporting.sourceWidth
546
+ */
547
+
548
+ /**
549
+ * The pixel width of charts exported to PNG or JPG. As of Highcharts
550
+ * 3.0, the default pixel width is a function of the [chart.width](#chart.
551
+ * width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
552
+ * [exporting.scale](#exporting.scale).
553
+ *
554
+ * @type {Number}
555
+ * @sample {highcharts} highcharts/exporting/width/
556
+ * Export to 200px wide images
557
+ * @sample {highstock} highcharts/exporting/width/
558
+ * Export to 200px wide images
559
+ * @default undefined
560
+ * @since 2.0
561
+ * @apioption exporting.width
562
+ */
285
563
 
286
564
  /**
287
565
  * Default MIME type for exporting if `chart.exportChart()` is called
@@ -289,10 +567,7 @@
289
567
  * `image/jpeg`, `application/pdf` and `image/svg+xml`.
290
568
  *
291
569
  * @validvalue ["image/png", "image/jpeg", "application/pdf", "image/svg+xml"]
292
- * @type {String}
293
- * @default image/png
294
570
  * @since 2.0
295
- * @product highcharts highstock highmaps
296
571
  */
297
572
  type: 'image/png',
298
573
 
@@ -303,11 +578,8 @@
303
578
  * @type {String}
304
579
  * @default https://export.highcharts.com
305
580
  * @since 2.0
306
- * @product highcharts highstock highmaps
307
581
  */
308
582
  url: 'https://export.highcharts.com/',
309
- //width: undefined,
310
-
311
583
  /**
312
584
  * When printing the chart from the menu item in the burger menu, if
313
585
  * the on-screen chart exceeds this width, it is resized. After printing
@@ -318,7 +590,6 @@
318
590
  * @type {Number}
319
591
  * @default 780
320
592
  * @since 4.2.5
321
- * @product highcharts highstock highmaps
322
593
  */
323
594
  printMaxWidth: 780,
324
595
 
@@ -328,15 +599,12 @@
328
599
  * may look good on a website, it will look bad in print. The default
329
600
  * scale of 2 makes this chart export to a 1200px PNG or JPG.
330
601
  *
331
- * @type {Number}
332
602
  * @see [chart.width](#chart.width), [exporting.sourceWidth](#exporting.
333
603
  * sourceWidth)
334
604
  * @sample {highcharts} highcharts/exporting/scale/ Scale demonstrated
335
605
  * @sample {highstock} highcharts/exporting/scale/ Scale demonstrated
336
606
  * @sample {highmaps} maps/exporting/scale/ Scale demonstrated
337
- * @default 2
338
607
  * @since 3.0
339
- * @product highcharts highstock highmaps
340
608
  */
341
609
  scale: 2,
342
610
 
@@ -345,31 +613,62 @@
345
613
  * to the default buttons listed here, custom buttons can be added.
346
614
  * See [navigation.buttonOptions](#navigation.buttonOptions) for general
347
615
  * options.
348
- *
349
- * @product highcharts highstock highmaps
616
+ *
350
617
  */
351
618
  buttons: {
352
619
 
353
620
  /**
354
621
  * Options for the export button.
355
622
  *
356
- * In [styled mode](http://www.highcharts.com/docs/chart-design-and-
357
- * style/style-by-css), export button styles can be applied with the
623
+ * In styled mode, export button styles can be applied with the
358
624
  * `.highcharts-contextbutton` class.
359
625
  *
360
626
  * @extends navigation.buttonOptions
361
- * @product highcharts highstock highmaps
362
627
  */
363
628
  contextButton: {
364
629
 
365
630
  /**
631
+ * A click handler callback to use on the button directly instead of
632
+ * the popup menu.
633
+ *
634
+ * @type {Function}
635
+ * @sample {highcharts} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
636
+ * @sample {highstock} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
637
+ * @sample {highmaps} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
638
+ * @since 2.0
639
+ * @apioption exporting.buttons.contextButton.onclick
640
+ */
641
+
642
+ /**
643
+ * See [navigation.buttonOptions.symbolFill](#navigation.buttonOptions.symbolFill).
644
+ *
645
+ * @type {Color}
646
+ * @default #666666
647
+ * @since 2.0
648
+ * @apioption exporting.buttons.contextButton.symbolFill
649
+ */
650
+
651
+ /**
652
+ * The horizontal position of the button relative to the `align`
653
+ * option.
654
+ *
655
+ * @type {Number}
656
+ * @default -10
657
+ * @since 2.0
658
+ * @apioption exporting.buttons.contextButton.x
659
+ */
660
+
661
+ /**
662
+ * The class name of the context button.
663
+ * @type {String}
366
664
  */
367
665
  className: 'highcharts-contextbutton',
368
666
 
369
667
  /**
668
+ * The class name of the menu appearing from the button.
669
+ * @type {String}
370
670
  */
371
671
  menuClassName: 'highcharts-contextmenu',
372
- //x: -10,
373
672
 
374
673
  /**
375
674
  * The symbol for the button. Points to a definition function in
@@ -383,34 +682,46 @@
383
682
  * @sample {highmaps} highcharts/exporting/buttons-contextbutton-symbol/ Use a circle for symbol
384
683
  * @default menu
385
684
  * @since 2.0
386
- * @product highcharts highstock highmaps
387
685
  */
388
686
  symbol: 'menu',
389
687
 
390
688
  /**
689
+ * The key to a [lang](#lang) option setting that is used for the
690
+ * button`s title tooltip. When the key is `contextButtonTitle`, it
691
+ * refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
692
+ * that defaults to "Chart context menu".
693
+ * @type {String}
391
694
  */
392
695
  _titleKey: 'contextButtonTitle',
393
696
 
394
697
  /**
395
- * A collection of config options for the menu items. Each options
396
- * object consists of a `text` option which is a string to show in
397
- * the menu item, as well as an `onclick` parameter which is a callback
398
- * function to run on click.
698
+ * A collection of strings pointing to config options for the menu
699
+ * items. The config options are defined in the
700
+ * `menuItemDefinitions` option.
399
701
  *
400
702
  * By default, there is the "Print" menu item plus one menu item
401
- * for each of the available export types. Menu items can be customized
402
- * by defining a new array of items and assigning `null` to unwanted
403
- * positions (see override example below).
703
+ * for each of the available export types.
704
+ *
705
+ * Defaults to
706
+ * <pre>
707
+ * [
708
+ * 'printChart',
709
+ * 'separator',
710
+ * 'downloadPNG',
711
+ * 'downloadJPEG',
712
+ * 'downloadPDF',
713
+ * 'downloadSVG'
714
+ * ]
715
+ * </pre>
404
716
  *
405
- * @type {Array<Object>}
406
- * @sample {highcharts} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
407
- * @sample {highcharts} highcharts/exporting/buttons-contextbutton-menuitems/ Override the menu items
408
- * @sample {highstock} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
409
- * @sample {highstock} highcharts/exporting/buttons-contextbutton-menuitems/ Override the menu items
410
- * @sample {highmaps} highcharts/exporting/buttons-contextbutton-onclick/ Skip the menu and export the chart directly
411
- * @sample {highmaps} highcharts/exporting/buttons-contextbutton-menuitems/ Override the menu items
717
+ * @type {Array<String>|Array<Object>}
718
+ * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
719
+ * Menu item definitions
720
+ * @sample {highstock} highcharts/exporting/menuitemdefinitions/
721
+ * Menu item definitions
722
+ * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
723
+ * Menu item definitions
412
724
  * @since 2.0
413
- * @product highcharts highstock highmaps
414
725
  */
415
726
  menuItems: [
416
727
  'printChart',
@@ -422,9 +733,6 @@
422
733
  ]
423
734
  }
424
735
  },
425
- // docs. Created API item with since:next. Add information and link to sample
426
- // from menuItems too.
427
-
428
736
  /**
429
737
  * An object consisting of definitions for the menu items in the context
430
738
  * menu. Each key value pair has a `key` that is referenced in the
@@ -448,63 +756,48 @@
448
756
  * </dl>
449
757
  *
450
758
  * @type {Object}
451
- * @sample {highcharts} highcharts/exporting/menuitemdefinitions/ Menu item definitions
452
- * @sample {highstock} highcharts/exporting/menuitemdefinitions/ Menu item definitions
453
- * @sample {highmaps} highcharts/exporting/menuitemdefinitions/ Menu item definitions
454
- * @since next
455
- * @product highcharts highstock highmaps
759
+ * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
760
+ * Menu item definitions
761
+ * @sample {highstock} highcharts/exporting/menuitemdefinitions/
762
+ * Menu item definitions
763
+ * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
764
+ * Menu item definitions
765
+ * @since 5.0.13
456
766
  */
457
767
  menuItemDefinitions: {
458
768
 
459
769
  /**
770
+ * @ignore
460
771
  */
461
772
  printChart: {
462
-
463
- /**
464
- */
465
773
  textKey: 'printChart',
466
-
467
- /**
468
- */
469
774
  onclick: function() {
470
775
  this.print();
471
776
  }
472
777
  },
473
778
 
474
779
  /**
780
+ * @ignore
475
781
  */
476
782
  separator: {
477
-
478
- /**
479
- */
480
783
  separator: true
481
784
  },
482
785
 
483
786
  /**
787
+ * @ignore
484
788
  */
485
789
  downloadPNG: {
486
-
487
- /**
488
- */
489
790
  textKey: 'downloadPNG',
490
-
491
- /**
492
- */
493
791
  onclick: function() {
494
792
  this.exportChart();
495
793
  }
496
794
  },
497
795
 
498
796
  /**
797
+ * @ignore
499
798
  */
500
799
  downloadJPEG: {
501
-
502
- /**
503
- */
504
800
  textKey: 'downloadJPEG',
505
-
506
- /**
507
- */
508
801
  onclick: function() {
509
802
  this.exportChart({
510
803
  type: 'image/jpeg'
@@ -513,15 +806,10 @@
513
806
  },
514
807
 
515
808
  /**
809
+ * @ignore
516
810
  */
517
811
  downloadPDF: {
518
-
519
- /**
520
- */
521
812
  textKey: 'downloadPDF',
522
-
523
- /**
524
- */
525
813
  onclick: function() {
526
814
  this.exportChart({
527
815
  type: 'application/pdf'
@@ -530,15 +818,10 @@
530
818
  },
531
819
 
532
820
  /**
821
+ * @ignore
533
822
  */
534
823
  downloadSVG: {
535
-
536
- /**
537
- */
538
824
  textKey: 'downloadSVG',
539
-
540
- /**
541
- */
542
825
  onclick: function() {
543
826
  this.exportChart({
544
827
  type: 'image/svg+xml'
@@ -647,30 +930,16 @@
647
930
  .replace(/<\/svg>.*?$/, '</svg>')
648
931
  // Batik doesn't support rgba fills and strokes (#3095)
649
932
  .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
650
- /* This fails in IE < 8
651
- .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
652
- return s2 +'.'+ s3[0];
653
- })*/
654
933
 
655
934
  // Replace HTML entities, issue #347
656
935
  .replace(/&nbsp;/g, '\u00A0') // no-break space
657
936
  .replace(/&shy;/g, '\u00AD'); // soft hyphen
658
937
 
659
938
 
660
- // IE specific
661
- svg = svg
662
- .replace(/<IMG /g, '<image ')
663
- .replace(/<(\/?)TITLE>/g, '<$1title>')
664
- .replace(/height=([^" ]+)/g, 'height="$1"')
665
- .replace(/width=([^" ]+)/g, 'width="$1"')
666
- .replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
667
- .replace(/ id=([^" >]+)/g, ' id="$1"') // #4003
668
- .replace(/class=([^" >]+)/g, 'class="$1"')
669
- .replace(/ transform /g, ' ')
670
- .replace(/:(path|rect)/g, '$1')
671
- .replace(/style="([^"]+)"/g, function(s) {
672
- return s.toLowerCase();
673
- });
939
+ // Further sanitize for oldIE
940
+ if (this.ieSanitizeSVG) {
941
+ svg = this.ieSanitizeSVG(svg);
942
+ }
674
943
 
675
944
 
676
945
  return svg;
@@ -716,13 +985,6 @@
716
985
  options = merge(chart.options, chartOptions); // copy the options and add extra options
717
986
 
718
987
 
719
- // IE compatibility hack for generating SVG content that it doesn't really understand
720
- if (!doc.createElementNS) {
721
- doc.createElementNS = function(ns, tagName) {
722
- return doc.createElement(tagName);
723
- };
724
- }
725
-
726
988
  // create a sandbox where a new chart will be generated
727
989
  sandbox = createElement('div', null, {
728
990
  position: 'absolute',
@@ -1248,7 +1510,7 @@
1248
1510
  if (exportSVGElements) {
1249
1511
  each(exportSVGElements, function(elem, i) {
1250
1512
 
1251
- // Destroy and null the svg/vml elements
1513
+ // Destroy and null the svg elements
1252
1514
  if (elem) { // #1822
1253
1515
  elem.onclick = elem.ontouchstart = null;
1254
1516
  cacheName = 'cache-' + elem.menuClassName;