highcharts 9.1.1 → 9.2.2

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 (718) hide show
  1. package/bower.json +1 -1
  2. package/css/annotations/popup.css +29 -28
  3. package/css/annotations/popup.scss +29 -27
  4. package/css/highcharts.css +15 -0
  5. package/css/highcharts.scss +12 -0
  6. package/css/stocktools/gui.css +1 -0
  7. package/css/stocktools/gui.scss +1 -0
  8. package/css/themes/dark-unica.css +15 -0
  9. package/css/themes/grid-light.css +15 -0
  10. package/css/themes/sand-signika.css +15 -0
  11. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +8 -2
  12. package/es-modules/Accessibility/Components/LegendComponent.js +19 -8
  13. package/es-modules/Accessibility/Components/MenuComponent.js +19 -13
  14. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +4 -8
  15. package/es-modules/Accessibility/FocusBorder.js +1 -3
  16. package/es-modules/Accessibility/Options/LangOptions.js +3 -3
  17. package/es-modules/Accessibility/Utils/Announcer.js +22 -5
  18. package/es-modules/Accessibility/Utils/ChartUtilities.js +6 -1
  19. package/es-modules/Core/Animation/AnimationUtilities.js +12 -4
  20. package/es-modules/Core/Animation/Fx.js +15 -12
  21. package/es-modules/Core/Axis/Axis.js +25 -13
  22. package/es-modules/Core/Axis/AxisDefaults.js +0 -1
  23. package/es-modules/Core/Axis/BrokenAxis.js +32 -15
  24. package/es-modules/Core/Axis/Color/ColorAxis.js +665 -0
  25. package/es-modules/Core/Axis/Color/ColorAxisComposition.js +237 -0
  26. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +434 -0
  27. package/es-modules/Core/Axis/DateTimeAxis.js +163 -133
  28. package/es-modules/Core/Axis/GridAxis.js +8 -3
  29. package/es-modules/Core/Axis/LogarithmicAxis.js +159 -117
  30. package/es-modules/Core/Axis/OrdinalAxis.js +666 -460
  31. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +874 -0
  32. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +292 -0
  33. package/es-modules/Core/Axis/RadialAxis.js +858 -745
  34. package/es-modules/Core/Axis/ScrollbarAxis.js +7 -0
  35. package/es-modules/Core/Axis/StackingAxis.js +159 -140
  36. package/es-modules/Core/Axis/Tick.js +17 -27
  37. package/es-modules/Core/Chart/Chart.js +24 -38
  38. package/es-modules/Core/Chart/ChartDefaults.js +1 -1
  39. package/es-modules/Core/Chart/StockChart.js +12 -0
  40. package/es-modules/Core/Color/Color.js +96 -104
  41. package/es-modules/Core/DefaultOptions.js +269 -248
  42. package/es-modules/Core/Foundation.js +9 -8
  43. package/es-modules/Core/Geometry/CircleUtilities.js +385 -0
  44. package/es-modules/Core/Geometry/GeometryUtilities.js +83 -0
  45. package/es-modules/Core/Globals.js +23 -1
  46. package/es-modules/{Extensions/Ajax.js → Core/HttpUtilities.js} +86 -42
  47. package/es-modules/Core/{Legend.js → Legend/Legend.js} +142 -116
  48. package/es-modules/{Mixins → Core/Legend}/LegendSymbol.js +54 -38
  49. package/es-modules/Core/Navigator.js +3 -0
  50. package/es-modules/Core/Pointer.js +9 -0
  51. package/es-modules/Core/Renderer/HTML/AST.js +100 -82
  52. package/es-modules/Core/Renderer/HTML/HTMLElement.js +17 -7
  53. package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +26 -9
  54. package/es-modules/Core/Renderer/RendererRegistry.js +9 -4
  55. package/es-modules/Core/Renderer/RendererUtilities.js +159 -0
  56. package/es-modules/Core/Renderer/SVG/SVGElement.js +13 -7
  57. package/es-modules/Core/Renderer/SVG/SVGLabel.js +9 -29
  58. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +2 -2
  59. package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -16
  60. package/es-modules/Core/Responsive.js +166 -148
  61. package/es-modules/Core/Series/DataLabel.js +564 -0
  62. package/es-modules/Core/Series/Point.js +233 -209
  63. package/es-modules/Core/Series/Series.js +174 -2339
  64. package/es-modules/Core/Series/SeriesDefaults.js +2293 -0
  65. package/es-modules/Core/Series/SeriesRegistry.js +3 -9
  66. package/es-modules/Core/Time.js +78 -2
  67. package/es-modules/Core/Tooltip.js +178 -236
  68. package/es-modules/Core/Utilities.js +409 -394
  69. package/es-modules/Extensions/Annotations/Annotations.js +102 -49
  70. package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +9 -1
  71. package/es-modules/Extensions/Annotations/NavigationBindings.js +30 -25
  72. package/es-modules/Extensions/Annotations/Popup.js +16 -7
  73. package/es-modules/Extensions/Boost/BoostOverrides.js +5 -1
  74. package/es-modules/Extensions/Boost/WGLRenderer.js +5 -4
  75. package/es-modules/Extensions/Boost/WGLVBuffer.js +3 -0
  76. package/es-modules/Extensions/BoostCanvas.js +1 -1
  77. package/es-modules/Extensions/CurrentDateIndication.js +1 -1
  78. package/es-modules/Extensions/Data.js +82 -76
  79. package/es-modules/Extensions/DataGrouping.js +225 -184
  80. package/es-modules/Extensions/Debugger/ErrorMessages.js +2 -2
  81. package/es-modules/Extensions/DraggablePoints.js +13 -5
  82. package/es-modules/Extensions/Drilldown.js +41 -14
  83. package/es-modules/Extensions/ExportData.js +7 -4
  84. package/es-modules/Extensions/Exporting/Exporting.js +1273 -0
  85. package/es-modules/Extensions/Exporting/ExportingDefaults.js +803 -0
  86. package/es-modules/Extensions/Exporting/ExportingSymbols.js +73 -0
  87. package/es-modules/Extensions/FullScreen.js +7 -5
  88. package/es-modules/Extensions/NoDataToDisplay.js +1 -1
  89. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +617 -0
  90. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +58 -0
  91. package/es-modules/Extensions/Oldie/Oldie.js +1 -1
  92. package/es-modules/Extensions/Pane.js +0 -1
  93. package/es-modules/Extensions/PatternFill.js +23 -10
  94. package/es-modules/Extensions/Polar.js +2 -1
  95. package/es-modules/Extensions/RangeSelector.js +1 -1
  96. package/es-modules/Extensions/Themes/Avocado.js +49 -20
  97. package/es-modules/Extensions/Themes/DarkBlue.js +226 -203
  98. package/es-modules/Extensions/Themes/DarkGreen.js +231 -203
  99. package/es-modules/Extensions/Themes/DarkUnica.js +201 -172
  100. package/es-modules/Extensions/Themes/Gray.js +228 -205
  101. package/es-modules/Extensions/Themes/Grid.js +109 -81
  102. package/es-modules/Extensions/Themes/GridLight.js +83 -55
  103. package/es-modules/Extensions/Themes/HighContrastDark.js +192 -164
  104. package/es-modules/Extensions/Themes/HighContrastLight.js +49 -21
  105. package/es-modules/Extensions/Themes/SandSignika.js +115 -86
  106. package/es-modules/Extensions/Themes/Skies.js +102 -74
  107. package/es-modules/Extensions/Themes/Sunset.js +47 -19
  108. package/es-modules/Mixins/ColorSeries.js +0 -1
  109. package/es-modules/Mixins/MultipleLines.js +6 -0
  110. package/es-modules/Mixins/TreeSeries.js +1 -1
  111. package/es-modules/Series/Area/AreaSeries.js +2 -2
  112. package/es-modules/Series/AreaSpline/AreaSplineSeries.js +2 -2
  113. package/es-modules/Series/Bubble/BubbleLegendComposition.js +279 -0
  114. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +267 -0
  115. package/es-modules/Series/Bubble/BubbleLegendItem.js +472 -0
  116. package/es-modules/Series/Bubble/BubbleSeries.js +6 -2
  117. package/es-modules/Series/Column/ColumnDataLabel.js +109 -0
  118. package/es-modules/Series/Column/ColumnSeries.js +39 -26
  119. package/es-modules/Series/Column3D/Column3DComposition.js +5 -2
  120. package/es-modules/Series/Flags/FlagsSeries.js +8 -1
  121. package/es-modules/Series/Gantt/GanttSeries.js +3 -3
  122. package/es-modules/Series/Heatmap/HeatmapSeries.js +9 -5
  123. package/es-modules/Series/HeikinAshi/HeikinAshiPoint.js +60 -0
  124. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +277 -0
  125. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +83 -0
  126. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +370 -0
  127. package/es-modules/Series/Line/LineSeries.js +12 -8
  128. package/es-modules/Series/Map/MapSeries.js +5 -3
  129. package/es-modules/Series/MapBubble/MapBubbleSeries.js +6 -5
  130. package/es-modules/Series/OHLC/OHLCPoint.js +11 -0
  131. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +3 -1
  132. package/es-modules/Series/Pie/PieDataLabel.js +448 -0
  133. package/es-modules/Series/Pie/PiePoint.js +35 -34
  134. package/es-modules/Series/Pie/PieSeries.js +19 -16
  135. package/es-modules/Series/Polygon/PolygonSeries.js +3 -3
  136. package/es-modules/Series/Sankey/SankeySeries.js +9 -7
  137. package/es-modules/Series/SolidGauge/SolidGaugeSeries.js +2 -2
  138. package/es-modules/Series/Sunburst/SunburstSeries.js +1 -14
  139. package/es-modules/Series/Timeline/TimelinePoint.js +6 -0
  140. package/es-modules/Series/Timeline/TimelineSeries.js +14 -17
  141. package/es-modules/Series/Treemap/TreemapSeries.js +3 -3
  142. package/es-modules/Series/Venn/VennSeries.js +4 -4
  143. package/es-modules/Series/Venn/VennUtils.js +10 -16
  144. package/es-modules/Series/Waterfall/WaterfallSeries.js +40 -35
  145. package/es-modules/Series/Wordcloud/WordcloudSeries.js +1 -0
  146. package/es-modules/Series/XRange/XRangeSeries.js +4 -2
  147. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +92 -75
  148. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +20 -8
  149. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +17 -4
  150. package/es-modules/Stock/StockToolsBindings.js +77 -38
  151. package/es-modules/Stock/StockToolsGui.js +28 -3
  152. package/es-modules/masters/highcharts-3d.src.js +1 -1
  153. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  154. package/es-modules/masters/highcharts-more.src.js +11 -7
  155. package/es-modules/masters/highcharts.src.js +25 -9
  156. package/es-modules/masters/highmaps.src.js +1 -1
  157. package/es-modules/masters/highstock.src.js +1 -1
  158. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  159. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  160. package/es-modules/masters/indicators/ao.src.js +1 -1
  161. package/es-modules/masters/indicators/apo.src.js +1 -1
  162. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  163. package/es-modules/masters/indicators/aroon.src.js +1 -1
  164. package/es-modules/masters/indicators/atr.src.js +1 -1
  165. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  166. package/es-modules/masters/indicators/cci.src.js +1 -1
  167. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  168. package/es-modules/masters/indicators/cmf.src.js +1 -1
  169. package/es-modules/masters/indicators/cmo.src.js +1 -1
  170. package/es-modules/masters/indicators/dema.src.js +1 -1
  171. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  172. package/es-modules/masters/indicators/dmi.src.js +1 -1
  173. package/es-modules/masters/indicators/dpo.src.js +1 -1
  174. package/es-modules/masters/indicators/ema.src.js +1 -1
  175. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  176. package/es-modules/masters/indicators/indicators-all.src.js +1 -1
  177. package/es-modules/masters/indicators/indicators.src.js +1 -1
  178. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  179. package/es-modules/masters/indicators/klinger.src.js +1 -1
  180. package/es-modules/masters/indicators/macd.src.js +1 -1
  181. package/es-modules/masters/indicators/mfi.src.js +1 -1
  182. package/es-modules/masters/indicators/momentum.src.js +1 -1
  183. package/es-modules/masters/indicators/natr.src.js +1 -1
  184. package/es-modules/masters/indicators/obv.src.js +1 -1
  185. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  186. package/es-modules/masters/indicators/ppo.src.js +1 -1
  187. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  188. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  189. package/es-modules/masters/indicators/psar.src.js +1 -1
  190. package/es-modules/masters/indicators/regressions.src.js +1 -1
  191. package/es-modules/masters/indicators/roc.src.js +1 -1
  192. package/es-modules/masters/indicators/rsi.src.js +1 -1
  193. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  194. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  195. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  196. package/es-modules/masters/indicators/tema.src.js +1 -1
  197. package/es-modules/masters/indicators/trendline.src.js +1 -1
  198. package/es-modules/masters/indicators/trix.src.js +1 -1
  199. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  200. package/es-modules/masters/indicators/vwap.src.js +1 -1
  201. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  202. package/es-modules/masters/indicators/wma.src.js +1 -1
  203. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  204. package/es-modules/masters/modules/accessibility.src.js +1 -1
  205. package/es-modules/masters/modules/annotations-advanced.src.js +1 -1
  206. package/es-modules/masters/modules/annotations.src.js +1 -1
  207. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  208. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  209. package/es-modules/masters/modules/boost.src.js +1 -1
  210. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  211. package/es-modules/masters/modules/bullet.src.js +1 -1
  212. package/es-modules/masters/modules/coloraxis.src.js +6 -2
  213. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  214. package/es-modules/masters/modules/cylinder.src.js +1 -1
  215. package/es-modules/masters/modules/data.src.js +8 -1
  216. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  217. package/es-modules/masters/modules/debugger.src.js +1 -1
  218. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  219. package/es-modules/masters/modules/dotplot.src.js +1 -1
  220. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  221. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  222. package/es-modules/masters/modules/drilldown.src.js +1 -1
  223. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  224. package/es-modules/masters/modules/export-data.src.js +1 -1
  225. package/es-modules/masters/modules/exporting.src.js +10 -2
  226. package/es-modules/masters/modules/full-screen.src.js +1 -1
  227. package/es-modules/masters/modules/funnel.src.js +1 -1
  228. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  229. package/es-modules/masters/modules/gantt.src.js +9 -4
  230. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  231. package/es-modules/masters/modules/heatmap.src.js +6 -2
  232. package/es-modules/masters/modules/heikinashi.src.js +14 -0
  233. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  234. package/es-modules/masters/modules/hollowcandlestick.src.js +14 -0
  235. package/es-modules/masters/modules/item-series.src.js +1 -1
  236. package/es-modules/masters/modules/lollipop.src.js +1 -1
  237. package/es-modules/masters/modules/map.src.js +10 -6
  238. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  239. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  240. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  241. package/es-modules/masters/modules/offline-exporting.src.js +8 -2
  242. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  243. package/es-modules/masters/modules/oldie.src.js +1 -1
  244. package/es-modules/masters/modules/organization.src.js +1 -1
  245. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  246. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  247. package/es-modules/masters/modules/pareto.src.js +1 -1
  248. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  249. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  250. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  251. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  252. package/es-modules/masters/modules/sankey.src.js +1 -1
  253. package/es-modules/masters/modules/series-label.src.js +1 -1
  254. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  255. package/es-modules/masters/modules/sonification.src.js +1 -1
  256. package/es-modules/masters/modules/static-scale.src.js +1 -1
  257. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  258. package/es-modules/masters/modules/stock.src.js +3 -2
  259. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  260. package/es-modules/masters/modules/sunburst.src.js +1 -1
  261. package/es-modules/masters/modules/tilemap.src.js +1 -1
  262. package/es-modules/masters/modules/timeline.src.js +1 -1
  263. package/es-modules/masters/modules/treegrid.src.js +1 -1
  264. package/es-modules/masters/modules/treemap.src.js +1 -1
  265. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  266. package/es-modules/masters/modules/variwide.src.js +1 -1
  267. package/es-modules/masters/modules/vector.src.js +1 -1
  268. package/es-modules/masters/modules/venn.src.js +1 -1
  269. package/es-modules/masters/modules/windbarb.src.js +1 -1
  270. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  271. package/es-modules/masters/modules/xrange.src.js +1 -1
  272. package/es-modules/masters/themes/avocado.src.js +5 -2
  273. package/es-modules/masters/themes/dark-blue.src.js +5 -2
  274. package/es-modules/masters/themes/dark-green.src.js +5 -2
  275. package/es-modules/masters/themes/dark-unica.src.js +5 -2
  276. package/es-modules/masters/themes/gray.src.js +5 -2
  277. package/es-modules/masters/themes/grid-light.src.js +5 -2
  278. package/es-modules/masters/themes/grid.src.js +5 -2
  279. package/es-modules/masters/themes/high-contrast-dark.src.js +5 -2
  280. package/es-modules/masters/themes/high-contrast-light.src.js +5 -2
  281. package/es-modules/masters/themes/sand-signika.src.js +5 -2
  282. package/es-modules/masters/themes/skies.src.js +5 -2
  283. package/es-modules/masters/themes/sunset.src.js +5 -2
  284. package/gfx/stock-icons/annotations-hidden.svg +1 -1
  285. package/gfx/stock-icons/annotations-visible.svg +2 -2
  286. package/gfx/stock-icons/arrow-bottom.svg +1 -1
  287. package/gfx/stock-icons/arrow-left.svg +1 -1
  288. package/gfx/stock-icons/arrow-line.svg +1 -1
  289. package/gfx/stock-icons/arrow-ray.svg +1 -1
  290. package/gfx/stock-icons/arrow-right.svg +1 -1
  291. package/gfx/stock-icons/arrow-segment.svg +1 -2
  292. package/gfx/stock-icons/circle.svg +1 -1
  293. package/gfx/stock-icons/close.svg +2 -2
  294. package/gfx/stock-icons/crooked-3.svg +1 -1
  295. package/gfx/stock-icons/crooked-5.svg +1 -1
  296. package/gfx/stock-icons/current-price-hide.svg +3 -3
  297. package/gfx/stock-icons/current-price-show.svg +2 -2
  298. package/gfx/stock-icons/destroy.svg +1 -1
  299. package/gfx/stock-icons/drawing.svg +18 -0
  300. package/gfx/stock-icons/edit.svg +1 -1
  301. package/gfx/stock-icons/elliott-3.svg +1 -1
  302. package/gfx/stock-icons/elliott-5.svg +1 -1
  303. package/gfx/stock-icons/ellipse.svg +11 -0
  304. package/gfx/stock-icons/fibonacci-timezone.svg +16 -0
  305. package/gfx/stock-icons/fibonacci.svg +1 -1
  306. package/gfx/stock-icons/flag-basic.svg +1 -1
  307. package/gfx/stock-icons/flag-diamond.svg +2 -2
  308. package/gfx/stock-icons/flag-elipse.svg +1 -1
  309. package/gfx/stock-icons/flag-trapeze.svg +2 -2
  310. package/gfx/stock-icons/fullscreen.svg +4 -4
  311. package/gfx/stock-icons/horizontal-line.svg +1 -1
  312. package/gfx/stock-icons/indicators.svg +3 -3
  313. package/gfx/stock-icons/label.svg +4 -4
  314. package/gfx/stock-icons/line.svg +1 -1
  315. package/gfx/stock-icons/linear.svg +11 -0
  316. package/gfx/stock-icons/logarithmic.svg +1 -0
  317. package/gfx/stock-icons/measure-x.svg +2 -2
  318. package/gfx/stock-icons/measure-xy.svg +1 -1
  319. package/gfx/stock-icons/measure-y.svg +1 -1
  320. package/gfx/stock-icons/panning.svg +17 -0
  321. package/gfx/stock-icons/parallel-channel.svg +1 -1
  322. package/gfx/stock-icons/pitchfork.svg +1 -1
  323. package/gfx/stock-icons/ray.svg +1 -1
  324. package/gfx/stock-icons/rectangle.svg +1 -1
  325. package/gfx/stock-icons/remove-annotations.svg +2 -2
  326. package/gfx/stock-icons/save-chart.svg +3 -3
  327. package/gfx/stock-icons/segment.svg +1 -1
  328. package/gfx/stock-icons/separator.svg +1 -1
  329. package/gfx/stock-icons/series-candlestick.svg +1 -1
  330. package/gfx/stock-icons/series-heikin-ashi.svg +1 -0
  331. package/gfx/stock-icons/series-hlc.svg +1 -0
  332. package/gfx/stock-icons/series-hollow-candlestick.svg +1 -0
  333. package/gfx/stock-icons/series-line.svg +1 -1
  334. package/gfx/stock-icons/series-ohlc.svg +4 -4
  335. package/gfx/stock-icons/time-cycles.svg +35 -0
  336. package/gfx/stock-icons/vertical-arrow.svg +1 -1
  337. package/gfx/stock-icons/vertical-counter.svg +1 -1
  338. package/gfx/stock-icons/vertical-double-arrow.svg +1 -1
  339. package/gfx/stock-icons/vertical-label.svg +3 -3
  340. package/gfx/stock-icons/vertical-line.svg +1 -1
  341. package/gfx/stock-icons/zoom-x.svg +2 -2
  342. package/gfx/stock-icons/zoom-xy.svg +2 -2
  343. package/gfx/stock-icons/zoom-y.svg +2 -2
  344. package/highcharts-3d.js +24 -24
  345. package/highcharts-3d.js.map +1 -1
  346. package/highcharts-3d.src.js +6 -3
  347. package/highcharts-gantt.js +800 -792
  348. package/highcharts-gantt.js.map +1 -1
  349. package/highcharts-gantt.src.js +16535 -15918
  350. package/highcharts-more.d.ts +73 -1
  351. package/highcharts-more.js +193 -192
  352. package/highcharts-more.js.map +1 -1
  353. package/highcharts-more.src.d.ts +73 -1
  354. package/highcharts-more.src.js +8044 -7839
  355. package/highcharts.d.ts +3850 -177
  356. package/highcharts.js +589 -581
  357. package/highcharts.js.map +1 -1
  358. package/highcharts.src.d.ts +3850 -177
  359. package/highcharts.src.js +16635 -16060
  360. package/highmaps.js +708 -698
  361. package/highmaps.js.map +1 -1
  362. package/highmaps.src.js +17419 -16521
  363. package/highstock.js +782 -769
  364. package/highstock.js.map +1 -1
  365. package/highstock.src.js +28867 -27975
  366. package/indicators/acceleration-bands.js +9 -9
  367. package/indicators/acceleration-bands.js.map +1 -1
  368. package/indicators/acceleration-bands.src.js +7 -1
  369. package/indicators/accumulation-distribution.js +1 -1
  370. package/indicators/accumulation-distribution.src.js +1 -1
  371. package/indicators/ao.js +1 -1
  372. package/indicators/ao.src.js +1 -1
  373. package/indicators/apo.js +1 -1
  374. package/indicators/apo.src.js +1 -1
  375. package/indicators/aroon-oscillator.js +9 -9
  376. package/indicators/aroon-oscillator.js.map +1 -1
  377. package/indicators/aroon-oscillator.src.js +7 -1
  378. package/indicators/aroon.js +9 -9
  379. package/indicators/aroon.js.map +1 -1
  380. package/indicators/aroon.src.js +7 -1
  381. package/indicators/atr.js +1 -1
  382. package/indicators/atr.src.js +1 -1
  383. package/indicators/bollinger-bands.js +9 -9
  384. package/indicators/bollinger-bands.js.map +1 -1
  385. package/indicators/bollinger-bands.src.js +7 -1
  386. package/indicators/cci.js +1 -1
  387. package/indicators/cci.src.js +1 -1
  388. package/indicators/chaikin.js +1 -1
  389. package/indicators/chaikin.src.js +1 -1
  390. package/indicators/cmf.js +1 -1
  391. package/indicators/cmf.src.js +1 -1
  392. package/indicators/cmo.js +1 -1
  393. package/indicators/cmo.src.js +1 -1
  394. package/indicators/dema.js +1 -1
  395. package/indicators/dema.src.js +1 -1
  396. package/indicators/disparity-index.js +1 -1
  397. package/indicators/disparity-index.src.js +1 -1
  398. package/indicators/dmi.js +11 -11
  399. package/indicators/dmi.js.map +1 -1
  400. package/indicators/dmi.src.js +7 -1
  401. package/indicators/dpo.js +1 -1
  402. package/indicators/dpo.src.js +1 -1
  403. package/indicators/ema.js +1 -1
  404. package/indicators/ema.src.js +1 -1
  405. package/indicators/ichimoku-kinko-hyo.js +1 -1
  406. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  407. package/indicators/indicators-all.js +203 -200
  408. package/indicators/indicators-all.js.map +1 -1
  409. package/indicators/indicators-all.src.js +206 -104
  410. package/indicators/indicators.js +12 -11
  411. package/indicators/indicators.js.map +1 -1
  412. package/indicators/indicators.src.js +108 -90
  413. package/indicators/keltner-channels.js +9 -9
  414. package/indicators/keltner-channels.js.map +1 -1
  415. package/indicators/keltner-channels.src.js +7 -1
  416. package/indicators/klinger.js +13 -13
  417. package/indicators/klinger.js.map +1 -1
  418. package/indicators/klinger.src.js +7 -1
  419. package/indicators/macd.js +1 -1
  420. package/indicators/macd.src.js +1 -1
  421. package/indicators/mfi.js +1 -1
  422. package/indicators/mfi.src.js +1 -1
  423. package/indicators/momentum.js +1 -1
  424. package/indicators/momentum.src.js +1 -1
  425. package/indicators/natr.js +1 -1
  426. package/indicators/natr.src.js +1 -1
  427. package/indicators/obv.js +1 -1
  428. package/indicators/obv.src.js +1 -1
  429. package/indicators/pivot-points.js +1 -1
  430. package/indicators/pivot-points.src.js +1 -1
  431. package/indicators/ppo.js +1 -1
  432. package/indicators/ppo.src.js +1 -1
  433. package/indicators/price-channel.js +9 -9
  434. package/indicators/price-channel.js.map +1 -1
  435. package/indicators/price-channel.src.js +7 -1
  436. package/indicators/price-envelopes.js +1 -1
  437. package/indicators/price-envelopes.src.js +1 -1
  438. package/indicators/psar.js +1 -1
  439. package/indicators/psar.src.js +1 -1
  440. package/indicators/regressions.js +1 -1
  441. package/indicators/regressions.src.js +1 -1
  442. package/indicators/roc.js +1 -1
  443. package/indicators/roc.src.js +1 -1
  444. package/indicators/rsi.js +1 -1
  445. package/indicators/rsi.src.js +1 -1
  446. package/indicators/slow-stochastic.js +1 -1
  447. package/indicators/slow-stochastic.src.js +1 -1
  448. package/indicators/stochastic.js +10 -10
  449. package/indicators/stochastic.js.map +1 -1
  450. package/indicators/stochastic.src.js +7 -1
  451. package/indicators/supertrend.js +10 -10
  452. package/indicators/supertrend.js.map +1 -1
  453. package/indicators/supertrend.src.js +23 -10
  454. package/indicators/tema.js +1 -1
  455. package/indicators/tema.src.js +1 -1
  456. package/indicators/trendline.js +1 -1
  457. package/indicators/trendline.src.js +1 -1
  458. package/indicators/trix.js +1 -1
  459. package/indicators/trix.src.js +1 -1
  460. package/indicators/volume-by-price.js +17 -15
  461. package/indicators/volume-by-price.js.map +1 -1
  462. package/indicators/volume-by-price.src.js +71 -6
  463. package/indicators/vwap.js +1 -1
  464. package/indicators/vwap.src.js +1 -1
  465. package/indicators/williams-r.js +1 -1
  466. package/indicators/williams-r.src.js +1 -1
  467. package/indicators/wma.js +1 -1
  468. package/indicators/wma.src.js +1 -1
  469. package/indicators/zigzag.js +1 -1
  470. package/indicators/zigzag.src.js +1 -1
  471. package/modules/accessibility.js +203 -202
  472. package/modules/accessibility.js.map +1 -1
  473. package/modules/accessibility.src.js +89 -49
  474. package/modules/annotations-advanced.js +164 -163
  475. package/modules/annotations-advanced.js.map +1 -1
  476. package/modules/annotations-advanced.src.js +162 -87
  477. package/modules/annotations.js +111 -111
  478. package/modules/annotations.js.map +1 -1
  479. package/modules/annotations.src.js +162 -87
  480. package/modules/arrow-symbols.js +1 -1
  481. package/modules/arrow-symbols.src.js +1 -1
  482. package/modules/boost-canvas.js +2 -2
  483. package/modules/boost-canvas.js.map +1 -1
  484. package/modules/boost-canvas.src.js +2 -2
  485. package/modules/boost.js +52 -52
  486. package/modules/boost.js.map +1 -1
  487. package/modules/boost.src.js +15 -7
  488. package/modules/broken-axis.js +13 -13
  489. package/modules/broken-axis.js.map +1 -1
  490. package/modules/broken-axis.src.js +34 -15
  491. package/modules/bullet.js +1 -1
  492. package/modules/bullet.src.js +1 -1
  493. package/modules/coloraxis.js +24 -22
  494. package/modules/coloraxis.js.map +1 -1
  495. package/modules/coloraxis.src.js +954 -774
  496. package/modules/current-date-indicator.js +2 -2
  497. package/modules/current-date-indicator.js.map +1 -1
  498. package/modules/current-date-indicator.src.js +2 -2
  499. package/modules/cylinder.js +1 -1
  500. package/modules/cylinder.src.js +1 -1
  501. package/modules/data.js +33 -32
  502. package/modules/data.js.map +1 -1
  503. package/modules/data.src.js +182 -134
  504. package/modules/datagrouping.d.ts +5 -0
  505. package/modules/datagrouping.js +20 -20
  506. package/modules/datagrouping.js.map +1 -1
  507. package/modules/datagrouping.src.d.ts +5 -0
  508. package/modules/datagrouping.src.js +270 -228
  509. package/modules/debugger.js +3 -3
  510. package/modules/debugger.js.map +1 -1
  511. package/modules/debugger.src.js +3 -3
  512. package/modules/dependency-wheel.js +1 -1
  513. package/modules/dependency-wheel.src.js +1 -1
  514. package/modules/dotplot.js +1 -1
  515. package/modules/dotplot.src.js +1 -1
  516. package/modules/drag-panes.js +1 -1
  517. package/modules/drag-panes.src.js +1 -1
  518. package/modules/draggable-points.js +34 -34
  519. package/modules/draggable-points.js.map +1 -1
  520. package/modules/draggable-points.src.js +14 -5
  521. package/modules/drilldown.d.ts +27 -0
  522. package/modules/drilldown.js +18 -18
  523. package/modules/drilldown.js.map +1 -1
  524. package/modules/drilldown.src.d.ts +27 -0
  525. package/modules/drilldown.src.js +42 -16
  526. package/modules/dumbbell.js +1 -1
  527. package/modules/dumbbell.src.js +1 -1
  528. package/modules/export-data.js +20 -20
  529. package/modules/export-data.js.map +1 -1
  530. package/modules/export-data.src.js +8 -5
  531. package/modules/exporting.d.ts +29 -0
  532. package/modules/exporting.js +38 -35
  533. package/modules/exporting.js.map +1 -1
  534. package/modules/exporting.src.d.ts +29 -0
  535. package/modules/exporting.src.js +1937 -1614
  536. package/modules/full-screen.js +2 -2
  537. package/modules/full-screen.js.map +1 -1
  538. package/modules/full-screen.src.js +8 -6
  539. package/modules/funnel.js +1 -1
  540. package/modules/funnel.src.js +1 -1
  541. package/modules/funnel3d.js +1 -1
  542. package/modules/funnel3d.src.js +1 -1
  543. package/modules/gantt.js +218 -217
  544. package/modules/gantt.js.map +1 -1
  545. package/modules/gantt.src.js +74 -32
  546. package/modules/grid-axis.js +23 -22
  547. package/modules/grid-axis.js.map +1 -1
  548. package/modules/grid-axis.src.js +9 -4
  549. package/modules/heatmap.js +39 -37
  550. package/modules/heatmap.js.map +1 -1
  551. package/modules/heatmap.src.js +963 -779
  552. package/modules/heikinashi.js +17 -0
  553. package/modules/heikinashi.js.map +1 -0
  554. package/modules/heikinashi.src.js +394 -0
  555. package/modules/histogram-bellcurve.js +1 -1
  556. package/modules/histogram-bellcurve.src.js +1 -1
  557. package/modules/hollowcandlestick.js +18 -0
  558. package/modules/hollowcandlestick.js.map +1 -0
  559. package/modules/hollowcandlestick.src.js +504 -0
  560. package/modules/item-series.js +1 -1
  561. package/modules/item-series.src.js +1 -1
  562. package/modules/lollipop.js +1 -1
  563. package/modules/lollipop.src.js +1 -1
  564. package/modules/map.d.ts +9 -0
  565. package/modules/map.js +122 -119
  566. package/modules/map.js.map +1 -1
  567. package/modules/map.src.d.ts +9 -0
  568. package/modules/map.src.js +1655 -1332
  569. package/modules/marker-clusters.js +1 -1
  570. package/modules/marker-clusters.src.js +1 -1
  571. package/modules/networkgraph.js +1 -1
  572. package/modules/networkgraph.src.js +1 -1
  573. package/modules/no-data-to-display.js +3 -3
  574. package/modules/no-data-to-display.js.map +1 -1
  575. package/modules/no-data-to-display.src.js +2 -2
  576. package/modules/offline-exporting.js +18 -16
  577. package/modules/offline-exporting.js.map +1 -1
  578. package/modules/offline-exporting.src.js +623 -562
  579. package/modules/oldie-polyfills.js +1 -1
  580. package/modules/oldie-polyfills.src.js +1 -1
  581. package/modules/oldie.js +2 -2
  582. package/modules/oldie.src.js +2 -2
  583. package/modules/organization.js +1 -1
  584. package/modules/organization.src.js +1 -1
  585. package/modules/overlapping-datalabels.js +1 -1
  586. package/modules/overlapping-datalabels.src.js +1 -1
  587. package/modules/parallel-coordinates.js +1 -1
  588. package/modules/parallel-coordinates.src.js +1 -1
  589. package/modules/pareto.js +1 -1
  590. package/modules/pareto.src.js +1 -1
  591. package/modules/pathfinder.js +1 -1
  592. package/modules/pathfinder.src.js +1 -1
  593. package/modules/pattern-fill.js +14 -14
  594. package/modules/pattern-fill.js.map +1 -1
  595. package/modules/pattern-fill.src.js +24 -12
  596. package/modules/price-indicator.js +1 -1
  597. package/modules/price-indicator.src.js +1 -1
  598. package/modules/pyramid3d.js +1 -1
  599. package/modules/pyramid3d.src.js +1 -1
  600. package/modules/sankey.js +28 -28
  601. package/modules/sankey.js.map +1 -1
  602. package/modules/sankey.src.js +11 -11
  603. package/modules/series-label.js +1 -1
  604. package/modules/series-label.src.js +1 -1
  605. package/modules/solid-gauge.js +2 -2
  606. package/modules/solid-gauge.js.map +1 -1
  607. package/modules/solid-gauge.src.js +3 -3
  608. package/modules/sonification.js +1 -1
  609. package/modules/sonification.src.js +1 -1
  610. package/modules/static-scale.js +1 -1
  611. package/modules/static-scale.src.js +1 -1
  612. package/modules/stock-tools.js +159 -157
  613. package/modules/stock-tools.js.map +1 -1
  614. package/modules/stock-tools.src.js +253 -123
  615. package/modules/stock.d.ts +5 -0
  616. package/modules/stock.js +196 -191
  617. package/modules/stock.js.map +1 -1
  618. package/modules/stock.src.d.ts +5 -0
  619. package/modules/stock.src.js +7749 -7432
  620. package/modules/streamgraph.js +1 -1
  621. package/modules/streamgraph.src.js +1 -1
  622. package/modules/sunburst.js +5 -5
  623. package/modules/sunburst.js.map +1 -1
  624. package/modules/sunburst.src.js +6 -19
  625. package/modules/tilemap.js +1 -1
  626. package/modules/tilemap.src.js +1 -1
  627. package/modules/timeline.js +18 -17
  628. package/modules/timeline.js.map +1 -1
  629. package/modules/timeline.src.js +21 -24
  630. package/modules/treegrid.js +57 -57
  631. package/modules/treegrid.js.map +1 -1
  632. package/modules/treegrid.src.js +43 -19
  633. package/modules/treemap.js +5 -5
  634. package/modules/treemap.js.map +1 -1
  635. package/modules/treemap.src.js +5 -5
  636. package/modules/variable-pie.js +1 -1
  637. package/modules/variable-pie.src.js +1 -1
  638. package/modules/variwide.js +1 -1
  639. package/modules/variwide.src.js +1 -1
  640. package/modules/vector.js +1 -1
  641. package/modules/vector.src.js +1 -1
  642. package/modules/venn.js +31 -30
  643. package/modules/venn.js.map +1 -1
  644. package/modules/venn.src.js +508 -424
  645. package/modules/windbarb.js +1 -1
  646. package/modules/windbarb.src.js +1 -1
  647. package/modules/wordcloud.js +4 -4
  648. package/modules/wordcloud.js.map +1 -1
  649. package/modules/wordcloud.src.js +2 -1
  650. package/modules/xrange.js +17 -17
  651. package/modules/xrange.js.map +1 -1
  652. package/modules/xrange.src.js +7 -4
  653. package/package.json +1 -1
  654. package/themes/avocado.d.ts +6 -1
  655. package/themes/avocado.js +3 -3
  656. package/themes/avocado.js.map +1 -1
  657. package/themes/avocado.src.d.ts +6 -1
  658. package/themes/avocado.src.js +53 -22
  659. package/themes/dark-blue.d.ts +6 -1
  660. package/themes/dark-blue.js +3 -3
  661. package/themes/dark-blue.js.map +1 -1
  662. package/themes/dark-blue.src.d.ts +6 -1
  663. package/themes/dark-blue.src.js +231 -205
  664. package/themes/dark-green.d.ts +6 -1
  665. package/themes/dark-green.js +4 -4
  666. package/themes/dark-green.js.map +1 -1
  667. package/themes/dark-green.src.d.ts +6 -1
  668. package/themes/dark-green.src.js +236 -205
  669. package/themes/dark-unica.d.ts +6 -1
  670. package/themes/dark-unica.js +7 -7
  671. package/themes/dark-unica.js.map +1 -1
  672. package/themes/dark-unica.src.d.ts +6 -1
  673. package/themes/dark-unica.src.js +206 -174
  674. package/themes/gray.d.ts +6 -1
  675. package/themes/gray.js +3 -3
  676. package/themes/gray.js.map +1 -1
  677. package/themes/gray.src.d.ts +6 -1
  678. package/themes/gray.src.js +233 -207
  679. package/themes/grid-light.d.ts +6 -1
  680. package/themes/grid-light.js +4 -4
  681. package/themes/grid-light.js.map +1 -1
  682. package/themes/grid-light.src.d.ts +6 -1
  683. package/themes/grid-light.src.js +88 -57
  684. package/themes/grid.d.ts +6 -1
  685. package/themes/grid.js +3 -3
  686. package/themes/grid.js.map +1 -1
  687. package/themes/grid.src.d.ts +6 -1
  688. package/themes/grid.src.js +114 -83
  689. package/themes/high-contrast-dark.js +5 -4
  690. package/themes/high-contrast-dark.js.map +1 -1
  691. package/themes/high-contrast-dark.src.js +197 -166
  692. package/themes/high-contrast-light.js +3 -3
  693. package/themes/high-contrast-light.js.map +1 -1
  694. package/themes/high-contrast-light.src.js +54 -23
  695. package/themes/sand-signika.d.ts +6 -1
  696. package/themes/sand-signika.js +5 -5
  697. package/themes/sand-signika.js.map +1 -1
  698. package/themes/sand-signika.src.d.ts +6 -1
  699. package/themes/sand-signika.src.js +119 -88
  700. package/themes/skies.d.ts +6 -1
  701. package/themes/skies.js +5 -5
  702. package/themes/skies.js.map +1 -1
  703. package/themes/skies.src.d.ts +6 -1
  704. package/themes/skies.src.js +107 -76
  705. package/themes/sunset.d.ts +6 -1
  706. package/themes/sunset.js +3 -3
  707. package/themes/sunset.js.map +1 -1
  708. package/themes/sunset.src.d.ts +6 -1
  709. package/themes/sunset.src.js +52 -21
  710. package/es-modules/Core/Axis/ColorAxis.js +0 -1164
  711. package/es-modules/Core/Axis/HiddenAxis.js +0 -46
  712. package/es-modules/Core/Axis/PlotLineOrBand.js +0 -1051
  713. package/es-modules/Core/Series/DataLabels.js +0 -1173
  714. package/es-modules/Extensions/Exporting.js +0 -2024
  715. package/es-modules/Extensions/OfflineExporting.js +0 -621
  716. package/es-modules/Mixins/Geometry.js +0 -56
  717. package/es-modules/Mixins/GeometryCircles.js +0 -320
  718. package/es-modules/Series/Bubble/BubbleLegend.js +0 -893
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v9.1.1 (2021-06-04)
2
+ * @license Highcharts JS v9.2.2 (2021-08-24)
3
3
  *
4
4
  * Exporting module
5
5
  *
@@ -228,11 +228,13 @@
228
228
  lang.exitFullscreen &&
229
229
  lang.viewFullscreen &&
230
230
  menuItems &&
231
- exportDivElements &&
232
- exportDivElements.length) {
233
- AST.setElementHTML(exportDivElements[menuItems.indexOf('viewFullscreen')], !this.isOpen ?
234
- (exportingOptions.menuItemDefinitions.viewFullscreen.text ||
235
- lang.viewFullscreen) : lang.exitFullscreen);
231
+ exportDivElements) {
232
+ var exportDivElement = exportDivElements[menuItems.indexOf('viewFullscreen')];
233
+ if (exportDivElement) {
234
+ AST.setElementHTML(exportDivElement, !this.isOpen ?
235
+ (exportingOptions.menuItemDefinitions.viewFullscreen.text ||
236
+ lang.viewFullscreen) : lang.exitFullscreen);
237
+ }
236
238
  }
237
239
  };
238
240
  /**
@@ -332,10 +334,8 @@
332
334
 
333
335
  return chartNavigation;
334
336
  });
335
- _registerModule(_modules, 'Extensions/Exporting.js', [_modules['Core/Chart/Chart.js'], _modules['Mixins/Navigation.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Chart, chartNavigationMixin, H, D, palette, SVGRenderer, U) {
337
+ _registerModule(_modules, 'Extensions/Exporting/ExportingDefaults.js', [_modules['Core/Globals.js'], _modules['Core/Color/Palette.js']], function (H, Palette) {
336
338
  /* *
337
- *
338
- * Exporting module
339
339
  *
340
340
  * (c) 2010-2021 Torstein Honsi
341
341
  *
@@ -344,763 +344,379 @@
344
344
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
345
345
  *
346
346
  * */
347
- var doc = H.doc,
348
- isTouchDevice = H.isTouchDevice,
349
- win = H.win;
350
- var defaultOptions = D.defaultOptions;
351
- var symbols = SVGRenderer.prototype.symbols;
352
- var addEvent = U.addEvent,
353
- css = U.css,
354
- createElement = U.createElement,
355
- discardElement = U.discardElement,
356
- extend = U.extend,
357
- find = U.find,
358
- fireEvent = U.fireEvent,
359
- isObject = U.isObject,
360
- merge = U.merge,
361
- objectEach = U.objectEach,
362
- pick = U.pick,
363
- removeEvent = U.removeEvent,
364
- uniqueKey = U.uniqueKey;
365
- // Add language
366
- extend(defaultOptions.lang
347
+ var isTouchDevice = H.isTouchDevice;
348
+ /* *
349
+ *
350
+ * API Options
351
+ *
352
+ * */
353
+ // Add the export related options
367
354
  /**
368
- * @optionparent lang
355
+ * Options for the exporting module. For an overview on the matter, see
356
+ * [the docs](https://www.highcharts.com/docs/export-module/export-module-overview).
357
+ *
358
+ * @requires modules/exporting
359
+ * @optionparent exporting
369
360
  */
370
- , {
371
- /**
372
- * Exporting module only. The text for the menu item to view the chart
373
- * in full screen.
374
- *
375
- * @since 8.0.1
376
- *
377
- * @private
378
- */
379
- viewFullscreen: 'View in full screen',
380
- /**
381
- * Exporting module only. The text for the menu item to exit the chart
382
- * from full screen.
383
- *
384
- * @since 8.0.1
385
- *
386
- * @private
387
- */
388
- exitFullscreen: 'Exit from full screen',
389
- /**
390
- * Exporting module only. The text for the menu item to print the chart.
391
- *
392
- * @since 3.0.1
393
- * @requires modules/exporting
394
- *
395
- * @private
396
- */
397
- printChart: 'Print chart',
398
- /**
399
- * Exporting module only. The text for the PNG download menu item.
400
- *
401
- * @since 2.0
402
- * @requires modules/exporting
403
- *
404
- * @private
405
- */
406
- downloadPNG: 'Download PNG image',
407
- /**
408
- * Exporting module only. The text for the JPEG download menu item.
409
- *
410
- * @since 2.0
411
- * @requires modules/exporting
412
- *
413
- * @private
414
- */
415
- downloadJPEG: 'Download JPEG image',
416
- /**
417
- * Exporting module only. The text for the PDF download menu item.
418
- *
419
- * @since 2.0
420
- * @requires modules/exporting
421
- *
422
- * @private
423
- */
424
- downloadPDF: 'Download PDF document',
425
- /**
426
- * Exporting module only. The text for the SVG download menu item.
427
- *
428
- * @since 2.0
429
- * @requires modules/exporting
430
- *
431
- * @private
432
- */
433
- downloadSVG: 'Download SVG vector image',
434
- /**
435
- * Exporting module menu. The tooltip title for the context menu holding
436
- * print and export menu items.
437
- *
438
- * @since 3.0
439
- * @requires modules/exporting
440
- *
441
- * @private
442
- */
443
- contextButtonTitle: 'Chart context menu'
444
- });
445
- if (!defaultOptions.navigation) {
446
- // Buttons and menus are collected in a separate config option set called
447
- // 'navigation'. This can be extended later to add control buttons like
448
- // zoom and pan right click menus.
449
- /**
450
- * A collection of options for buttons and menus appearing in the exporting
451
- * module.
452
- *
453
- * @requires modules/exporting
454
- * @optionparent navigation
455
- */
456
- defaultOptions.navigation = {};
457
- }
458
- merge(true, defaultOptions.navigation, {
459
- /**
460
- * @optionparent navigation.buttonOptions
461
- *
462
- * @private
463
- */
464
- buttonOptions: {
465
- theme: {},
361
+ var exporting = {
466
362
  /**
467
- * Whether to enable buttons.
363
+ * Experimental setting to allow HTML inside the chart (added through
364
+ * the `useHTML` options), directly in the exported image. This allows
365
+ * you to preserve complicated HTML structures like tables or bi-directional
366
+ * text in exported charts.
468
367
  *
469
- * @sample highcharts/navigation/buttonoptions-enabled/
470
- * Exporting module loaded but buttons disabled
368
+ * Disclaimer: The HTML is rendered in a `foreignObject` tag in the
369
+ * generated SVG. The official export server is based on PhantomJS,
370
+ * which supports this, but other SVG clients, like Batik, does not
371
+ * support it. This also applies to downloaded SVG that you want to
372
+ * open in a desktop client.
471
373
  *
472
374
  * @type {boolean}
473
- * @default true
474
- * @since 2.0
475
- * @apioption navigation.buttonOptions.enabled
375
+ * @default false
376
+ * @since 4.1.8
377
+ * @apioption exporting.allowHTML
476
378
  */
477
379
  /**
478
- * The pixel size of the symbol on the button.
380
+ * Additional chart options to be merged into the chart before exporting to
381
+ * an image format. This does not apply to printing the chart via the export
382
+ * menu.
479
383
  *
480
- * @sample highcharts/navigation/buttonoptions-height/
481
- * Bigger buttons
384
+ * For example, a common use case is to add data labels to improve
385
+ * readability of the exported chart, or to add a printer-friendly color
386
+ * scheme to exported PDFs.
482
387
  *
483
- * @since 2.0
484
- */
485
- symbolSize: 14,
486
- /**
487
- * The x position of the center of the symbol inside the button.
488
- *
489
- * @sample highcharts/navigation/buttonoptions-height/
490
- * Bigger buttons
388
+ * @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
389
+ * Added data labels
390
+ * @sample {highstock} highcharts/exporting/chartoptions-data-labels/
391
+ * Added data labels
491
392
  *
492
- * @since 2.0
393
+ * @type {Highcharts.Options}
394
+ * @apioption exporting.chartOptions
493
395
  */
494
- symbolX: 12.5,
495
396
  /**
496
- * The y position of the center of the symbol inside the button.
397
+ * Whether to enable the exporting module. Disabling the module will
398
+ * hide the context button, but API methods will still be available.
497
399
  *
498
- * @sample highcharts/navigation/buttonoptions-height/
499
- * Bigger buttons
400
+ * @sample {highcharts} highcharts/exporting/enabled-false/
401
+ * Exporting module is loaded but disabled
402
+ * @sample {highstock} highcharts/exporting/enabled-false/
403
+ * Exporting module is loaded but disabled
500
404
  *
501
- * @since 2.0
405
+ * @type {boolean}
406
+ * @default true
407
+ * @since 2.0
408
+ * @apioption exporting.enabled
502
409
  */
503
- symbolY: 10.5,
504
410
  /**
505
- * Alignment for the buttons.
411
+ * Function to call if the offline-exporting module fails to export
412
+ * a chart on the client side, and [fallbackToExportServer](
413
+ * #exporting.fallbackToExportServer) is disabled. If left undefined, an
414
+ * exception is thrown instead. Receives two parameters, the exporting
415
+ * options, and the error from the module.
506
416
  *
507
- * @sample highcharts/navigation/buttonoptions-align/
508
- * Center aligned
417
+ * @see [fallbackToExportServer](#exporting.fallbackToExportServer)
509
418
  *
510
- * @type {Highcharts.AlignValue}
511
- * @since 2.0
419
+ * @type {Highcharts.ExportingErrorCallbackFunction}
420
+ * @since 5.0.0
421
+ * @requires modules/exporting
422
+ * @requires modules/offline-exporting
423
+ * @apioption exporting.error
512
424
  */
513
- align: 'right',
514
425
  /**
515
- * The pixel spacing between buttons.
426
+ * Whether or not to fall back to the export server if the offline-exporting
427
+ * module is unable to export the chart on the client side. This happens for
428
+ * certain browsers, and certain features (e.g.
429
+ * [allowHTML](#exporting.allowHTML)), depending on the image type exporting
430
+ * to. For very complex charts, it is possible that export can fail in
431
+ * browsers that don't support Blob objects, due to data URL length limits.
432
+ * It is recommended to define the [exporting.error](#exporting.error)
433
+ * handler if disabling fallback, in order to notify users in case export
434
+ * fails.
516
435
  *
517
- * @since 2.0
436
+ * @type {boolean}
437
+ * @default true
438
+ * @since 4.1.8
439
+ * @requires modules/exporting
440
+ * @requires modules/offline-exporting
441
+ * @apioption exporting.fallbackToExportServer
518
442
  */
519
- buttonSpacing: 3,
520
443
  /**
521
- * Pixel height of the buttons.
444
+ * The filename, without extension, to use for the exported chart.
522
445
  *
523
- * @sample highcharts/navigation/buttonoptions-height/
524
- * Bigger buttons
446
+ * @sample {highcharts} highcharts/exporting/filename/
447
+ * Custom file name
448
+ * @sample {highstock} highcharts/exporting/filename/
449
+ * Custom file name
525
450
  *
526
- * @since 2.0
451
+ * @type {string}
452
+ * @default chart
453
+ * @since 2.0
454
+ * @apioption exporting.filename
527
455
  */
528
- height: 22,
529
456
  /**
530
- * A text string to add to the individual button.
457
+ * An object containing additional key value data for the POST form that
458
+ * sends the SVG to the export server. For example, a `target` can be set to
459
+ * make sure the generated image is received in another frame, or a custom
460
+ * `enctype` or `encoding` can be set.
531
461
  *
532
- * @sample highcharts/exporting/buttons-text/
533
- * Full text button
534
- * @sample highcharts/exporting/buttons-text-symbol/
535
- * Combined symbol and text
462
+ * @type {Highcharts.HTMLAttributes}
463
+ * @since 3.0.8
464
+ * @apioption exporting.formAttributes
465
+ */
466
+ /**
467
+ * Path where Highcharts will look for export module dependencies to
468
+ * load on demand if they don't already exist on `window`. Should currently
469
+ * point to location of [CanVG](https://github.com/canvg/canvg) library,
470
+ * [jsPDF](https://github.com/yWorks/jsPDF) and
471
+ * [svg2pdf.js](https://github.com/yWorks/svg2pdf.js), required for client
472
+ * side export in certain browsers.
536
473
  *
537
474
  * @type {string}
538
- * @default null
539
- * @since 3.0
540
- * @apioption navigation.buttonOptions.text
475
+ * @default https://code.highcharts.com/{version}/lib
476
+ * @since 5.0.0
477
+ * @apioption exporting.libURL
541
478
  */
542
479
  /**
543
- * The vertical offset of the button's position relative to its
544
- * `verticalAlign`.
545
- *
546
- * @sample highcharts/navigation/buttonoptions-verticalalign/
547
- * Buttons at lower right
480
+ * Analogous to [sourceWidth](#exporting.sourceWidth).
548
481
  *
549
482
  * @type {number}
550
- * @default 0
551
- * @since 2.0
552
- * @apioption navigation.buttonOptions.y
483
+ * @since 3.0
484
+ * @apioption exporting.sourceHeight
553
485
  */
554
486
  /**
555
- * The vertical alignment of the buttons. Can be one of `"top"`,
556
- * `"middle"` or `"bottom"`.
487
+ * The width of the original chart when exported, unless an explicit
488
+ * [chart.width](#chart.width) is set, or a pixel width is set on the
489
+ * container. The width exported raster image is then multiplied by
490
+ * [scale](#exporting.scale).
557
491
  *
558
- * @sample highcharts/navigation/buttonoptions-verticalalign/
559
- * Buttons at lower right
492
+ * @sample {highcharts} highcharts/exporting/sourcewidth/
493
+ * Source size demo
494
+ * @sample {highstock} highcharts/exporting/sourcewidth/
495
+ * Source size demo
496
+ * @sample {highmaps} maps/exporting/sourcewidth/
497
+ * Source size demo
560
498
  *
561
- * @type {Highcharts.VerticalAlignValue}
562
- * @since 2.0
499
+ * @type {number}
500
+ * @since 3.0
501
+ * @apioption exporting.sourceWidth
563
502
  */
564
- verticalAlign: 'top',
565
503
  /**
566
- * The pixel width of the button.
504
+ * The pixel width of charts exported to PNG or JPG. As of Highcharts
505
+ * 3.0, the default pixel width is a function of the [chart.width](
506
+ * #chart.width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
507
+ * [exporting.scale](#exporting.scale).
567
508
  *
568
- * @sample highcharts/navigation/buttonoptions-height/
569
- * Bigger buttons
509
+ * @sample {highcharts} highcharts/exporting/width/
510
+ * Export to 200px wide images
511
+ * @sample {highstock} highcharts/exporting/width/
512
+ * Export to 200px wide images
570
513
  *
571
- * @since 2.0
514
+ * @type {number}
515
+ * @since 2.0
516
+ * @apioption exporting.width
572
517
  */
573
- width: 24
574
- }
575
- });
576
- // Presentational attributes
577
- merge(true, defaultOptions.navigation,
578
- /**
579
- * A collection of options for buttons and menus appearing in the exporting
580
- * module.
581
- *
582
- * @optionparent navigation
583
- */
584
- {
585
- /**
586
- * CSS styles for the popup menu appearing by default when the export
587
- * icon is clicked. This menu is rendered in HTML.
588
- *
589
- * @see In styled mode, the menu is styled with the `.highcharts-menu`
590
- * class.
591
- *
592
- * @sample highcharts/navigation/menustyle/
593
- * Light gray menu background
594
- *
595
- * @type {Highcharts.CSSObject}
596
- * @default {"border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0"}
597
- * @since 2.0
598
- *
599
- * @private
600
- */
601
- menuStyle: {
602
- /** @ignore-option */
603
- border: "1px solid " + palette.neutralColor40,
604
- /** @ignore-option */
605
- background: palette.backgroundColor,
606
- /** @ignore-option */
607
- padding: '5px 0'
608
- },
609
- /**
610
- * CSS styles for the individual items within the popup menu appearing
611
- * by default when the export icon is clicked. The menu items are
612
- * rendered in HTML. Font size defaults to `11px` on desktop and `14px`
613
- * on touch devices.
614
- *
615
- * @see In styled mode, the menu items are styled with the
616
- * `.highcharts-menu-item` class.
617
- *
618
- * @sample {highcharts} highcharts/navigation/menuitemstyle/
619
- * Add a grey stripe to the left
620
- *
621
- * @type {Highcharts.CSSObject}
622
- * @default {"padding": "0.5em 1em", "color": "#333333", "background": "none", "fontSize": "11px/14px", "transition": "background 250ms, color 250ms"}
623
- * @since 2.0
624
- *
625
- * @private
626
- */
627
- menuItemStyle: {
628
- /** @ignore-option */
629
- padding: '0.5em 1em',
630
- /** @ignore-option */
631
- color: palette.neutralColor80,
632
- /** @ignore-option */
633
- background: 'none',
634
- /** @ignore-option */
635
- fontSize: isTouchDevice ? '14px' : '11px',
636
- /** @ignore-option */
637
- transition: 'background 250ms, color 250ms'
638
- },
639
- /**
640
- * CSS styles for the hover state of the individual items within the
641
- * popup menu appearing by default when the export icon is clicked. The
642
- * menu items are rendered in HTML.
643
- *
644
- * @see In styled mode, the menu items are styled with the
645
- * `.highcharts-menu-item` class.
646
- *
647
- * @sample highcharts/navigation/menuitemhoverstyle/
648
- * Bold text on hover
649
- *
650
- * @type {Highcharts.CSSObject}
651
- * @default {"background": "#335cad", "color": "#ffffff"}
652
- * @since 2.0
653
- *
654
- * @private
655
- */
656
- menuItemHoverStyle: {
657
- /** @ignore-option */
658
- background: palette.highlightColor80,
659
- /** @ignore-option */
660
- color: palette.backgroundColor
661
- },
662
- /**
663
- * A collection of options for buttons appearing in the exporting
664
- * module.
665
- *
666
- * In styled mode, the buttons are styled with the
667
- * `.highcharts-contextbutton` and `.highcharts-button-symbol` classes.
668
- *
669
- * @requires modules/exporting
670
- *
671
- * @private
672
- */
673
- buttonOptions: {
674
518
  /**
675
- * Fill color for the symbol within the button.
676
- *
677
- * @sample highcharts/navigation/buttonoptions-symbolfill/
678
- * Blue symbol stroke for one of the buttons
519
+ * Default MIME type for exporting if `chart.exportChart()` is called
520
+ * without specifying a `type` option. Possible values are `image/png`,
521
+ * `image/jpeg`, `application/pdf` and `image/svg+xml`.
679
522
  *
680
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
523
+ * @type {Highcharts.ExportingMimeTypeValue}
681
524
  * @since 2.0
682
525
  */
683
- symbolFill: palette.neutralColor60,
526
+ type: 'image/png',
684
527
  /**
685
- * The color of the symbol's stroke or line.
528
+ * The URL for the server module converting the SVG string to an image
529
+ * format. By default this points to Highchart's free web service.
686
530
  *
687
- * @sample highcharts/navigation/buttonoptions-symbolstroke/
688
- * Blue symbol stroke
689
- *
690
- * @type {Highcharts.ColorString}
691
531
  * @since 2.0
692
532
  */
693
- symbolStroke: palette.neutralColor60,
533
+ url: 'https://export.highcharts.com/',
694
534
  /**
695
- * The pixel stroke width of the symbol on the button.
696
- *
697
- * @sample highcharts/navigation/buttonoptions-height/
698
- * Bigger buttons
535
+ * When printing the chart from the menu item in the burger menu, if
536
+ * the on-screen chart exceeds this width, it is resized. After printing
537
+ * or cancelled, it is restored. The default width makes the chart
538
+ * fit into typical paper format. Note that this does not affect the
539
+ * chart when printing the web page as a whole.
699
540
  *
700
- * @since 2.0
541
+ * @since 4.2.5
701
542
  */
702
- symbolStrokeWidth: 3,
543
+ printMaxWidth: 780,
703
544
  /**
704
- * A configuration object for the button theme. The object accepts
705
- * SVG properties like `stroke-width`, `stroke` and `fill`.
706
- * Tri-state button styles are supported by the `states.hover` and
707
- * `states.select` objects.
545
+ * Defines the scale or zoom factor for the exported image compared
546
+ * to the on-screen display. While for instance a 600px wide chart
547
+ * may look good on a website, it will look bad in print. The default
548
+ * scale of 2 makes this chart export to a 1200px PNG or JPG.
708
549
  *
709
- * @sample highcharts/navigation/buttonoptions-theme/
710
- * Theming the buttons
550
+ * @see [chart.width](#chart.width)
551
+ * @see [exporting.sourceWidth](#exporting.sourceWidth)
711
552
  *
712
- * @requires modules/exporting
553
+ * @sample {highcharts} highcharts/exporting/scale/
554
+ * Scale demonstrated
555
+ * @sample {highstock} highcharts/exporting/scale/
556
+ * Scale demonstrated
557
+ * @sample {highmaps} maps/exporting/scale/
558
+ * Scale demonstrated
713
559
  *
714
560
  * @since 3.0
715
561
  */
716
- theme: {
717
- /**
718
- * The default fill exists only to capture hover events.
719
- *
720
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
721
- * @default ${palette.backgroundColor}
722
- * @apioption navigation.buttonOptions.theme.fill
723
- */
724
- /**
725
- * Default stroke for the buttons.
726
- * @type {Highcharts.ColorString}
727
- * @default none
728
- * @apioption navigation.buttonOptions.theme.stroke
729
- */
730
- /**
731
- * Padding for the button.
732
- */
733
- padding: 5
734
- }
735
- }
736
- });
737
- // Add the export related options
738
- /**
739
- * Options for the exporting module. For an overview on the matter, see
740
- * [the docs](https://www.highcharts.com/docs/export-module/export-module-overview).
741
- *
742
- * @requires modules/exporting
743
- * @optionparent exporting
744
- */
745
- defaultOptions.exporting = {
746
- /**
747
- * Experimental setting to allow HTML inside the chart (added through
748
- * the `useHTML` options), directly in the exported image. This allows
749
- * you to preserve complicated HTML structures like tables or bi-directional
750
- * text in exported charts.
751
- *
752
- * Disclaimer: The HTML is rendered in a `foreignObject` tag in the
753
- * generated SVG. The official export server is based on PhantomJS,
754
- * which supports this, but other SVG clients, like Batik, does not
755
- * support it. This also applies to downloaded SVG that you want to
756
- * open in a desktop client.
757
- *
758
- * @type {boolean}
759
- * @default false
760
- * @since 4.1.8
761
- * @apioption exporting.allowHTML
762
- */
763
- /**
764
- * Additional chart options to be merged into the chart before exporting to
765
- * an image format. This does not apply to printing the chart via the export
766
- * menu.
767
- *
768
- * For example, a common use case is to add data labels to improve
769
- * readability of the exported chart, or to add a printer-friendly color
770
- * scheme to exported PDFs.
771
- *
772
- * @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
773
- * Added data labels
774
- * @sample {highstock} highcharts/exporting/chartoptions-data-labels/
775
- * Added data labels
776
- *
777
- * @type {Highcharts.Options}
778
- * @apioption exporting.chartOptions
779
- */
780
- /**
781
- * Whether to enable the exporting module. Disabling the module will
782
- * hide the context button, but API methods will still be available.
783
- *
784
- * @sample {highcharts} highcharts/exporting/enabled-false/
785
- * Exporting module is loaded but disabled
786
- * @sample {highstock} highcharts/exporting/enabled-false/
787
- * Exporting module is loaded but disabled
788
- *
789
- * @type {boolean}
790
- * @default true
791
- * @since 2.0
792
- * @apioption exporting.enabled
793
- */
794
- /**
795
- * Function to call if the offline-exporting module fails to export
796
- * a chart on the client side, and [fallbackToExportServer](
797
- * #exporting.fallbackToExportServer) is disabled. If left undefined, an
798
- * exception is thrown instead. Receives two parameters, the exporting
799
- * options, and the error from the module.
800
- *
801
- * @see [fallbackToExportServer](#exporting.fallbackToExportServer)
802
- *
803
- * @type {Highcharts.ExportingErrorCallbackFunction}
804
- * @since 5.0.0
805
- * @requires modules/exporting
806
- * @requires modules/offline-exporting
807
- * @apioption exporting.error
808
- */
809
- /**
810
- * Whether or not to fall back to the export server if the offline-exporting
811
- * module is unable to export the chart on the client side. This happens for
812
- * certain browsers, and certain features (e.g.
813
- * [allowHTML](#exporting.allowHTML)), depending on the image type exporting
814
- * to. For very complex charts, it is possible that export can fail in
815
- * browsers that don't support Blob objects, due to data URL length limits.
816
- * It is recommended to define the [exporting.error](#exporting.error)
817
- * handler if disabling fallback, in order to notify users in case export
818
- * fails.
819
- *
820
- * @type {boolean}
821
- * @default true
822
- * @since 4.1.8
823
- * @requires modules/exporting
824
- * @requires modules/offline-exporting
825
- * @apioption exporting.fallbackToExportServer
826
- */
827
- /**
828
- * The filename, without extension, to use for the exported chart.
829
- *
830
- * @sample {highcharts} highcharts/exporting/filename/
831
- * Custom file name
832
- * @sample {highstock} highcharts/exporting/filename/
833
- * Custom file name
834
- *
835
- * @type {string}
836
- * @default chart
837
- * @since 2.0
838
- * @apioption exporting.filename
839
- */
840
- /**
841
- * An object containing additional key value data for the POST form that
842
- * sends the SVG to the export server. For example, a `target` can be set to
843
- * make sure the generated image is received in another frame, or a custom
844
- * `enctype` or `encoding` can be set.
845
- *
846
- * @type {Highcharts.HTMLAttributes}
847
- * @since 3.0.8
848
- * @apioption exporting.formAttributes
849
- */
850
- /**
851
- * Path where Highcharts will look for export module dependencies to
852
- * load on demand if they don't already exist on `window`. Should currently
853
- * point to location of [CanVG](https://github.com/canvg/canvg) library,
854
- * [jsPDF](https://github.com/yWorks/jsPDF) and
855
- * [svg2pdf.js](https://github.com/yWorks/svg2pdf.js), required for client
856
- * side export in certain browsers.
857
- *
858
- * @type {string}
859
- * @default https://code.highcharts.com/{version}/lib
860
- * @since 5.0.0
861
- * @apioption exporting.libURL
862
- */
863
- /**
864
- * Analogous to [sourceWidth](#exporting.sourceWidth).
865
- *
866
- * @type {number}
867
- * @since 3.0
868
- * @apioption exporting.sourceHeight
869
- */
870
- /**
871
- * The width of the original chart when exported, unless an explicit
872
- * [chart.width](#chart.width) is set, or a pixel width is set on the
873
- * container. The width exported raster image is then multiplied by
874
- * [scale](#exporting.scale).
875
- *
876
- * @sample {highcharts} highcharts/exporting/sourcewidth/
877
- * Source size demo
878
- * @sample {highstock} highcharts/exporting/sourcewidth/
879
- * Source size demo
880
- * @sample {highmaps} maps/exporting/sourcewidth/
881
- * Source size demo
882
- *
883
- * @type {number}
884
- * @since 3.0
885
- * @apioption exporting.sourceWidth
886
- */
887
- /**
888
- * The pixel width of charts exported to PNG or JPG. As of Highcharts
889
- * 3.0, the default pixel width is a function of the [chart.width](
890
- * #chart.width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
891
- * [exporting.scale](#exporting.scale).
892
- *
893
- * @sample {highcharts} highcharts/exporting/width/
894
- * Export to 200px wide images
895
- * @sample {highstock} highcharts/exporting/width/
896
- * Export to 200px wide images
897
- *
898
- * @type {number}
899
- * @since 2.0
900
- * @apioption exporting.width
901
- */
902
- /**
903
- * Default MIME type for exporting if `chart.exportChart()` is called
904
- * without specifying a `type` option. Possible values are `image/png`,
905
- * `image/jpeg`, `application/pdf` and `image/svg+xml`.
906
- *
907
- * @type {Highcharts.ExportingMimeTypeValue}
908
- * @since 2.0
909
- */
910
- type: 'image/png',
911
- /**
912
- * The URL for the server module converting the SVG string to an image
913
- * format. By default this points to Highchart's free web service.
914
- *
915
- * @since 2.0
916
- */
917
- url: 'https://export.highcharts.com/',
918
- /**
919
- * When printing the chart from the menu item in the burger menu, if
920
- * the on-screen chart exceeds this width, it is resized. After printing
921
- * or cancelled, it is restored. The default width makes the chart
922
- * fit into typical paper format. Note that this does not affect the
923
- * chart when printing the web page as a whole.
924
- *
925
- * @since 4.2.5
926
- */
927
- printMaxWidth: 780,
928
- /**
929
- * Defines the scale or zoom factor for the exported image compared
930
- * to the on-screen display. While for instance a 600px wide chart
931
- * may look good on a website, it will look bad in print. The default
932
- * scale of 2 makes this chart export to a 1200px PNG or JPG.
933
- *
934
- * @see [chart.width](#chart.width)
935
- * @see [exporting.sourceWidth](#exporting.sourceWidth)
936
- *
937
- * @sample {highcharts} highcharts/exporting/scale/
938
- * Scale demonstrated
939
- * @sample {highstock} highcharts/exporting/scale/
940
- * Scale demonstrated
941
- * @sample {highmaps} maps/exporting/scale/
942
- * Scale demonstrated
943
- *
944
- * @since 3.0
945
- */
946
- scale: 2,
947
- /**
948
- * Options for the export related buttons, print and export. In addition
949
- * to the default buttons listed here, custom buttons can be added.
950
- * See [navigation.buttonOptions](#navigation.buttonOptions) for general
951
- * options.
952
- *
953
- * @type {Highcharts.Dictionary<*>}
954
- * @requires modules/exporting
955
- */
956
- buttons: {
562
+ scale: 2,
957
563
  /**
958
- * Options for the export button.
959
- *
960
- * In styled mode, export button styles can be applied with the
961
- * `.highcharts-contextbutton` class.
564
+ * Options for the export related buttons, print and export. In addition
565
+ * to the default buttons listed here, custom buttons can be added.
566
+ * See [navigation.buttonOptions](#navigation.buttonOptions) for general
567
+ * options.
962
568
  *
963
- * @declare Highcharts.ExportingButtonsOptionsObject
964
- * @extends navigation.buttonOptions
569
+ * @type {Highcharts.Dictionary<*>}
965
570
  * @requires modules/exporting
966
571
  */
967
- contextButton: {
968
- /**
969
- * A click handler callback to use on the button directly instead of
970
- * the popup menu.
971
- *
972
- * @sample highcharts/exporting/buttons-contextbutton-onclick/
973
- * Skip the menu and export the chart directly
974
- *
975
- * @type {Function}
976
- * @since 2.0
977
- * @apioption exporting.buttons.contextButton.onclick
978
- */
979
- /**
980
- * See [navigation.buttonOptions.symbolFill](
981
- * #navigation.buttonOptions.symbolFill).
982
- *
983
- * @type {Highcharts.ColorString}
984
- * @default #666666
985
- * @since 2.0
986
- * @apioption exporting.buttons.contextButton.symbolFill
987
- */
988
- /**
989
- * The horizontal position of the button relative to the `align`
990
- * option.
991
- *
992
- * @type {number}
993
- * @default -10
994
- * @since 2.0
995
- * @apioption exporting.buttons.contextButton.x
996
- */
997
- /**
998
- * The class name of the context button.
999
- */
1000
- className: 'highcharts-contextbutton',
1001
- /**
1002
- * The class name of the menu appearing from the button.
1003
- */
1004
- menuClassName: 'highcharts-contextmenu',
572
+ buttons: {
1005
573
  /**
1006
- * The symbol for the button. Points to a definition function in
1007
- * the `Highcharts.Renderer.symbols` collection. The default
1008
- * `menu` function is part of the exporting module. Possible
1009
- * values are "circle", "square", "diamond", "triangle",
1010
- * "triangle-down", "menu", "menuball" or custom shape.
574
+ * Options for the export button.
1011
575
  *
1012
- * @sample highcharts/exporting/buttons-contextbutton-symbol/
1013
- * Use a circle for symbol
1014
- * @sample highcharts/exporting/buttons-contextbutton-symbol-custom/
1015
- * Custom shape as symbol
576
+ * In styled mode, export button styles can be applied with the
577
+ * `.highcharts-contextbutton` class.
1016
578
  *
1017
- * @type {Highcharts.SymbolKeyValue|"menu"|"menuball"|string}
1018
- * @since 2.0
579
+ * @declare Highcharts.ExportingButtonsOptionsObject
580
+ * @extends navigation.buttonOptions
581
+ * @requires modules/exporting
1019
582
  */
1020
- symbol: 'menu',
583
+ contextButton: {
584
+ /**
585
+ * A click handler callback to use on the button directly instead of
586
+ * the popup menu.
587
+ *
588
+ * @sample highcharts/exporting/buttons-contextbutton-onclick/
589
+ * Skip the menu and export the chart directly
590
+ *
591
+ * @type {Function}
592
+ * @since 2.0
593
+ * @apioption exporting.buttons.contextButton.onclick
594
+ */
595
+ /**
596
+ * See [navigation.buttonOptions.symbolFill](
597
+ * #navigation.buttonOptions.symbolFill).
598
+ *
599
+ * @type {Highcharts.ColorString}
600
+ * @default #666666
601
+ * @since 2.0
602
+ * @apioption exporting.buttons.contextButton.symbolFill
603
+ */
604
+ /**
605
+ * The horizontal position of the button relative to the `align`
606
+ * option.
607
+ *
608
+ * @type {number}
609
+ * @default -10
610
+ * @since 2.0
611
+ * @apioption exporting.buttons.contextButton.x
612
+ */
613
+ /**
614
+ * The class name of the context button.
615
+ */
616
+ className: 'highcharts-contextbutton',
617
+ /**
618
+ * The class name of the menu appearing from the button.
619
+ */
620
+ menuClassName: 'highcharts-contextmenu',
621
+ /**
622
+ * The symbol for the button. Points to a definition function in
623
+ * the `Highcharts.Renderer.symbols` collection. The default
624
+ * `menu` function is part of the exporting module. Possible
625
+ * values are "circle", "square", "diamond", "triangle",
626
+ * "triangle-down", "menu", "menuball" or custom shape.
627
+ *
628
+ * @sample highcharts/exporting/buttons-contextbutton-symbol/
629
+ * Use a circle for symbol
630
+ * @sample highcharts/exporting/buttons-contextbutton-symbol-custom/
631
+ * Custom shape as symbol
632
+ *
633
+ * @type {Highcharts.SymbolKeyValue|"menu"|"menuball"|string}
634
+ * @since 2.0
635
+ */
636
+ symbol: 'menu',
637
+ /**
638
+ * The key to a [lang](#lang) option setting that is used for the
639
+ * button's title tooltip. When the key is `contextButtonTitle`, it
640
+ * refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
641
+ * that defaults to "Chart context menu".
642
+ *
643
+ * @since 6.1.4
644
+ */
645
+ titleKey: 'contextButtonTitle',
646
+ /**
647
+ * This option is deprecated, use
648
+ * [titleKey](#exporting.buttons.contextButton.titleKey) instead.
649
+ *
650
+ * @deprecated
651
+ * @type {string}
652
+ * @apioption exporting.buttons.contextButton._titleKey
653
+ */
654
+ /**
655
+ * A collection of strings pointing to config options for the menu
656
+ * items. The config options are defined in the
657
+ * `menuItemDefinitions` option.
658
+ *
659
+ * By default, there is the "View in full screen" and "Print" menu
660
+ * items, plus one menu item for each of the available export types.
661
+ *
662
+ * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
663
+ * Menu item definitions
664
+ * @sample {highstock} highcharts/exporting/menuitemdefinitions/
665
+ * Menu item definitions
666
+ * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
667
+ * Menu item definitions
668
+ *
669
+ * @type {Array<string>}
670
+ * @default ["viewFullscreen", "printChart", "separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG"]
671
+ * @since 2.0
672
+ */
673
+ menuItems: [
674
+ 'viewFullscreen',
675
+ 'printChart',
676
+ 'separator',
677
+ 'downloadPNG',
678
+ 'downloadJPEG',
679
+ 'downloadPDF',
680
+ 'downloadSVG'
681
+ ]
682
+ }
683
+ },
684
+ /**
685
+ * An object consisting of definitions for the menu items in the context
686
+ * menu. Each key value pair has a `key` that is referenced in the
687
+ * [menuItems](#exporting.buttons.contextButton.menuItems) setting,
688
+ * and a `value`, which is an object with the following properties:
689
+ *
690
+ * - **onclick:** The click handler for the menu item
691
+ *
692
+ * - **text:** The text for the menu item
693
+ *
694
+ * - **textKey:** If internationalization is required, the key to a language
695
+ * string
696
+ *
697
+ * Custom text for the "exitFullScreen" can be set only in lang options
698
+ * (it is not a separate button).
699
+ *
700
+ * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
701
+ * Menu item definitions
702
+ * @sample {highstock} highcharts/exporting/menuitemdefinitions/
703
+ * Menu item definitions
704
+ * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
705
+ * Menu item definitions
706
+ *
707
+ *
708
+ * @type {Highcharts.Dictionary<Highcharts.ExportingMenuObject>}
709
+ * @default {"viewFullscreen": {}, "printChart": {}, "separator": {}, "downloadPNG": {}, "downloadJPEG": {}, "downloadPDF": {}, "downloadSVG": {}}
710
+ * @since 5.0.13
711
+ */
712
+ menuItemDefinitions: {
1021
713
  /**
1022
- * The key to a [lang](#lang) option setting that is used for the
1023
- * button's title tooltip. When the key is `contextButtonTitle`, it
1024
- * refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
1025
- * that defaults to "Chart context menu".
1026
- *
1027
- * @since 6.1.4
714
+ * @ignore
1028
715
  */
1029
- titleKey: 'contextButtonTitle',
1030
- /**
1031
- * This option is deprecated, use
1032
- * [titleKey](#exporting.buttons.contextButton.titleKey) instead.
1033
- *
1034
- * @deprecated
1035
- * @type {string}
1036
- * @apioption exporting.buttons.contextButton._titleKey
1037
- */
1038
- /**
1039
- * A collection of strings pointing to config options for the menu
1040
- * items. The config options are defined in the
1041
- * `menuItemDefinitions` option.
1042
- *
1043
- * By default, there is the "View in full screen" and "Print" menu
1044
- * items, plus one menu item for each of the available export types.
1045
- *
1046
- * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
1047
- * Menu item definitions
1048
- * @sample {highstock} highcharts/exporting/menuitemdefinitions/
1049
- * Menu item definitions
1050
- * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
1051
- * Menu item definitions
1052
- *
1053
- * @type {Array<string>}
1054
- * @default ["viewFullscreen", "printChart", "separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG"]
1055
- * @since 2.0
1056
- */
1057
- menuItems: [
1058
- 'viewFullscreen',
1059
- 'printChart',
1060
- 'separator',
1061
- 'downloadPNG',
1062
- 'downloadJPEG',
1063
- 'downloadPDF',
1064
- 'downloadSVG'
1065
- ]
1066
- }
1067
- },
1068
- /**
1069
- * An object consisting of definitions for the menu items in the context
1070
- * menu. Each key value pair has a `key` that is referenced in the
1071
- * [menuItems](#exporting.buttons.contextButton.menuItems) setting,
1072
- * and a `value`, which is an object with the following properties:
1073
- *
1074
- * - **onclick:** The click handler for the menu item
1075
- *
1076
- * - **text:** The text for the menu item
1077
- *
1078
- * - **textKey:** If internationalization is required, the key to a language
1079
- * string
1080
- *
1081
- * Custom text for the "exitFullScreen" can be set only in lang options
1082
- * (it is not a separate button).
1083
- *
1084
- * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
1085
- * Menu item definitions
1086
- * @sample {highstock} highcharts/exporting/menuitemdefinitions/
1087
- * Menu item definitions
1088
- * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
1089
- * Menu item definitions
1090
- *
1091
- *
1092
- * @type {Highcharts.Dictionary<Highcharts.ExportingMenuObject>}
1093
- * @default {"viewFullscreen": {}, "printChart": {}, "separator": {}, "downloadPNG": {}, "downloadJPEG": {}, "downloadPDF": {}, "downloadSVG": {}}
1094
- * @since 5.0.13
1095
- */
1096
- menuItemDefinitions: {
1097
- /**
1098
- * @ignore
1099
- */
1100
- viewFullscreen: {
1101
- textKey: 'viewFullscreen',
1102
- onclick: function () {
1103
- this.fullscreen.toggle();
716
+ viewFullscreen: {
717
+ textKey: 'viewFullscreen',
718
+ onclick: function () {
719
+ this.fullscreen.toggle();
1104
720
  }
1105
721
  },
1106
722
  /**
@@ -1162,418 +778,908 @@
1162
778
  }
1163
779
  }
1164
780
  };
781
+ // Add language
1165
782
  /**
1166
- * Fires after a chart is printed through the context menu item or the
1167
- * `Chart.print` method.
1168
- *
1169
- * @sample highcharts/chart/events-beforeprint-afterprint/
1170
- * Rescale the chart to print
1171
- *
1172
- * @type {Highcharts.ExportingAfterPrintCallbackFunction}
1173
- * @since 4.1.0
1174
- * @context Highcharts.Chart
1175
- * @requires modules/exporting
1176
- * @apioption chart.events.afterPrint
1177
- */
1178
- /**
1179
- * Fires before a chart is printed through the context menu item or
1180
- * the `Chart.print` method.
1181
- *
1182
- * @sample highcharts/chart/events-beforeprint-afterprint/
1183
- * Rescale the chart to print
1184
- *
1185
- * @type {Highcharts.ExportingBeforePrintCallbackFunction}
1186
- * @since 4.1.0
1187
- * @context Highcharts.Chart
1188
- * @requires modules/exporting
1189
- * @apioption chart.events.beforePrint
783
+ * @optionparent lang
1190
784
  */
785
+ var lang = {
786
+ /**
787
+ * Exporting module only. The text for the menu item to view the chart
788
+ * in full screen.
789
+ *
790
+ * @since 8.0.1
791
+ *
792
+ * @private
793
+ */
794
+ viewFullscreen: 'View in full screen',
795
+ /**
796
+ * Exporting module only. The text for the menu item to exit the chart
797
+ * from full screen.
798
+ *
799
+ * @since 8.0.1
800
+ *
801
+ * @private
802
+ */
803
+ exitFullscreen: 'Exit from full screen',
804
+ /**
805
+ * Exporting module only. The text for the menu item to print the chart.
806
+ *
807
+ * @since 3.0.1
808
+ * @requires modules/exporting
809
+ *
810
+ * @private
811
+ */
812
+ printChart: 'Print chart',
813
+ /**
814
+ * Exporting module only. The text for the PNG download menu item.
815
+ *
816
+ * @since 2.0
817
+ * @requires modules/exporting
818
+ *
819
+ * @private
820
+ */
821
+ downloadPNG: 'Download PNG image',
822
+ /**
823
+ * Exporting module only. The text for the JPEG download menu item.
824
+ *
825
+ * @since 2.0
826
+ * @requires modules/exporting
827
+ *
828
+ * @private
829
+ */
830
+ downloadJPEG: 'Download JPEG image',
831
+ /**
832
+ * Exporting module only. The text for the PDF download menu item.
833
+ *
834
+ * @since 2.0
835
+ * @requires modules/exporting
836
+ *
837
+ * @private
838
+ */
839
+ downloadPDF: 'Download PDF document',
840
+ /**
841
+ * Exporting module only. The text for the SVG download menu item.
842
+ *
843
+ * @since 2.0
844
+ * @requires modules/exporting
845
+ *
846
+ * @private
847
+ */
848
+ downloadSVG: 'Download SVG vector image',
849
+ /**
850
+ * Exporting module menu. The tooltip title for the context menu holding
851
+ * print and export menu items.
852
+ *
853
+ * @since 3.0
854
+ * @requires modules/exporting
855
+ *
856
+ * @private
857
+ */
858
+ contextButtonTitle: 'Chart context menu'
859
+ };
1191
860
  /**
1192
- * The post utility
861
+ * A collection of options for buttons and menus appearing in the exporting
862
+ * module.
1193
863
  *
1194
- * @private
1195
- * @function Highcharts.post
1196
- * @param {string} url
1197
- * Post URL
1198
- * @param {object} data
1199
- * Post data
1200
- * @param {Highcharts.Dictionary<string>} [formAttributes]
1201
- * Additional attributes for the post request
1202
- * @return {void}
864
+ * @optionparent navigation
1203
865
  */
1204
- H.post = function (url, data, formAttributes) {
1205
- // create the form
1206
- var form = createElement('form',
1207
- merge({
1208
- method: 'post',
1209
- action: url,
1210
- enctype: 'multipart/form-data'
866
+ var navigation = {
867
+ /**
868
+ * A collection of options for buttons appearing in the exporting
869
+ * module.
870
+ *
871
+ * In styled mode, the buttons are styled with the
872
+ * `.highcharts-contextbutton` and `.highcharts-button-symbol` classes.
873
+ *
874
+ * @requires modules/exporting
875
+ *
876
+ * @private
877
+ */
878
+ buttonOptions: {
879
+ /**
880
+ * Whether to enable buttons.
881
+ *
882
+ * @sample highcharts/navigation/buttonoptions-enabled/
883
+ * Exporting module loaded but buttons disabled
884
+ *
885
+ * @type {boolean}
886
+ * @default true
887
+ * @since 2.0
888
+ * @apioption navigation.buttonOptions.enabled
889
+ */
890
+ /**
891
+ * The pixel size of the symbol on the button.
892
+ *
893
+ * @sample highcharts/navigation/buttonoptions-height/
894
+ * Bigger buttons
895
+ *
896
+ * @since 2.0
897
+ */
898
+ symbolSize: 14,
899
+ /**
900
+ * The x position of the center of the symbol inside the button.
901
+ *
902
+ * @sample highcharts/navigation/buttonoptions-height/
903
+ * Bigger buttons
904
+ *
905
+ * @since 2.0
906
+ */
907
+ symbolX: 12.5,
908
+ /**
909
+ * The y position of the center of the symbol inside the button.
910
+ *
911
+ * @sample highcharts/navigation/buttonoptions-height/
912
+ * Bigger buttons
913
+ *
914
+ * @since 2.0
915
+ */
916
+ symbolY: 10.5,
917
+ /**
918
+ * Alignment for the buttons.
919
+ *
920
+ * @sample highcharts/navigation/buttonoptions-align/
921
+ * Center aligned
922
+ *
923
+ * @type {Highcharts.AlignValue}
924
+ * @since 2.0
925
+ */
926
+ align: 'right',
927
+ /**
928
+ * The pixel spacing between buttons.
929
+ *
930
+ * @since 2.0
931
+ */
932
+ buttonSpacing: 3,
933
+ /**
934
+ * Pixel height of the buttons.
935
+ *
936
+ * @sample highcharts/navigation/buttonoptions-height/
937
+ * Bigger buttons
938
+ *
939
+ * @since 2.0
940
+ */
941
+ height: 22,
942
+ /**
943
+ * A text string to add to the individual button.
944
+ *
945
+ * @sample highcharts/exporting/buttons-text/
946
+ * Full text button
947
+ * @sample highcharts/exporting/buttons-text-symbol/
948
+ * Combined symbol and text
949
+ *
950
+ * @type {string}
951
+ * @default null
952
+ * @since 3.0
953
+ * @apioption navigation.buttonOptions.text
954
+ */
955
+ /**
956
+ * The vertical offset of the button's position relative to its
957
+ * `verticalAlign`.
958
+ *
959
+ * @sample highcharts/navigation/buttonoptions-verticalalign/
960
+ * Buttons at lower right
961
+ *
962
+ * @type {number}
963
+ * @default 0
964
+ * @since 2.0
965
+ * @apioption navigation.buttonOptions.y
966
+ */
967
+ /**
968
+ * The vertical alignment of the buttons. Can be one of `"top"`,
969
+ * `"middle"` or `"bottom"`.
970
+ *
971
+ * @sample highcharts/navigation/buttonoptions-verticalalign/
972
+ * Buttons at lower right
973
+ *
974
+ * @type {Highcharts.VerticalAlignValue}
975
+ * @since 2.0
976
+ */
977
+ verticalAlign: 'top',
978
+ /**
979
+ * The pixel width of the button.
980
+ *
981
+ * @sample highcharts/navigation/buttonoptions-height/
982
+ * Bigger buttons
983
+ *
984
+ * @since 2.0
985
+ */
986
+ width: 24,
987
+ /**
988
+ * Fill color for the symbol within the button.
989
+ *
990
+ * @sample highcharts/navigation/buttonoptions-symbolfill/
991
+ * Blue symbol stroke for one of the buttons
992
+ *
993
+ * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
994
+ * @since 2.0
995
+ */
996
+ symbolFill: Palette.neutralColor60,
997
+ /**
998
+ * The color of the symbol's stroke or line.
999
+ *
1000
+ * @sample highcharts/navigation/buttonoptions-symbolstroke/
1001
+ * Blue symbol stroke
1002
+ *
1003
+ * @type {Highcharts.ColorString}
1004
+ * @since 2.0
1005
+ */
1006
+ symbolStroke: Palette.neutralColor60,
1007
+ /**
1008
+ * The pixel stroke width of the symbol on the button.
1009
+ *
1010
+ * @sample highcharts/navigation/buttonoptions-height/
1011
+ * Bigger buttons
1012
+ *
1013
+ * @since 2.0
1014
+ */
1015
+ symbolStrokeWidth: 3,
1016
+ /**
1017
+ * A configuration object for the button theme. The object accepts
1018
+ * SVG properties like `stroke-width`, `stroke` and `fill`.
1019
+ * Tri-state button styles are supported by the `states.hover` and
1020
+ * `states.select` objects.
1021
+ *
1022
+ * @sample highcharts/navigation/buttonoptions-theme/
1023
+ * Theming the buttons
1024
+ *
1025
+ * @requires modules/exporting
1026
+ *
1027
+ * @since 3.0
1028
+ */
1029
+ theme: {
1030
+ /**
1031
+ * The default fill exists only to capture hover events.
1032
+ *
1033
+ * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
1034
+ * @default ${palette.backgroundColor}
1035
+ * @apioption navigation.buttonOptions.theme.fill
1036
+ */
1037
+ /**
1038
+ * Default stroke for the buttons.
1039
+ * @type {Highcharts.ColorString}
1040
+ * @default none
1041
+ * @apioption navigation.buttonOptions.theme.stroke
1042
+ */
1043
+ /**
1044
+ * Padding for the button.
1045
+ */
1046
+ padding: 5
1047
+ }
1211
1048
  },
1212
- formAttributes), {
1213
- display: 'none'
1049
+ /**
1050
+ * CSS styles for the popup menu appearing by default when the export
1051
+ * icon is clicked. This menu is rendered in HTML.
1052
+ *
1053
+ * @see In styled mode, the menu is styled with the `.highcharts-menu`
1054
+ * class.
1055
+ *
1056
+ * @sample highcharts/navigation/menustyle/
1057
+ * Light gray menu background
1058
+ *
1059
+ * @type {Highcharts.CSSObject}
1060
+ * @default {"border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0"}
1061
+ * @since 2.0
1062
+ *
1063
+ * @private
1064
+ */
1065
+ menuStyle: {
1066
+ /** @ignore-option */
1067
+ border: "1px solid " + Palette.neutralColor40,
1068
+ /** @ignore-option */
1069
+ background: Palette.backgroundColor,
1070
+ /** @ignore-option */
1071
+ padding: '5px 0'
1214
1072
  },
1215
- doc.body);
1216
- // add the data
1217
- objectEach(data, function (val, name) {
1218
- createElement('input', {
1219
- type: 'hidden',
1220
- name: name,
1221
- value: val
1222
- }, null, form);
1223
- });
1224
- // submit
1225
- form.submit();
1226
- // clean up
1227
- discardElement(form);
1228
- };
1229
- if (H.isSafari) {
1230
- H.win.matchMedia('print').addListener(function (mqlEvent) {
1231
- if (!H.printingChart) {
1232
- return void 0;
1233
- }
1234
- if (mqlEvent.matches) {
1235
- H.printingChart.beforePrint();
1236
- }
1237
- else {
1238
- H.printingChart.afterPrint();
1073
+ /**
1074
+ * CSS styles for the individual items within the popup menu appearing
1075
+ * by default when the export icon is clicked. The menu items are
1076
+ * rendered in HTML. Font size defaults to `11px` on desktop and `14px`
1077
+ * on touch devices.
1078
+ *
1079
+ * @see In styled mode, the menu items are styled with the
1080
+ * `.highcharts-menu-item` class.
1081
+ *
1082
+ * @sample {highcharts} highcharts/navigation/menuitemstyle/
1083
+ * Add a grey stripe to the left
1084
+ *
1085
+ * @type {Highcharts.CSSObject}
1086
+ * @default {"padding": "0.5em 1em", "color": "#333333", "background": "none", "fontSize": "11px/14px", "transition": "background 250ms, color 250ms"}
1087
+ * @since 2.0
1088
+ *
1089
+ * @private
1090
+ */
1091
+ menuItemStyle: {
1092
+ /** @ignore-option */
1093
+ padding: '0.5em 1em',
1094
+ /** @ignore-option */
1095
+ color: Palette.neutralColor80,
1096
+ /** @ignore-option */
1097
+ background: 'none',
1098
+ /** @ignore-option */
1099
+ fontSize: isTouchDevice ? '14px' : '11px',
1100
+ /** @ignore-option */
1101
+ transition: 'background 250ms, color 250ms'
1102
+ },
1103
+ /**
1104
+ * CSS styles for the hover state of the individual items within the
1105
+ * popup menu appearing by default when the export icon is clicked. The
1106
+ * menu items are rendered in HTML.
1107
+ *
1108
+ * @see In styled mode, the menu items are styled with the
1109
+ * `.highcharts-menu-item` class.
1110
+ *
1111
+ * @sample highcharts/navigation/menuitemhoverstyle/
1112
+ * Bold text on hover
1113
+ *
1114
+ * @type {Highcharts.CSSObject}
1115
+ * @default {"background": "#335cad", "color": "#ffffff"}
1116
+ * @since 2.0
1117
+ *
1118
+ * @private
1119
+ */
1120
+ menuItemHoverStyle: {
1121
+ /** @ignore-option */
1122
+ background: Palette.highlightColor80,
1123
+ /** @ignore-option */
1124
+ color: Palette.backgroundColor
1239
1125
  }
1240
- });
1241
- }
1242
- extend(Chart.prototype, /** @lends Highcharts.Chart.prototype */ {
1243
- /* eslint-disable no-invalid-this, valid-jsdoc */
1244
- /**
1245
- * Exporting module only. A collection of fixes on the produced SVG to
1246
- * account for expando properties, browser bugs, VML problems and other.
1247
- * Returns a cleaned SVG.
1248
- *
1249
- * @private
1250
- * @function Highcharts.Chart#sanitizeSVG
1251
- * @param {string} svg
1252
- * SVG code to sanitize
1253
- * @param {Highcharts.Options} options
1254
- * Chart options to apply
1255
- * @return {string}
1256
- * Sanitized SVG code
1257
- * @requires modules/exporting
1258
- */
1259
- sanitizeSVG: function (svg, options) {
1260
- var split = svg.indexOf('</svg>') + 6,
1261
- html = svg.substr(split);
1262
- // Remove any HTML added to the container after the SVG (#894, #9087)
1263
- svg = svg.substr(0, split);
1264
- // Move HTML into a foreignObject
1265
- if (options && options.exporting && options.exporting.allowHTML) {
1266
- if (html) {
1267
- html = '<foreignObject x="0" y="0" ' +
1268
- 'width="' + options.chart.width + '" ' +
1269
- 'height="' + options.chart.height + '">' +
1270
- '<body xmlns="http://www.w3.org/1999/xhtml">' +
1271
- // Some tags needs to be closed in xhtml (#13726)
1272
- html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
1273
- '</body>' +
1274
- '</foreignObject>';
1275
- svg = svg.replace('</svg>', html + '</svg>');
1276
- }
1277
- }
1278
- svg = svg
1279
- .replace(/zIndex="[^"]+"/g, '')
1280
- .replace(/symbolName="[^"]+"/g, '')
1281
- .replace(/jQuery[0-9]+="[^"]+"/g, '')
1282
- .replace(/url\(("|&quot;)(.*?)("|&quot;)\;?\)/g, 'url($2)')
1283
- .replace(/url\([^#]+#/g, 'url(#')
1284
- .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
1285
- .replace(/ (|NS[0-9]+\:)href=/g, ' xlink:href=') // #3567
1286
- .replace(/\n/, ' ')
1287
- // Batik doesn't support rgba fills and strokes (#3095)
1288
- .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, // eslint-disable-line max-len
1289
- '$1="rgb($2)" $1-opacity="$3"')
1290
- // Replace HTML entities, issue #347
1291
- .replace(/&nbsp;/g, '\u00A0') // no-break space
1292
- .replace(/&shy;/g, '\u00AD'); // soft hyphen
1293
- // Further sanitize for oldIE
1294
- if (this.ieSanitizeSVG) {
1295
- svg = this.ieSanitizeSVG(svg);
1296
- }
1297
- return svg;
1298
- },
1299
- /**
1300
- * Return the unfiltered innerHTML of the chart container. Used as hook for
1301
- * plugins. In styled mode, it also takes care of inlining CSS style rules.
1126
+ };
1127
+ /* *
1128
+ *
1129
+ * Default Export
1130
+ *
1131
+ * */
1132
+ var ExportingDefaults = {
1133
+ exporting: exporting,
1134
+ lang: lang,
1135
+ navigation: navigation
1136
+ };
1137
+
1138
+ return ExportingDefaults;
1139
+ });
1140
+ _registerModule(_modules, 'Extensions/Exporting/ExportingSymbols.js', [], function () {
1141
+ /* *
1142
+ *
1143
+ * Exporting module
1144
+ *
1145
+ * (c) 2010-2021 Torstein Honsi
1146
+ *
1147
+ * License: www.highcharts.com/license
1148
+ *
1149
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1150
+ *
1151
+ * */
1152
+ /* *
1153
+ *
1154
+ * Composition
1155
+ *
1156
+ * */
1157
+ var ExportingSymbols;
1158
+ (function (ExportingSymbols) {
1159
+ /* *
1302
1160
  *
1303
- * @see Chart#getSVG
1161
+ * Constants
1304
1162
  *
1305
- * @function Highcharts.Chart#getChartHTML
1163
+ * */
1164
+ var modifiedClasses = [];
1165
+ /* *
1306
1166
  *
1307
- * @returns {string}
1308
- * The unfiltered SVG of the chart.
1167
+ * Functions
1309
1168
  *
1310
- * @requires modules/exporting
1169
+ * */
1170
+ /* eslint-disable valid-jsdoc */
1171
+ /**
1172
+ * @private
1311
1173
  */
1312
- getChartHTML: function () {
1313
- if (this.styledMode) {
1314
- this.inlineStyles();
1174
+ function compose(SVGRendererClass) {
1175
+ if (modifiedClasses.indexOf(SVGRendererClass) === -1) {
1176
+ modifiedClasses.push(SVGRendererClass);
1177
+ var symbols = SVGRendererClass.prototype.symbols;
1178
+ symbols.menu = menu;
1179
+ symbols.menuball = menuball.bind(symbols);
1315
1180
  }
1316
- return this.container.innerHTML;
1317
- },
1181
+ }
1182
+ ExportingSymbols.compose = compose;
1318
1183
  /**
1319
- * Return an SVG representation of the chart.
1184
+ * @private
1185
+ */
1186
+ function menu(x, y, width, height) {
1187
+ var arr = [
1188
+ ['M',
1189
+ x,
1190
+ y + 2.5],
1191
+ ['L',
1192
+ x + width,
1193
+ y + 2.5],
1194
+ ['M',
1195
+ x,
1196
+ y + height / 2 + 0.5],
1197
+ ['L',
1198
+ x + width,
1199
+ y + height / 2 + 0.5],
1200
+ ['M',
1201
+ x,
1202
+ y + height - 1.5],
1203
+ ['L',
1204
+ x + width,
1205
+ y + height - 1.5]
1206
+ ];
1207
+ return arr;
1208
+ }
1209
+ /**
1210
+ * @private
1211
+ */
1212
+ function menuball(x, y, width, height) {
1213
+ var h = (height / 3) - 2;
1214
+ var path = [];
1215
+ path = path.concat(this.circle(width - h, y, h, h), this.circle(width - h, y + h + 4, h, h), this.circle(width - h, y + 2 * (h + 4), h, h));
1216
+ return path;
1217
+ }
1218
+ })(ExportingSymbols || (ExportingSymbols = {}));
1219
+ /* *
1220
+ *
1221
+ * Default Export
1222
+ *
1223
+ * */
1224
+
1225
+ return ExportingSymbols;
1226
+ });
1227
+ _registerModule(_modules, 'Core/HttpUtilities.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (G, U) {
1228
+ /* *
1229
+ *
1230
+ * (c) 2010-2021 Christer Vasseng, Torstein Honsi
1231
+ *
1232
+ * License: www.highcharts.com/license
1233
+ *
1234
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1235
+ *
1236
+ * */
1237
+ var doc = G.doc;
1238
+ var createElement = U.createElement,
1239
+ discardElement = U.discardElement,
1240
+ merge = U.merge,
1241
+ objectEach = U.objectEach;
1242
+ /**
1243
+ * Perform an Ajax call.
1244
+ *
1245
+ * @function Highcharts.ajax
1246
+ *
1247
+ * @param {Partial<Highcharts.AjaxSettingsObject>} attr
1248
+ * The Ajax settings to use.
1249
+ *
1250
+ * @return {false|undefined}
1251
+ * Returns false, if error occured.
1252
+ */
1253
+ function ajax(attr) {
1254
+ var options = merge(true, {
1255
+ url: false,
1256
+ type: 'get',
1257
+ dataType: 'json',
1258
+ success: false,
1259
+ error: false,
1260
+ data: false,
1261
+ headers: {}
1262
+ },
1263
+ attr),
1264
+ headers = {
1265
+ json: 'application/json',
1266
+ xml: 'application/xml',
1267
+ text: 'text/plain',
1268
+ octet: 'application/octet-stream'
1269
+ },
1270
+ r = new XMLHttpRequest();
1271
+ /**
1272
+ * @private
1273
+ * @param {XMLHttpRequest} xhr - Internal request object.
1274
+ * @param {string|Error} err - Occured error.
1275
+ * @return {void}
1276
+ */
1277
+ function handleError(xhr, err) {
1278
+ if (options.error) {
1279
+ options.error(xhr, err);
1280
+ }
1281
+ else {
1282
+ // @todo Maybe emit a highcharts error event here
1283
+ }
1284
+ }
1285
+ if (!options.url) {
1286
+ return false;
1287
+ }
1288
+ r.open(options.type.toUpperCase(), options.url, true);
1289
+ if (!options.headers['Content-Type']) {
1290
+ r.setRequestHeader('Content-Type', headers[options.dataType] || headers.text);
1291
+ }
1292
+ objectEach(options.headers, function (val, key) {
1293
+ r.setRequestHeader(key, val);
1294
+ });
1295
+ // @todo lacking timeout handling
1296
+ r.onreadystatechange = function () {
1297
+ var res;
1298
+ if (r.readyState === 4) {
1299
+ if (r.status === 200) {
1300
+ res = r.responseText;
1301
+ if (options.dataType === 'json') {
1302
+ try {
1303
+ res = JSON.parse(res);
1304
+ }
1305
+ catch (e) {
1306
+ return handleError(r, e);
1307
+ }
1308
+ }
1309
+ return options.success && options.success(res);
1310
+ }
1311
+ handleError(r, r.responseText);
1312
+ }
1313
+ };
1314
+ try {
1315
+ options.data = JSON.stringify(options.data);
1316
+ }
1317
+ catch (e) {
1318
+ // empty
1319
+ }
1320
+ r.send(options.data || true);
1321
+ }
1322
+ /**
1323
+ * Get a JSON resource over XHR, also supporting CORS without preflight.
1324
+ *
1325
+ * @function Highcharts.getJSON
1326
+ * @param {string} url
1327
+ * The URL to load.
1328
+ * @param {Function} success
1329
+ * The success callback. For error handling, use the `Highcharts.ajax`
1330
+ * function instead.
1331
+ */
1332
+ function getJSON(url, success) {
1333
+ exports.ajax({
1334
+ url: url,
1335
+ success: success,
1336
+ dataType: 'json',
1337
+ headers: {
1338
+ // Override the Content-Type to avoid preflight problems with CORS
1339
+ // in the Highcharts demos
1340
+ 'Content-Type': 'text/plain'
1341
+ }
1342
+ });
1343
+ }
1344
+ /**
1345
+ * The post utility
1346
+ *
1347
+ * @private
1348
+ * @function Highcharts.post
1349
+ *
1350
+ * @param {string} url
1351
+ * Post URL
1352
+ *
1353
+ * @param {object} data
1354
+ * Post data
1355
+ *
1356
+ * @param {Highcharts.Dictionary<string>} [formAttributes]
1357
+ * Additional attributes for the post request
1358
+ */
1359
+ function post(url, data, formAttributes) {
1360
+ // create the form
1361
+ var form = createElement('form',
1362
+ merge({
1363
+ method: 'post',
1364
+ action: url,
1365
+ enctype: 'multipart/form-data'
1366
+ },
1367
+ formAttributes), {
1368
+ display: 'none'
1369
+ },
1370
+ doc.body);
1371
+ // add the data
1372
+ objectEach(data, function (val, name) {
1373
+ createElement('input', {
1374
+ type: 'hidden',
1375
+ name: name,
1376
+ value: val
1377
+ }, null, form);
1378
+ });
1379
+ // submit
1380
+ form.submit();
1381
+ // clean up
1382
+ discardElement(form);
1383
+ }
1384
+ /* *
1385
+ *
1386
+ * Default Export
1387
+ *
1388
+ * */
1389
+ var exports = {
1390
+ ajax: ajax,
1391
+ getJSON: getJSON,
1392
+ post: post
1393
+ };
1394
+ /**
1395
+ * @interface Highcharts.AjaxSettingsObject
1396
+ */ /**
1397
+ * The payload to send.
1398
+ *
1399
+ * @name Highcharts.AjaxSettingsObject#data
1400
+ * @type {string|Highcharts.Dictionary<any>}
1401
+ */ /**
1402
+ * The data type expected.
1403
+ * @name Highcharts.AjaxSettingsObject#dataType
1404
+ * @type {"json"|"xml"|"text"|"octet"}
1405
+ */ /**
1406
+ * Function to call on error.
1407
+ * @name Highcharts.AjaxSettingsObject#error
1408
+ * @type {Function}
1409
+ */ /**
1410
+ * The headers; keyed on header name.
1411
+ * @name Highcharts.AjaxSettingsObject#headers
1412
+ * @type {Highcharts.Dictionary<string>}
1413
+ */ /**
1414
+ * Function to call on success.
1415
+ * @name Highcharts.AjaxSettingsObject#success
1416
+ * @type {Function}
1417
+ */ /**
1418
+ * The HTTP method to use. For example GET or POST.
1419
+ * @name Highcharts.AjaxSettingsObject#type
1420
+ * @type {string}
1421
+ */ /**
1422
+ * The URL to call.
1423
+ * @name Highcharts.AjaxSettingsObject#url
1424
+ * @type {string}
1425
+ */
1426
+ (''); // keeps doclets above in JS file
1427
+
1428
+ return exports;
1429
+ });
1430
+ _registerModule(_modules, 'Extensions/Exporting/Exporting.js', [_modules['Core/Renderer/HTML/AST.js'], _modules['Core/Chart/Chart.js'], _modules['Mixins/Navigation.js'], _modules['Core/DefaultOptions.js'], _modules['Extensions/Exporting/ExportingDefaults.js'], _modules['Extensions/Exporting/ExportingSymbols.js'], _modules['Core/Globals.js'], _modules['Core/HttpUtilities.js'], _modules['Core/Color/Palette.js'], _modules['Core/Utilities.js']], function (AST, Chart, chartNavigationMixin, D, ExportingDefaults, ExportingSymbols, G, HU, Palette, U) {
1431
+ /* *
1432
+ *
1433
+ * Exporting module
1434
+ *
1435
+ * (c) 2010-2021 Torstein Honsi
1436
+ *
1437
+ * License: www.highcharts.com/license
1438
+ *
1439
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1440
+ *
1441
+ * */
1442
+ var defaultOptions = D.defaultOptions;
1443
+ var doc = G.doc,
1444
+ win = G.win;
1445
+ var addEvent = U.addEvent,
1446
+ css = U.css,
1447
+ createElement = U.createElement,
1448
+ discardElement = U.discardElement,
1449
+ extend = U.extend,
1450
+ find = U.find,
1451
+ fireEvent = U.fireEvent,
1452
+ isObject = U.isObject,
1453
+ merge = U.merge,
1454
+ objectEach = U.objectEach,
1455
+ pick = U.pick,
1456
+ removeEvent = U.removeEvent,
1457
+ uniqueKey = U.uniqueKey;
1458
+ /* *
1459
+ *
1460
+ * Composition
1461
+ *
1462
+ * */
1463
+ var Exporting;
1464
+ (function (Exporting) {
1465
+ /* *
1320
1466
  *
1321
- * @sample highcharts/members/chart-getsvg/
1322
- * View the SVG from a button
1467
+ * Declarations
1323
1468
  *
1324
- * @function Highcharts.Chart#getSVG
1469
+ * */
1470
+ /* *
1325
1471
  *
1326
- * @param {Highcharts.Options} [chartOptions]
1327
- * Additional chart options for the generated SVG representation. For
1328
- * collections like `xAxis`, `yAxis` or `series`, the additional
1329
- * options is either merged in to the original item of the same
1330
- * `id`, or to the first item if a common id is not found.
1472
+ * Constants
1331
1473
  *
1332
- * @return {string}
1333
- * The SVG representation of the rendered chart.
1474
+ * */
1475
+ var composedClasses = [];
1476
+ // These CSS properties are not inlined. Remember camelCase.
1477
+ var inlineBlacklist = [
1478
+ /-/,
1479
+ /^(clipPath|cssText|d|height|width)$/,
1480
+ /^font$/,
1481
+ /[lL]ogical(Width|Height)$/,
1482
+ /perspective/,
1483
+ /TapHighlightColor/,
1484
+ /^transition/,
1485
+ /^length$/ // #7700
1486
+ // /^text (border|color|cursor|height|webkitBorder)/
1487
+ ];
1488
+ // These ones are translated to attributes rather than styles
1489
+ var inlineToAttributes = [
1490
+ 'fill',
1491
+ 'stroke',
1492
+ 'strokeLinecap',
1493
+ 'strokeLinejoin',
1494
+ 'strokeWidth',
1495
+ 'textAnchor',
1496
+ 'x',
1497
+ 'y'
1498
+ ];
1499
+ Exporting.inlineWhitelist = [];
1500
+ var unstyledElements = [
1501
+ 'clipPath',
1502
+ 'defs',
1503
+ 'desc'
1504
+ ];
1505
+ /* *
1334
1506
  *
1335
- * @fires Highcharts.Chart#event:getSVG
1507
+ * Variables
1508
+ *
1509
+ * */
1510
+ var printingChart;
1511
+ /* *
1512
+ *
1513
+ * Functions
1336
1514
  *
1515
+ * */
1516
+ /* eslint-disable valid-jsdoc */
1517
+ /**
1518
+ * Add the export button to the chart, with options.
1519
+ *
1520
+ * @private
1521
+ * @function Highcharts.Chart#addButton
1522
+ * @param {Highcharts.NavigationButtonOptions} options
1523
+ * @return {void}
1337
1524
  * @requires modules/exporting
1338
1525
  */
1339
- getSVG: function (chartOptions) {
1526
+ function addButton(options) {
1340
1527
  var chart = this,
1341
- chartCopy,
1342
- sandbox,
1343
- svg,
1344
- seriesOptions,
1345
- sourceWidth,
1346
- sourceHeight,
1347
- cssWidth,
1348
- cssHeight,
1349
- // Copy the options and add extra options
1350
- options = merge(chart.options,
1351
- chartOptions);
1352
- // Use userOptions to make the options chain in series right (#3881)
1353
- options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions && chartOptions.plotOptions);
1354
- // ... and likewise with time, avoid that undefined time properties are
1355
- // merged over legacy global time options
1356
- options.time = merge(chart.userOptions.time, chartOptions && chartOptions.time);
1357
- // create a sandbox where a new chart will be generated
1358
- sandbox = createElement('div', null, {
1359
- position: 'absolute',
1360
- top: '-9999em',
1361
- width: chart.chartWidth + 'px',
1362
- height: chart.chartHeight + 'px'
1363
- }, doc.body);
1364
- // get the source size
1365
- cssWidth = chart.renderTo.style.width;
1366
- cssHeight = chart.renderTo.style.height;
1367
- sourceWidth = options.exporting.sourceWidth ||
1368
- options.chart.width ||
1369
- (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
1370
- (options.isGantt ? 800 : 600);
1371
- sourceHeight = options.exporting.sourceHeight ||
1372
- options.chart.height ||
1373
- (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
1374
- 400;
1375
- // override some options
1376
- extend(options.chart, {
1377
- animation: false,
1378
- renderTo: sandbox,
1379
- forExport: true,
1380
- renderer: 'SVGRenderer',
1381
- width: sourceWidth,
1382
- height: sourceHeight
1383
- });
1384
- options.exporting.enabled = false; // hide buttons in print
1385
- delete options.data; // #3004
1386
- // prepare for replicating the chart
1387
- options.series = [];
1388
- chart.series.forEach(function (serie) {
1389
- seriesOptions = merge(serie.userOptions, {
1390
- animation: false,
1391
- enableMouseTracking: false,
1392
- showCheckbox: false,
1393
- visible: serie.visible
1394
- });
1395
- // Used for the navigator series that has its own option set
1396
- if (!seriesOptions.isInternal) {
1397
- options.series.push(seriesOptions);
1398
- }
1399
- });
1400
- var colls = {};
1401
- chart.axes.forEach(function (axis) {
1402
- // Assign an internal key to ensure a one-to-one mapping (#5924)
1403
- if (!axis.userOptions.internalKey) { // #6444
1404
- axis.userOptions.internalKey = uniqueKey();
1405
- }
1406
- if (!axis.options.isInternal) {
1407
- if (!colls[axis.coll]) {
1408
- colls[axis.coll] = true;
1409
- options[axis.coll] = [];
1528
+ renderer = chart.renderer,
1529
+ btnOptions = merge(chart.options.navigation.buttonOptions,
1530
+ options),
1531
+ onclick = btnOptions.onclick,
1532
+ menuItems = btnOptions.menuItems,
1533
+ symbolSize = btnOptions.symbolSize || 12;
1534
+ var symbol;
1535
+ if (!chart.btnCount) {
1536
+ chart.btnCount = 0;
1537
+ }
1538
+ // Keeps references to the button elements
1539
+ if (!chart.exportDivElements) {
1540
+ chart.exportDivElements = [];
1541
+ chart.exportSVGElements = [];
1542
+ }
1543
+ if (btnOptions.enabled === false || !btnOptions.theme) {
1544
+ return;
1545
+ }
1546
+ var attr = btnOptions.theme,
1547
+ states = attr.states,
1548
+ hover = states && states.hover,
1549
+ select = states && states.select;
1550
+ var callback;
1551
+ if (!chart.styledMode) {
1552
+ attr.fill = pick(attr.fill, Palette.backgroundColor);
1553
+ attr.stroke = pick(attr.stroke, 'none');
1554
+ }
1555
+ delete attr.states;
1556
+ if (onclick) {
1557
+ callback = function (e) {
1558
+ if (e) {
1559
+ e.stopPropagation();
1410
1560
  }
1411
- options[axis.coll].push(merge(axis.userOptions, {
1412
- visible: axis.visible
1413
- }));
1414
- }
1415
- });
1416
- // generate the chart copy
1417
- chartCopy = new Chart(options, chart.callback);
1418
- // Axis options and series options (#2022, #3900, #5982)
1419
- if (chartOptions) {
1420
- ['xAxis', 'yAxis', 'series'].forEach(function (coll) {
1421
- var collOptions = {};
1422
- if (chartOptions[coll]) {
1423
- collOptions[coll] = chartOptions[coll];
1424
- chartCopy.update(collOptions);
1561
+ onclick.call(chart, e);
1562
+ };
1563
+ }
1564
+ else if (menuItems) {
1565
+ callback = function (e) {
1566
+ // consistent with onclick call (#3495)
1567
+ if (e) {
1568
+ e.stopPropagation();
1425
1569
  }
1570
+ chart.contextMenu(button.menuClassName, menuItems, button.translateX, button.translateY, button.width, button.height, button);
1571
+ button.setState(2);
1572
+ };
1573
+ }
1574
+ if (btnOptions.text && btnOptions.symbol) {
1575
+ attr.paddingLeft = pick(attr.paddingLeft, 30);
1576
+ }
1577
+ else if (!btnOptions.text) {
1578
+ extend(attr, {
1579
+ width: btnOptions.width,
1580
+ height: btnOptions.height,
1581
+ padding: 0
1426
1582
  });
1427
1583
  }
1428
- // Reflect axis extremes in the export (#5924)
1429
- chart.axes.forEach(function (axis) {
1430
- var axisCopy = find(chartCopy.axes,
1431
- function (copy) {
1432
- return copy.options.internalKey ===
1433
- axis.userOptions.internalKey;
1434
- }), extremes = axis.getExtremes(), userMin = extremes.userMin, userMax = extremes.userMax;
1435
- if (axisCopy &&
1436
- ((typeof userMin !== 'undefined' &&
1437
- userMin !== axisCopy.min) || (typeof userMax !== 'undefined' &&
1438
- userMax !== axisCopy.max))) {
1439
- axisCopy.setExtremes(userMin, userMax, true, false);
1440
- }
1441
- });
1442
- // Get the SVG from the container's innerHTML
1443
- svg = chartCopy.getChartHTML();
1444
- fireEvent(this, 'getSVG', { chartCopy: chartCopy });
1445
- svg = chart.sanitizeSVG(svg, options);
1446
- // free up memory
1447
- options = null;
1448
- chartCopy.destroy();
1449
- discardElement(sandbox);
1450
- return svg;
1451
- },
1452
- /**
1453
- * @private
1454
- * @function Highcharts.Chart#getSVGForExport
1455
- * @param {Highcharts.ExportingOptions} options
1456
- * @param {Highcharts.Options} chartOptions
1457
- * @return {string}
1458
- * @requires modules/exporting
1459
- */
1460
- getSVGForExport: function (options, chartOptions) {
1461
- var chartExportingOptions = this.options.exporting;
1462
- return this.getSVG(merge({ chart: { borderRadius: 0 } }, chartExportingOptions.chartOptions, chartOptions, {
1463
- exporting: {
1464
- sourceWidth: ((options && options.sourceWidth) ||
1465
- chartExportingOptions.sourceWidth),
1466
- sourceHeight: ((options && options.sourceHeight) ||
1467
- chartExportingOptions.sourceHeight)
1584
+ if (!chart.styledMode) {
1585
+ attr['stroke-linecap'] = 'round';
1586
+ attr.fill = pick(attr.fill, Palette.backgroundColor);
1587
+ attr.stroke = pick(attr.stroke, 'none');
1588
+ }
1589
+ var button = renderer
1590
+ .button(btnOptions.text, 0, 0,
1591
+ callback,
1592
+ attr,
1593
+ hover,
1594
+ select)
1595
+ .addClass(options.className)
1596
+ .attr({
1597
+ title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
1598
+ });
1599
+ button.menuClassName = (options.menuClassName ||
1600
+ 'highcharts-menu-' + chart.btnCount++);
1601
+ if (btnOptions.symbol) {
1602
+ symbol = renderer
1603
+ .symbol(btnOptions.symbol, btnOptions.symbolX - (symbolSize / 2), btnOptions.symbolY - (symbolSize / 2), symbolSize, symbolSize
1604
+ // If symbol is an image, scale it (#7957)
1605
+ , {
1606
+ width: symbolSize,
1607
+ height: symbolSize
1608
+ })
1609
+ .addClass('highcharts-button-symbol')
1610
+ .attr({
1611
+ zIndex: 1
1612
+ })
1613
+ .add(button);
1614
+ if (!chart.styledMode) {
1615
+ symbol.attr({
1616
+ stroke: btnOptions.symbolStroke,
1617
+ fill: btnOptions.symbolFill,
1618
+ 'stroke-width': btnOptions.symbolStrokeWidth || 1
1619
+ });
1468
1620
  }
1469
- }));
1470
- },
1621
+ }
1622
+ button
1623
+ .add(chart.exportingGroup)
1624
+ .align(extend(btnOptions, {
1625
+ width: button.width,
1626
+ x: pick(btnOptions.x, chart.buttonOffset) // #1654
1627
+ }), true, 'spacingBox');
1628
+ chart.buttonOffset += ((button.width + btnOptions.buttonSpacing) *
1629
+ (btnOptions.align === 'right' ? -1 : 1));
1630
+ chart.exportSVGElements.push(button, symbol);
1631
+ }
1471
1632
  /**
1472
- * Get the default file name used for exported charts. By default it creates
1473
- * a file name based on the chart title.
1633
+ * Clena up after printing a chart.
1474
1634
  *
1475
- * @function Highcharts.Chart#getFilename
1635
+ * @function Highcharts#afterPrint
1476
1636
  *
1477
- * @return {string} A file name without extension.
1637
+ * @private
1478
1638
  *
1479
- * @requires modules/exporting
1639
+ * @param {Highcharts.Chart} chart
1640
+ * Chart that was (or suppose to be) printed
1641
+ * @return {void}
1642
+ *
1643
+ * @fires Highcharts.Chart#event:afterPrint
1480
1644
  */
1481
- getFilename: function () {
1482
- var s = this.userOptions.title && this.userOptions.title.text,
1483
- filename = this.options.exporting.filename;
1484
- if (filename) {
1485
- return filename.replace(/\//g, '-');
1486
- }
1487
- if (typeof s === 'string') {
1488
- filename = s
1489
- .toLowerCase()
1490
- .replace(/<\/?[^>]+(>|$)/g, '') // strip HTML tags
1491
- .replace(/[\s_]+/g, '-')
1492
- .replace(/[^a-z0-9\-]/g, '') // preserve only latin
1493
- .replace(/^[\-]+/g, '') // dashes in the start
1494
- .replace(/[\-]+/g, '-') // dashes in a row
1495
- .substr(0, 24)
1496
- .replace(/[\-]+$/g, ''); // dashes in the end;
1645
+ function afterPrint() {
1646
+ var chart = this;
1647
+ if (!chart.printReverseInfo) {
1648
+ return void 0;
1497
1649
  }
1498
- if (!filename || filename.length < 5) {
1499
- filename = 'chart';
1650
+ var _a = chart.printReverseInfo,
1651
+ childNodes = _a.childNodes,
1652
+ origDisplay = _a.origDisplay,
1653
+ resetParams = _a.resetParams;
1654
+ // put the chart back in
1655
+ chart.moveContainers(chart.renderTo);
1656
+ // restore all body content
1657
+ [].forEach.call(childNodes, function (node, i) {
1658
+ if (node.nodeType === 1) {
1659
+ node.style.display = (origDisplay[i] || '');
1660
+ }
1661
+ });
1662
+ chart.isPrinting = false;
1663
+ // Reset printMaxWidth
1664
+ if (resetParams) {
1665
+ chart.setSize.apply(chart, resetParams);
1500
1666
  }
1501
- return filename;
1502
- },
1667
+ delete chart.printReverseInfo;
1668
+ printingChart = void 0;
1669
+ fireEvent(chart, 'afterPrint');
1670
+ }
1503
1671
  /**
1504
- * Exporting module required. Submit an SVG version of the chart to a server
1505
- * along with some parameters for conversion.
1506
- *
1507
- * @sample highcharts/members/chart-exportchart/
1508
- * Export with no options
1509
- * @sample highcharts/members/chart-exportchart-filename/
1510
- * PDF type and custom filename
1511
- * @sample highcharts/members/chart-exportchart-custom-background/
1512
- * Different chart background in export
1513
- * @sample stock/members/chart-exportchart/
1514
- * Export with Highcharts Stock
1515
- *
1516
- * @function Highcharts.Chart#exportChart
1672
+ * Prepare chart and document before printing a chart.
1517
1673
  *
1518
- * @param {Highcharts.ExportingOptions} exportingOptions
1519
- * Exporting options in addition to those defined in
1520
- * [exporting](https://api.highcharts.com/highcharts/exporting).
1674
+ * @function Highcharts#beforePrint
1521
1675
  *
1522
- * @param {Highcharts.Options} chartOptions
1523
- * Additional chart options for the exported chart. For example a
1524
- * different background color can be added here, or `dataLabels` for
1525
- * export only.
1676
+ * @private
1526
1677
  *
1527
1678
  * @return {void}
1528
1679
  *
1529
- * @requires modules/exporting
1680
+ * @fires Highcharts.Chart#event:beforePrint
1530
1681
  */
1531
- exportChart: function (exportingOptions, chartOptions) {
1532
- var svg = this.getSVGForExport(exportingOptions,
1533
- chartOptions);
1534
- // merge the options
1535
- exportingOptions = merge(this.options.exporting, exportingOptions);
1536
- // do the post
1537
- H.post(exportingOptions.url, {
1538
- filename: exportingOptions.filename ? exportingOptions.filename.replace(/\//g, '-') : this.getFilename(),
1539
- type: exportingOptions.type,
1540
- // IE8 fails to post undefined correctly, so use 0
1541
- width: exportingOptions.width || 0,
1542
- scale: exportingOptions.scale,
1543
- svg: svg
1544
- }, exportingOptions.formAttributes);
1545
- },
1546
- /**
1547
- * Move the chart container(s) to another div.
1548
- *
1549
- * @function Highcharts#moveContainers
1550
- *
1551
- * @private
1552
- *
1553
- * @param {Highcharts.HTMLDOMElement} moveTo
1554
- * Move target
1555
- * @return {void}
1556
- */
1557
- moveContainers: function (moveTo) {
1558
- var chart = this;
1559
- (chart.fixedDiv ? // When scrollablePlotArea is active (#9533)
1560
- [chart.fixedDiv, chart.scrollingContainer] :
1561
- [chart.container]).forEach(function (div) {
1562
- moveTo.appendChild(div);
1563
- });
1564
- },
1565
- /**
1566
- * Prepare chart and document before printing a chart.
1567
- *
1568
- * @function Highcharts#beforePrint
1569
- *
1570
- * @private
1571
- *
1572
- * @return {void}
1573
- *
1574
- * @fires Highcharts.Chart#event:beforePrint
1575
- */
1576
- beforePrint: function () {
1682
+ function beforePrint() {
1577
1683
  var chart = this,
1578
1684
  body = doc.body,
1579
1685
  printMaxWidth = chart.options.exporting.printMaxWidth,
@@ -1582,12 +1688,11 @@
1582
1688
  origDisplay: [],
1583
1689
  resetParams: void 0
1584
1690
  };
1585
- var handleMaxWidth;
1586
1691
  chart.isPrinting = true;
1587
1692
  chart.pointer.reset(null, 0);
1588
1693
  fireEvent(chart, 'beforePrint');
1589
1694
  // Handle printMaxWidth
1590
- handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
1695
+ var handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
1591
1696
  if (handleMaxWidth) {
1592
1697
  printReverseInfo.resetParams = [
1593
1698
  chart.options.chart.width,
@@ -1607,85 +1712,92 @@
1607
1712
  chart.moveContainers(body);
1608
1713
  // Storage details for undo action after printing
1609
1714
  chart.printReverseInfo = printReverseInfo;
1610
- },
1715
+ }
1611
1716
  /**
1612
- * Clena up after printing a chart.
1613
- *
1614
- * @function Highcharts#afterPrint
1615
- *
1616
- * @private
1617
- *
1618
- * @param {Highcharts.Chart} chart
1619
- * Chart that was (or suppose to be) printed
1620
- * @return {void}
1621
- *
1622
- * @fires Highcharts.Chart#event:afterPrint
1623
- */
1624
- afterPrint: function () {
1625
- var chart = this;
1626
- if (!chart.printReverseInfo) {
1627
- return void 0;
1628
- }
1629
- var childNodes = chart.printReverseInfo.childNodes,
1630
- origDisplay = chart.printReverseInfo.origDisplay,
1631
- resetParams = chart.printReverseInfo.resetParams;
1632
- // put the chart back in
1633
- chart.moveContainers(chart.renderTo);
1634
- // restore all body content
1635
- [].forEach.call(childNodes, function (node, i) {
1636
- if (node.nodeType === 1) {
1637
- node.style.display = (origDisplay[i] || '');
1638
- }
1639
- });
1640
- chart.isPrinting = false;
1641
- // Reset printMaxWidth
1642
- if (resetParams) {
1643
- chart.setSize.apply(chart, resetParams);
1717
+ * @private
1718
+ */
1719
+ function chartCallback(chart) {
1720
+ var composition = chart;
1721
+ composition.renderExporting();
1722
+ addEvent(chart, 'redraw', composition.renderExporting);
1723
+ // Destroy the export elements at chart destroy
1724
+ addEvent(chart, 'destroy', composition.destroyExport);
1725
+ // Uncomment this to see a button directly below the chart, for quick
1726
+ // testing of export
1727
+ /*
1728
+ let button, viewImage, viewSource;
1729
+ if (!chart.renderer.forExport) {
1730
+ viewImage = function () {
1731
+ let div = doc.createElement('div');
1732
+ div.innerHTML = chart.getSVGForExport();
1733
+ chart.renderTo.parentNode.appendChild(div);
1734
+ };
1735
+
1736
+ viewSource = function () {
1737
+ let pre = doc.createElement('pre');
1738
+ pre.innerHTML = chart.getSVGForExport()
1739
+ .replace(/</g, '\n&lt;')
1740
+ .replace(/>/g, '&gt;');
1741
+ chart.renderTo.parentNode.appendChild(pre);
1742
+ };
1743
+
1744
+ viewImage();
1745
+
1746
+ // View SVG Image
1747
+ button = doc.createElement('button');
1748
+ button.innerHTML = 'View SVG Image';
1749
+ chart.renderTo.parentNode.appendChild(button);
1750
+ button.onclick = viewImage;
1751
+
1752
+ // View SVG Source
1753
+ button = doc.createElement('button');
1754
+ button.innerHTML = 'View SVG Source';
1755
+ chart.renderTo.parentNode.appendChild(button);
1756
+ button.onclick = viewSource;
1644
1757
  }
1645
- delete chart.printReverseInfo;
1646
- delete H.printingChart;
1647
- fireEvent(chart, 'afterPrint');
1648
- },
1758
+ //*/
1759
+ }
1649
1760
  /**
1650
- * Exporting module required. Clears away other elements in the page and
1651
- * prints the chart as it is displayed. By default, when the exporting
1652
- * module is enabled, a context button with a drop down menu in the upper
1653
- * right corner accesses this function.
1654
- *
1655
- * @sample highcharts/members/chart-print/
1656
- * Print from a HTML button
1657
- *
1658
- * @function Highcharts.Chart#print
1659
- *
1660
- * @return {void}
1661
- *
1662
- * @fires Highcharts.Chart#event:beforePrint
1663
- * @fires Highcharts.Chart#event:afterPrint
1664
- *
1665
- * @requires modules/exporting
1761
+ * @private
1666
1762
  */
1667
- print: function () {
1668
- var chart = this;
1669
- if (chart.isPrinting) { // block the button while in printing mode
1670
- return;
1671
- }
1672
- H.printingChart = chart;
1673
- if (!H.isSafari) {
1674
- chart.beforePrint();
1675
- }
1676
- // Give the browser time to draw WebGL content, an issue that randomly
1677
- // appears (at least) in Chrome ~67 on the Mac (#8708).
1678
- setTimeout(function () {
1679
- win.focus(); // #1510
1680
- win.print();
1681
- // allow the browser to prepare before reverting
1682
- if (!H.isSafari) {
1683
- setTimeout(function () {
1684
- chart.afterPrint();
1685
- }, 1000);
1763
+ function compose(ChartClass, SVGRendererClass) {
1764
+ ExportingSymbols.compose(SVGRendererClass);
1765
+ if (composedClasses.indexOf(ChartClass) === -1) {
1766
+ composedClasses.push(ChartClass);
1767
+ var chartProto = ChartClass.prototype;
1768
+ chartProto.afterPrint = afterPrint;
1769
+ chartProto.exportChart = exportChart;
1770
+ chartProto.inlineStyles = inlineStyles;
1771
+ chartProto.print = print;
1772
+ chartProto.sanitizeSVG = sanitizeSVG;
1773
+ chartProto.getChartHTML = getChartHTML;
1774
+ chartProto.getSVG = getSVG;
1775
+ chartProto.getSVGForExport = getSVGForExport;
1776
+ chartProto.getFilename = getFilename;
1777
+ chartProto.moveContainers = moveContainers;
1778
+ chartProto.beforePrint = beforePrint;
1779
+ chartProto.contextMenu = contextMenu;
1780
+ chartProto.addButton = addButton;
1781
+ chartProto.destroyExport = destroyExport;
1782
+ chartProto.renderExporting = renderExporting;
1783
+ chartProto.callbacks.push(chartCallback);
1784
+ addEvent(ChartClass, 'init', onChartInit);
1785
+ if (G.isSafari) {
1786
+ G.win.matchMedia('print').addListener(function (mqlEvent) {
1787
+ if (!printingChart) {
1788
+ return void 0;
1789
+ }
1790
+ if (mqlEvent.matches) {
1791
+ printingChart.beforePrint();
1792
+ }
1793
+ else {
1794
+ printingChart.afterPrint();
1795
+ }
1796
+ });
1686
1797
  }
1687
- }, 1);
1688
- },
1798
+ }
1799
+ }
1800
+ Exporting.compose = compose;
1689
1801
  /**
1690
1802
  * Display a popup menu for choosing the export type.
1691
1803
  *
@@ -1706,17 +1818,16 @@
1706
1818
  * @return {void}
1707
1819
  * @requires modules/exporting
1708
1820
  */
1709
- contextMenu: function (className, items, x, y, width, height, button) {
1821
+ function contextMenu(className, items, x, y, width, height, button) {
1710
1822
  var chart = this,
1711
1823
  navOptions = chart.options.navigation,
1712
1824
  chartWidth = chart.chartWidth,
1713
1825
  chartHeight = chart.chartHeight,
1714
1826
  cacheName = 'cache-' + className,
1715
- menu = chart[cacheName],
1716
1827
  menuPadding = Math.max(width,
1717
- height), // for mouse leave detection
1718
- innerMenu,
1719
- menuStyle;
1828
+ height); // for mouse leave detection
1829
+ var innerMenu,
1830
+ menu = chart[cacheName];
1720
1831
  // create the menu only the first time
1721
1832
  if (!menu) {
1722
1833
  // create a HTML element above the SVG
@@ -1781,7 +1892,7 @@
1781
1892
  if (isObject(item, true)) {
1782
1893
  var element = void 0;
1783
1894
  if (item.separator) {
1784
- element = createElement('hr', null, null, innerMenu);
1895
+ element = createElement('hr', void 0, void 0, innerMenu);
1785
1896
  }
1786
1897
  else {
1787
1898
  // When chart initialized with the table,
@@ -1801,166 +1912,54 @@
1801
1912
  .apply(chart, arguments);
1802
1913
  }
1803
1914
  }
1804
- }, null, innerMenu);
1805
- element.appendChild(doc.createTextNode(item.text ||
1806
- chart.options.lang[item.textKey]));
1915
+ }, void 0, innerMenu);
1916
+ AST.setElementHTML(element, item.text ||
1917
+ chart.options.lang[item.textKey]);
1807
1918
  if (!chart.styledMode) {
1808
1919
  element.onmouseover = function () {
1809
- css(this, navOptions.menuItemHoverStyle);
1810
- };
1811
- element.onmouseout = function () {
1812
- css(this, navOptions.menuItemStyle);
1813
- };
1814
- css(element, extend({
1815
- cursor: 'pointer'
1816
- }, navOptions.menuItemStyle));
1817
- }
1818
- }
1819
- // Keep references to menu divs to be able to destroy them
1820
- chart.exportDivElements.push(element);
1821
- }
1822
- });
1823
- // Keep references to menu and innerMenu div to be able to destroy
1824
- // them
1825
- chart.exportDivElements.push(innerMenu, menu);
1826
- chart.exportMenuWidth = menu.offsetWidth;
1827
- chart.exportMenuHeight = menu.offsetHeight;
1828
- }
1829
- menuStyle = { display: 'block' };
1830
- // if outside right, right align it
1831
- if (x + chart.exportMenuWidth > chartWidth) {
1832
- menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
1833
- }
1834
- else {
1835
- menuStyle.left = (x - menuPadding) + 'px';
1836
- }
1837
- // if outside bottom, bottom align it
1838
- if (y + height + chart.exportMenuHeight > chartHeight &&
1839
- button.alignOptions.verticalAlign !== 'top') {
1840
- menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
1841
- }
1842
- else {
1843
- menuStyle.top = (y + height - menuPadding) + 'px';
1844
- }
1845
- css(menu, menuStyle);
1846
- // #10361, #9998
1847
- css(chart.renderTo, { overflow: '' });
1848
- css(chart.container, { overflow: '' });
1849
- chart.openMenu = true;
1850
- fireEvent(chart, 'exportMenuShown');
1851
- },
1852
- /**
1853
- * Add the export button to the chart, with options.
1854
- *
1855
- * @private
1856
- * @function Highcharts.Chart#addButton
1857
- * @param {Highcharts.NavigationButtonOptions} options
1858
- * @return {void}
1859
- * @requires modules/exporting
1860
- */
1861
- addButton: function (options) {
1862
- var chart = this,
1863
- renderer = chart.renderer,
1864
- btnOptions = merge(chart.options.navigation.buttonOptions,
1865
- options),
1866
- onclick = btnOptions.onclick,
1867
- menuItems = btnOptions.menuItems,
1868
- symbol,
1869
- button,
1870
- symbolSize = btnOptions.symbolSize || 12;
1871
- if (!chart.btnCount) {
1872
- chart.btnCount = 0;
1873
- }
1874
- // Keeps references to the button elements
1875
- if (!chart.exportDivElements) {
1876
- chart.exportDivElements = [];
1877
- chart.exportSVGElements = [];
1878
- }
1879
- if (btnOptions.enabled === false || !btnOptions.theme) {
1880
- return;
1881
- }
1882
- var attr = btnOptions.theme,
1883
- states = attr.states,
1884
- hover = states && states.hover,
1885
- select = states && states.select,
1886
- callback;
1887
- if (!chart.styledMode) {
1888
- attr.fill = pick(attr.fill, palette.backgroundColor);
1889
- attr.stroke = pick(attr.stroke, 'none');
1890
- }
1891
- delete attr.states;
1892
- if (onclick) {
1893
- callback = function (e) {
1894
- if (e) {
1895
- e.stopPropagation();
1896
- }
1897
- onclick.call(chart, e);
1898
- };
1899
- }
1900
- else if (menuItems) {
1901
- callback = function (e) {
1902
- // consistent with onclick call (#3495)
1903
- if (e) {
1904
- e.stopPropagation();
1920
+ css(this, navOptions.menuItemHoverStyle);
1921
+ };
1922
+ element.onmouseout = function () {
1923
+ css(this, navOptions.menuItemStyle);
1924
+ };
1925
+ css(element, extend({
1926
+ cursor: 'pointer'
1927
+ }, navOptions.menuItemStyle));
1928
+ }
1929
+ }
1930
+ // Keep references to menu divs to be able to destroy them
1931
+ chart.exportDivElements.push(element);
1905
1932
  }
1906
- chart.contextMenu(button.menuClassName, menuItems, button.translateX, button.translateY, button.width, button.height, button);
1907
- button.setState(2);
1908
- };
1933
+ });
1934
+ // Keep references to menu and innerMenu div to be able to destroy
1935
+ // them
1936
+ chart.exportDivElements.push(innerMenu, menu);
1937
+ chart.exportMenuWidth = menu.offsetWidth;
1938
+ chart.exportMenuHeight = menu.offsetHeight;
1909
1939
  }
1910
- if (btnOptions.text && btnOptions.symbol) {
1911
- attr.paddingLeft = pick(attr.paddingLeft, 30);
1940
+ var menuStyle = { display: 'block' };
1941
+ // if outside right, right align it
1942
+ if (x + chart.exportMenuWidth > chartWidth) {
1943
+ menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
1912
1944
  }
1913
- else if (!btnOptions.text) {
1914
- extend(attr, {
1915
- width: btnOptions.width,
1916
- height: btnOptions.height,
1917
- padding: 0
1918
- });
1945
+ else {
1946
+ menuStyle.left = (x - menuPadding) + 'px';
1919
1947
  }
1920
- if (!chart.styledMode) {
1921
- attr['stroke-linecap'] = 'round';
1922
- attr.fill = pick(attr.fill, palette.backgroundColor);
1923
- attr.stroke = pick(attr.stroke, 'none');
1948
+ // if outside bottom, bottom align it
1949
+ if (y + height + chart.exportMenuHeight > chartHeight &&
1950
+ button.alignOptions.verticalAlign !== 'top') {
1951
+ menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
1924
1952
  }
1925
- button = renderer
1926
- .button(btnOptions.text, 0, 0, callback, attr, hover, select)
1927
- .addClass(options.className)
1928
- .attr({
1929
- title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
1930
- });
1931
- button.menuClassName = (options.menuClassName ||
1932
- 'highcharts-menu-' + chart.btnCount++);
1933
- if (btnOptions.symbol) {
1934
- symbol = renderer
1935
- .symbol(btnOptions.symbol, btnOptions.symbolX - (symbolSize / 2), btnOptions.symbolY - (symbolSize / 2), symbolSize, symbolSize
1936
- // If symbol is an image, scale it (#7957)
1937
- , {
1938
- width: symbolSize,
1939
- height: symbolSize
1940
- })
1941
- .addClass('highcharts-button-symbol')
1942
- .attr({
1943
- zIndex: 1
1944
- })
1945
- .add(button);
1946
- if (!chart.styledMode) {
1947
- symbol.attr({
1948
- stroke: btnOptions.symbolStroke,
1949
- fill: btnOptions.symbolFill,
1950
- 'stroke-width': btnOptions.symbolStrokeWidth || 1
1951
- });
1952
- }
1953
+ else {
1954
+ menuStyle.top = (y + height - menuPadding) + 'px';
1953
1955
  }
1954
- button
1955
- .add(chart.exportingGroup)
1956
- .align(extend(btnOptions, {
1957
- width: button.width,
1958
- x: pick(btnOptions.x, chart.buttonOffset) // #1654
1959
- }), true, 'spacingBox');
1960
- chart.buttonOffset += ((button.width + btnOptions.buttonSpacing) *
1961
- (btnOptions.align === 'right' ? -1 : 1));
1962
- chart.exportSVGElements.push(button, symbol);
1963
- },
1956
+ css(menu, menuStyle);
1957
+ // #10361, #9998
1958
+ css(chart.renderTo, { overflow: '' });
1959
+ css(chart.container, { overflow: '' });
1960
+ chart.openMenu = true;
1961
+ fireEvent(chart, 'exportMenuShown');
1962
+ }
1964
1963
  /**
1965
1964
  * Destroy the export buttons.
1966
1965
  * @private
@@ -1969,12 +1968,12 @@
1969
1968
  * @return {void}
1970
1969
  * @requires modules/exporting
1971
1970
  */
1972
- destroyExport: function (e) {
1971
+ function destroyExport(e) {
1973
1972
  var chart = e ? e.target : this,
1974
1973
  exportSVGElements = chart.exportSVGElements,
1975
1974
  exportDivElements = chart.exportDivElements,
1976
- exportEvents = chart.exportEvents,
1977
- cacheName;
1975
+ exportEvents = chart.exportEvents;
1976
+ var cacheName;
1978
1977
  // Destroy the extra buttons added
1979
1978
  if (exportSVGElements) {
1980
1979
  exportSVGElements.forEach(function (elem, i) {
@@ -1985,7 +1984,7 @@
1985
1984
  if (chart[cacheName]) {
1986
1985
  delete chart[cacheName];
1987
1986
  }
1988
- chart.exportSVGElements[i] = elem.destroy();
1987
+ exportSVGElements[i] = elem.destroy();
1989
1988
  }
1990
1989
  });
1991
1990
  exportSVGElements.length = 0;
@@ -1998,17 +1997,20 @@
1998
1997
  // Destroy the divs for the menu
1999
1998
  if (exportDivElements) {
2000
1999
  exportDivElements.forEach(function (elem, i) {
2001
- // Remove the event handler
2002
- U.clearTimeout(elem.hideTimer); // #5427
2003
- removeEvent(elem, 'mouseleave');
2004
- // Remove inline events
2005
- chart.exportDivElements[i] =
2006
- elem.onmouseout =
2007
- elem.onmouseover =
2008
- elem.ontouchstart =
2009
- elem.onclick = null;
2010
- // Destroy the div by moving to garbage bin
2011
- discardElement(elem);
2000
+ if (elem) {
2001
+ // Remove the event handler
2002
+ U.clearTimeout(elem.hideTimer); // #5427
2003
+ removeEvent(elem, 'mouseleave');
2004
+ // Remove inline events
2005
+ // (chart.exportDivElements as any)[i] =
2006
+ exportDivElements[i] =
2007
+ elem.onmouseout =
2008
+ elem.onmouseover =
2009
+ elem.ontouchstart =
2010
+ elem.onclick = null;
2011
+ // Destroy the div by moving to garbage bin
2012
+ discardElement(elem);
2013
+ }
2012
2014
  });
2013
2015
  exportDivElements.length = 0;
2014
2016
  }
@@ -2019,72 +2021,250 @@
2019
2021
  exportEvents.length = 0;
2020
2022
  }
2021
2023
  }
2022
- /* eslint-enable no-invalid-this, valid-jsdoc */
2023
- });
2024
- // These ones are translated to attributes rather than styles
2025
- SVGRenderer.prototype.inlineToAttributes = [
2026
- 'fill',
2027
- 'stroke',
2028
- 'strokeLinecap',
2029
- 'strokeLinejoin',
2030
- 'strokeWidth',
2031
- 'textAnchor',
2032
- 'x',
2033
- 'y'
2034
- ];
2035
- // These CSS properties are not inlined. Remember camelCase.
2036
- SVGRenderer.prototype.inlineBlacklist = [
2037
- /-/,
2038
- /^(clipPath|cssText|d|height|width)$/,
2039
- /^font$/,
2040
- /[lL]ogical(Width|Height)$/,
2041
- /perspective/,
2042
- /TapHighlightColor/,
2043
- /^transition/,
2044
- /^length$/ // #7700
2045
- // /^text (border|color|cursor|height|webkitBorder)/
2046
- ];
2047
- SVGRenderer.prototype.unstyledElements = [
2048
- 'clipPath',
2049
- 'defs',
2050
- 'desc'
2051
- ];
2052
- /**
2053
- * Analyze inherited styles from stylesheets and add them inline
2054
- *
2055
- * @private
2056
- * @function Highcharts.Chart#inlineStyles
2057
- * @return {void}
2058
- *
2059
- * @todo: What are the border styles for text about? In general, text has a lot
2060
- * of properties.
2061
- * @todo: Make it work with IE9 and IE10.
2062
- *
2063
- * @requires modules/exporting
2064
- */
2065
- Chart.prototype.inlineStyles = function () {
2066
- var renderer = this.renderer,
2067
- inlineToAttributes = renderer.inlineToAttributes,
2068
- blacklist = renderer.inlineBlacklist,
2069
- whitelist = renderer.inlineWhitelist, // For IE
2070
- unstyledElements = renderer.unstyledElements,
2071
- defaultStyles = {},
2072
- dummySVG,
2073
- iframe,
2074
- iframeDoc;
2075
- // Create an iframe where we read default styles without pollution from this
2076
- // body
2077
- iframe = doc.createElement('iframe');
2078
- css(iframe, {
2079
- width: '1px',
2080
- height: '1px',
2081
- visibility: 'hidden'
2082
- });
2083
- doc.body.appendChild(iframe);
2084
- iframeDoc = iframe.contentWindow.document;
2085
- iframeDoc.open();
2086
- iframeDoc.write('<svg xmlns="http://www.w3.org/2000/svg"></svg>');
2087
- iframeDoc.close();
2024
+ /**
2025
+ * Exporting module required. Submit an SVG version of the chart to a server
2026
+ * along with some parameters for conversion.
2027
+ *
2028
+ * @sample highcharts/members/chart-exportchart/
2029
+ * Export with no options
2030
+ * @sample highcharts/members/chart-exportchart-filename/
2031
+ * PDF type and custom filename
2032
+ * @sample highcharts/members/chart-exportchart-custom-background/
2033
+ * Different chart background in export
2034
+ * @sample stock/members/chart-exportchart/
2035
+ * Export with Highcharts Stock
2036
+ *
2037
+ * @function Highcharts.Chart#exportChart
2038
+ *
2039
+ * @param {Highcharts.ExportingOptions} exportingOptions
2040
+ * Exporting options in addition to those defined in
2041
+ * [exporting](https://api.highcharts.com/highcharts/exporting).
2042
+ *
2043
+ * @param {Highcharts.Options} chartOptions
2044
+ * Additional chart options for the exported chart. For example a
2045
+ * different background color can be added here, or `dataLabels` for
2046
+ * export only.
2047
+ *
2048
+ * @requires modules/exporting
2049
+ */
2050
+ function exportChart(exportingOptions, chartOptions) {
2051
+ var svg = this.getSVGForExport(exportingOptions,
2052
+ chartOptions);
2053
+ // merge the options
2054
+ exportingOptions = merge(this.options.exporting, exportingOptions);
2055
+ // do the post
2056
+ HU.post(exportingOptions.url, {
2057
+ filename: exportingOptions.filename ?
2058
+ exportingOptions.filename.replace(/\//g, '-') :
2059
+ this.getFilename(),
2060
+ type: exportingOptions.type,
2061
+ // IE8 fails to post undefined correctly, so use 0
2062
+ width: exportingOptions.width || 0,
2063
+ scale: exportingOptions.scale,
2064
+ svg: svg
2065
+ }, exportingOptions.formAttributes);
2066
+ }
2067
+ /**
2068
+ * Return the unfiltered innerHTML of the chart container. Used as hook for
2069
+ * plugins. In styled mode, it also takes care of inlining CSS style rules.
2070
+ *
2071
+ * @see Chart#getSVG
2072
+ *
2073
+ * @function Highcharts.Chart#getChartHTML
2074
+ *
2075
+ * @returns {string}
2076
+ * The unfiltered SVG of the chart.
2077
+ *
2078
+ * @requires modules/exporting
2079
+ */
2080
+ function getChartHTML() {
2081
+ if (this.styledMode) {
2082
+ this.inlineStyles();
2083
+ }
2084
+ return this.container.innerHTML;
2085
+ }
2086
+ /**
2087
+ * Get the default file name used for exported charts. By default it creates
2088
+ * a file name based on the chart title.
2089
+ *
2090
+ * @function Highcharts.Chart#getFilename
2091
+ *
2092
+ * @return {string} A file name without extension.
2093
+ *
2094
+ * @requires modules/exporting
2095
+ */
2096
+ function getFilename() {
2097
+ var s = this.userOptions.title && this.userOptions.title.text;
2098
+ var filename = this.options.exporting.filename;
2099
+ if (filename) {
2100
+ return filename.replace(/\//g, '-');
2101
+ }
2102
+ if (typeof s === 'string') {
2103
+ filename = s
2104
+ .toLowerCase()
2105
+ .replace(/<\/?[^>]+(>|$)/g, '') // strip HTML tags
2106
+ .replace(/[\s_]+/g, '-')
2107
+ .replace(/[^a-z0-9\-]/g, '') // preserve only latin
2108
+ .replace(/^[\-]+/g, '') // dashes in the start
2109
+ .replace(/[\-]+/g, '-') // dashes in a row
2110
+ .substr(0, 24)
2111
+ .replace(/[\-]+$/g, ''); // dashes in the end;
2112
+ }
2113
+ if (!filename || filename.length < 5) {
2114
+ filename = 'chart';
2115
+ }
2116
+ return filename;
2117
+ }
2118
+ /**
2119
+ * Return an SVG representation of the chart.
2120
+ *
2121
+ * @sample highcharts/members/chart-getsvg/
2122
+ * View the SVG from a button
2123
+ *
2124
+ * @function Highcharts.Chart#getSVG
2125
+ *
2126
+ * @param {Highcharts.Options} [chartOptions]
2127
+ * Additional chart options for the generated SVG representation. For
2128
+ * collections like `xAxis`, `yAxis` or `series`, the additional
2129
+ * options is either merged in to the original item of the same
2130
+ * `id`, or to the first item if a common id is not found.
2131
+ *
2132
+ * @return {string}
2133
+ * The SVG representation of the rendered chart.
2134
+ *
2135
+ * @fires Highcharts.Chart#event:getSVG
2136
+ *
2137
+ * @requires modules/exporting
2138
+ */
2139
+ function getSVG(chartOptions) {
2140
+ var chart = this;
2141
+ var svg,
2142
+ seriesOptions,
2143
+ // Copy the options and add extra options
2144
+ options = merge(chart.options,
2145
+ chartOptions);
2146
+ // Use userOptions to make the options chain in series right (#3881)
2147
+ options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions && chartOptions.plotOptions);
2148
+ // ... and likewise with time, avoid that undefined time properties are
2149
+ // merged over legacy global time options
2150
+ options.time = merge(chart.userOptions.time, chartOptions && chartOptions.time);
2151
+ // create a sandbox where a new chart will be generated
2152
+ var sandbox = createElement('div',
2153
+ null, {
2154
+ position: 'absolute',
2155
+ top: '-9999em',
2156
+ width: chart.chartWidth + 'px',
2157
+ height: chart.chartHeight + 'px'
2158
+ },
2159
+ doc.body);
2160
+ // get the source size
2161
+ var cssWidth = chart.renderTo.style.width,
2162
+ cssHeight = chart.renderTo.style.height,
2163
+ sourceWidth = options.exporting.sourceWidth ||
2164
+ options.chart.width ||
2165
+ (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
2166
+ (options.isGantt ? 800 : 600),
2167
+ sourceHeight = options.exporting.sourceHeight ||
2168
+ options.chart.height ||
2169
+ (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
2170
+ 400;
2171
+ // override some options
2172
+ extend(options.chart, {
2173
+ animation: false,
2174
+ renderTo: sandbox,
2175
+ forExport: true,
2176
+ renderer: 'SVGRenderer',
2177
+ width: sourceWidth,
2178
+ height: sourceHeight
2179
+ });
2180
+ options.exporting.enabled = false; // hide buttons in print
2181
+ delete options.data; // #3004
2182
+ // prepare for replicating the chart
2183
+ options.series = [];
2184
+ chart.series.forEach(function (serie) {
2185
+ seriesOptions = merge(serie.userOptions, {
2186
+ animation: false,
2187
+ enableMouseTracking: false,
2188
+ showCheckbox: false,
2189
+ visible: serie.visible
2190
+ });
2191
+ // Used for the navigator series that has its own option set
2192
+ if (!seriesOptions.isInternal) {
2193
+ options.series.push(seriesOptions);
2194
+ }
2195
+ });
2196
+ var colls = {};
2197
+ chart.axes.forEach(function (axis) {
2198
+ // Assign an internal key to ensure a one-to-one mapping (#5924)
2199
+ if (!axis.userOptions.internalKey) { // #6444
2200
+ axis.userOptions.internalKey = uniqueKey();
2201
+ }
2202
+ if (!axis.options.isInternal) {
2203
+ if (!colls[axis.coll]) {
2204
+ colls[axis.coll] = true;
2205
+ options[axis.coll] = [];
2206
+ }
2207
+ options[axis.coll].push(merge(axis.userOptions, {
2208
+ visible: axis.visible
2209
+ }));
2210
+ }
2211
+ });
2212
+ // generate the chart copy
2213
+ var chartCopy = new Chart(options,
2214
+ chart.callback);
2215
+ // Axis options and series options (#2022, #3900, #5982)
2216
+ if (chartOptions) {
2217
+ ['xAxis', 'yAxis', 'series'].forEach(function (coll) {
2218
+ var collOptions = {};
2219
+ if (chartOptions[coll]) {
2220
+ collOptions[coll] = chartOptions[coll];
2221
+ chartCopy.update(collOptions);
2222
+ }
2223
+ });
2224
+ }
2225
+ // Reflect axis extremes in the export (#5924)
2226
+ chart.axes.forEach(function (axis) {
2227
+ var axisCopy = find(chartCopy.axes,
2228
+ function (copy) {
2229
+ return copy.options.internalKey ===
2230
+ axis.userOptions.internalKey;
2231
+ }), extremes = axis.getExtremes(), userMin = extremes.userMin, userMax = extremes.userMax;
2232
+ if (axisCopy &&
2233
+ ((typeof userMin !== 'undefined' &&
2234
+ userMin !== axisCopy.min) || (typeof userMax !== 'undefined' &&
2235
+ userMax !== axisCopy.max))) {
2236
+ axisCopy.setExtremes(userMin, userMax, true, false);
2237
+ }
2238
+ });
2239
+ // Get the SVG from the container's innerHTML
2240
+ svg = chartCopy.getChartHTML();
2241
+ fireEvent(this, 'getSVG', { chartCopy: chartCopy });
2242
+ svg = chart.sanitizeSVG(svg, options);
2243
+ // free up memory
2244
+ options = null;
2245
+ chartCopy.destroy();
2246
+ discardElement(sandbox);
2247
+ return svg;
2248
+ }
2249
+ /**
2250
+ * @private
2251
+ * @function Highcharts.Chart#getSVGForExport
2252
+ * @param {Highcharts.ExportingOptions} options
2253
+ * @param {Highcharts.Options} chartOptions
2254
+ * @return {string}
2255
+ * @requires modules/exporting
2256
+ */
2257
+ function getSVGForExport(options, chartOptions) {
2258
+ var chartExportingOptions = this.options.exporting;
2259
+ return this.getSVG(merge({ chart: { borderRadius: 0 } }, chartExportingOptions.chartOptions, chartOptions, {
2260
+ exporting: {
2261
+ sourceWidth: ((options && options.sourceWidth) ||
2262
+ chartExportingOptions.sourceWidth),
2263
+ sourceHeight: ((options && options.sourceHeight) ||
2264
+ chartExportingOptions.sourceHeight)
2265
+ }
2266
+ }));
2267
+ }
2088
2268
  /**
2089
2269
  * Make hyphenated property names out of camelCase
2090
2270
  * @private
@@ -2099,273 +2279,377 @@
2099
2279
  });
2100
2280
  }
2101
2281
  /**
2102
- * Call this on all elements and recurse to children
2282
+ * Analyze inherited styles from stylesheets and add them inline
2283
+ *
2103
2284
  * @private
2104
- * @param {Highcharts.HTMLDOMElement} node
2105
- * Element child
2285
+ * @function Highcharts.Chart#inlineStyles
2106
2286
  * @return {void}
2287
+ *
2288
+ * @todo: What are the border styles for text about? In general, text has a
2289
+ * lot of properties.
2290
+ * @todo: Make it work with IE9 and IE10.
2291
+ *
2292
+ * @requires modules/exporting
2107
2293
  */
2108
- function recurse(node) {
2109
- var styles,
2110
- parentStyles,
2111
- cssText = '',
2112
- dummy,
2113
- styleAttr,
2114
- blacklisted,
2115
- whitelisted,
2116
- i;
2294
+ function inlineStyles() {
2295
+ var blacklist = inlineBlacklist,
2296
+ whitelist = Exporting.inlineWhitelist, // For IE
2297
+ defaultStyles = {};
2298
+ var dummySVG;
2299
+ // Create an iframe where we read default styles without pollution from
2300
+ // this body
2301
+ var iframe = doc.createElement('iframe');
2302
+ css(iframe, {
2303
+ width: '1px',
2304
+ height: '1px',
2305
+ visibility: 'hidden'
2306
+ });
2307
+ doc.body.appendChild(iframe);
2308
+ var iframeDoc = iframe.contentWindow.document;
2309
+ iframeDoc.open();
2310
+ iframeDoc.write('<svg xmlns="http://www.w3.org/2000/svg"></svg>');
2311
+ iframeDoc.close();
2117
2312
  /**
2118
- * Check computed styles and whether they are in the white/blacklist for
2119
- * styles or atttributes.
2313
+ * Call this on all elements and recurse to children
2120
2314
  * @private
2121
- * @param {string} val
2122
- * Style value
2123
- * @param {string} prop
2124
- * Style property name
2315
+ * @param {Highcharts.HTMLDOMElement} node
2316
+ * Element child
2125
2317
  * @return {void}
2126
2318
  */
2127
- function filterStyles(val, prop) {
2128
- // Check against whitelist & blacklist
2129
- blacklisted = whitelisted = false;
2130
- if (whitelist) {
2131
- // Styled mode in IE has a whitelist instead.
2132
- // Exclude all props not in this list.
2133
- i = whitelist.length;
2134
- while (i-- && !whitelisted) {
2135
- whitelisted = whitelist[i].test(prop);
2319
+ function recurse(node) {
2320
+ var styles,
2321
+ parentStyles,
2322
+ cssText = '',
2323
+ dummy,
2324
+ styleAttr,
2325
+ blacklisted,
2326
+ whitelisted,
2327
+ i;
2328
+ /**
2329
+ * Check computed styles and whether they are in the white/blacklist
2330
+ * for styles or atttributes.
2331
+ * @private
2332
+ * @param {string} val
2333
+ * Style value
2334
+ * @param {string} prop
2335
+ * Style property name
2336
+ * @return {void}
2337
+ */
2338
+ function filterStyles(val, prop) {
2339
+ // Check against whitelist & blacklist
2340
+ blacklisted = whitelisted = false;
2341
+ if (whitelist.length) {
2342
+ // Styled mode in IE has a whitelist instead.
2343
+ // Exclude all props not in this list.
2344
+ i = whitelist.length;
2345
+ while (i-- && !whitelisted) {
2346
+ whitelisted = whitelist[i].test(prop);
2347
+ }
2348
+ blacklisted = !whitelisted;
2136
2349
  }
2137
- blacklisted = !whitelisted;
2138
- }
2139
- // Explicitly remove empty transforms
2140
- if (prop === 'transform' && val === 'none') {
2141
- blacklisted = true;
2142
- }
2143
- i = blacklist.length;
2144
- while (i-- && !blacklisted) {
2145
- blacklisted = (blacklist[i].test(prop) ||
2146
- typeof val === 'function');
2147
- }
2148
- if (!blacklisted) {
2149
- // If parent node has the same style, it gets inherited, no need
2150
- // to inline it. Top-level props should be diffed against parent
2151
- // (#7687).
2152
- if ((parentStyles[prop] !== val ||
2153
- node.nodeName === 'svg') &&
2154
- defaultStyles[node.nodeName][prop] !== val) {
2155
- // Attributes
2156
- if (!inlineToAttributes ||
2157
- inlineToAttributes.indexOf(prop) !== -1) {
2158
- if (val) {
2159
- node.setAttribute(hyphenate(prop), val);
2350
+ // Explicitly remove empty transforms
2351
+ if (prop === 'transform' && val === 'none') {
2352
+ blacklisted = true;
2353
+ }
2354
+ i = blacklist.length;
2355
+ while (i-- && !blacklisted) {
2356
+ blacklisted = (blacklist[i].test(prop) ||
2357
+ typeof val === 'function');
2358
+ }
2359
+ if (!blacklisted) {
2360
+ // If parent node has the same style, it gets inherited, no
2361
+ // need to inline it. Top-level props should be diffed
2362
+ // against parent (#7687).
2363
+ if ((parentStyles[prop] !== val ||
2364
+ node.nodeName === 'svg') &&
2365
+ defaultStyles[node.nodeName][prop] !== val) {
2366
+ // Attributes
2367
+ if (!inlineToAttributes ||
2368
+ inlineToAttributes.indexOf(prop) !== -1) {
2369
+ if (val) {
2370
+ node.setAttribute(hyphenate(prop), val);
2371
+ }
2372
+ // Styles
2373
+ }
2374
+ else {
2375
+ cssText += hyphenate(prop) + ':' + val + ';';
2160
2376
  }
2161
- // Styles
2162
- }
2163
- else {
2164
- cssText += hyphenate(prop) + ':' + val + ';';
2165
2377
  }
2166
2378
  }
2167
2379
  }
2168
- }
2169
- if (node.nodeType === 1 &&
2170
- unstyledElements.indexOf(node.nodeName) === -1) {
2171
- styles = win.getComputedStyle(node, null);
2172
- parentStyles = node.nodeName === 'svg' ?
2173
- {} :
2174
- win.getComputedStyle(node.parentNode, null);
2175
- // Get default styles from the browser so that we don't have to add
2176
- // these
2177
- if (!defaultStyles[node.nodeName]) {
2178
- /*
2179
- if (!dummySVG) {
2180
- dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
2181
- dummySVG.setAttribute('version', '1.1');
2182
- doc.body.appendChild(dummySVG);
2380
+ if (node.nodeType === 1 &&
2381
+ unstyledElements.indexOf(node.nodeName) === -1) {
2382
+ styles = win.getComputedStyle(node, null);
2383
+ parentStyles = node.nodeName === 'svg' ?
2384
+ {} :
2385
+ win.getComputedStyle(node.parentNode, null);
2386
+ // Get default styles from the browser so that we don't have to
2387
+ // add these
2388
+ if (!defaultStyles[node.nodeName]) {
2389
+ /*
2390
+ if (!dummySVG) {
2391
+ dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
2392
+ dummySVG.setAttribute('version', '1.1');
2393
+ doc.body.appendChild(dummySVG);
2394
+ }
2395
+ */
2396
+ dummySVG = iframeDoc.getElementsByTagName('svg')[0];
2397
+ dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
2398
+ dummySVG.appendChild(dummy);
2399
+ // Copy, so we can remove the node
2400
+ defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null));
2401
+ // Remove default fill, otherwise text disappears when
2402
+ // exported
2403
+ if (node.nodeName === 'text') {
2404
+ delete defaultStyles.text.fill;
2405
+ }
2406
+ dummySVG.removeChild(dummy);
2183
2407
  }
2184
- */
2185
- dummySVG = iframeDoc.getElementsByTagName('svg')[0];
2186
- dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
2187
- dummySVG.appendChild(dummy);
2188
- // Copy, so we can remove the node
2189
- defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null));
2190
- // Remove default fill, otherwise text disappears when exported
2191
- if (node.nodeName === 'text') {
2192
- delete defaultStyles.text.fill;
2408
+ // Loop through all styles and add them inline if they are ok
2409
+ if (G.isFirefox || G.isMS) {
2410
+ // Some browsers put lots of styles on the prototype
2411
+ for (var p in styles) { // eslint-disable-line guard-for-in
2412
+ filterStyles(styles[p], p);
2413
+ }
2193
2414
  }
2194
- dummySVG.removeChild(dummy);
2195
- }
2196
- // Loop through all styles and add them inline if they are ok
2197
- if (H.isFirefox || H.isMS) {
2198
- // Some browsers put lots of styles on the prototype
2199
- for (var p in styles) { // eslint-disable-line guard-for-in
2200
- filterStyles(styles[p], p);
2415
+ else {
2416
+ objectEach(styles, filterStyles);
2201
2417
  }
2418
+ // Apply styles
2419
+ if (cssText) {
2420
+ styleAttr = node.getAttribute('style');
2421
+ node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
2422
+ }
2423
+ // Set default stroke width (needed at least for IE)
2424
+ if (node.nodeName === 'svg') {
2425
+ node.setAttribute('stroke-width', '1px');
2426
+ }
2427
+ if (node.nodeName === 'text') {
2428
+ return;
2429
+ }
2430
+ // Recurse
2431
+ [].forEach.call(node.children || node.childNodes, recurse);
2202
2432
  }
2203
- else {
2204
- objectEach(styles, filterStyles);
2205
- }
2206
- // Apply styles
2207
- if (cssText) {
2208
- styleAttr = node.getAttribute('style');
2209
- node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
2210
- }
2211
- // Set default stroke width (needed at least for IE)
2212
- if (node.nodeName === 'svg') {
2213
- node.setAttribute('stroke-width', '1px');
2214
- }
2215
- if (node.nodeName === 'text') {
2216
- return;
2217
- }
2218
- // Recurse
2219
- [].forEach.call(node.children || node.childNodes, recurse);
2220
2433
  }
2434
+ /**
2435
+ * Remove the dummy objects used to get defaults
2436
+ * @private
2437
+ * @return {void}
2438
+ */
2439
+ function tearDown() {
2440
+ dummySVG.parentNode.removeChild(dummySVG);
2441
+ // Remove trash from DOM that stayed after each exporting
2442
+ iframe.parentNode.removeChild(iframe);
2443
+ }
2444
+ recurse(this.container.querySelector('svg'));
2445
+ tearDown();
2221
2446
  }
2222
2447
  /**
2223
- * Remove the dummy objects used to get defaults
2448
+ * Move the chart container(s) to another div.
2449
+ *
2450
+ * @function Highcharts#moveContainers
2451
+ *
2224
2452
  * @private
2453
+ *
2454
+ * @param {Highcharts.HTMLDOMElement} moveTo
2455
+ * Move target
2225
2456
  * @return {void}
2226
2457
  */
2227
- function tearDown() {
2228
- dummySVG.parentNode.removeChild(dummySVG);
2229
- // Remove trash from DOM that stayed after each exporting
2230
- iframe.parentNode.removeChild(iframe);
2458
+ function moveContainers(moveTo) {
2459
+ var chart = this;
2460
+ (chart.fixedDiv ? // When scrollablePlotArea is active (#9533)
2461
+ [chart.fixedDiv, chart.scrollingContainer] :
2462
+ [chart.container]).forEach(function (div) {
2463
+ moveTo.appendChild(div);
2464
+ });
2231
2465
  }
2232
- recurse(this.container.querySelector('svg'));
2233
- tearDown();
2234
- };
2235
- symbols.menu = function (x, y, width, height) {
2236
- var arr = [
2237
- ['M',
2238
- x,
2239
- y + 2.5],
2240
- ['L',
2241
- x + width,
2242
- y + 2.5],
2243
- ['M',
2244
- x,
2245
- y + height / 2 + 0.5],
2246
- ['L',
2247
- x + width,
2248
- y + height / 2 + 0.5],
2249
- ['M',
2250
- x,
2251
- y + height - 1.5],
2252
- ['L',
2253
- x + width,
2254
- y + height - 1.5]
2255
- ];
2256
- return arr;
2257
- };
2258
- symbols.menuball = function (x, y, width, height) {
2259
- var path = [],
2260
- h = (height / 3) - 2;
2261
- path = path.concat(symbols.circle(width - h, y, h, h), symbols.circle(width - h, y + h + 4, h, h), symbols.circle(width - h, y + 2 * (h + 4), h, h));
2262
- return path;
2263
- };
2264
- /**
2265
- * Add the buttons on chart load
2266
- * @private
2267
- * @function Highcharts.Chart#renderExporting
2268
- * @return {void}
2269
- * @requires modules/exporting
2270
- */
2271
- Chart.prototype.renderExporting = function () {
2272
- var chart = this,
2273
- exportingOptions = chart.options.exporting,
2274
- buttons = exportingOptions.buttons,
2275
- isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
2276
- chart.buttonOffset = 0;
2277
- if (chart.isDirtyExporting) {
2278
- chart.destroyExport();
2466
+ /**
2467
+ * Add update methods to handle chart.update and chart.exporting.update and
2468
+ * chart.navigation.update. These must be added to the chart instance rather
2469
+ * than the Chart prototype in order to use the chart instance inside the
2470
+ * update function.
2471
+ * @private
2472
+ */
2473
+ function onChartInit() {
2474
+ var chart = this,
2475
+ /**
2476
+ * @private
2477
+ * @param {"exporting"|"navigation"} prop
2478
+ * Property name in option root
2479
+ * @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
2480
+ * Options to update
2481
+ * @param {boolean} [redraw=true]
2482
+ * Whether to redraw
2483
+ * @return {void}
2484
+ */
2485
+ update = function (prop,
2486
+ options,
2487
+ redraw) {
2488
+ chart.isDirtyExporting = true;
2489
+ merge(true, chart.options[prop], options);
2490
+ if (pick(redraw, true)) {
2491
+ chart.redraw();
2492
+ }
2493
+ };
2494
+ chart.exporting = {
2495
+ update: function (options, redraw) {
2496
+ update('exporting', options, redraw);
2497
+ }
2498
+ };
2499
+ // Register update() method for navigation. Can not be set the same way
2500
+ // as for exporting, because navigation options are shared with bindings
2501
+ // which has separate update() logic.
2502
+ chartNavigationMixin.addUpdate(function (options, redraw) {
2503
+ update('navigation', options, redraw);
2504
+ }, chart);
2279
2505
  }
2280
- if (isDirty && exportingOptions.enabled !== false) {
2281
- chart.exportEvents = [];
2282
- chart.exportingGroup = chart.exportingGroup ||
2283
- chart.renderer.g('exporting-group').attr({
2284
- zIndex: 3 // #4955, // #8392
2285
- }).add();
2286
- objectEach(buttons, function (button) {
2287
- chart.addButton(button);
2288
- });
2289
- chart.isDirtyExporting = false;
2506
+ /**
2507
+ * Exporting module required. Clears away other elements in the page and
2508
+ * prints the chart as it is displayed. By default, when the exporting
2509
+ * module is enabled, a context button with a drop down menu in the upper
2510
+ * right corner accesses this function.
2511
+ *
2512
+ * @sample highcharts/members/chart-print/
2513
+ * Print from a HTML button
2514
+ *
2515
+ * @function Highcharts.Chart#print
2516
+ *
2517
+ * @return {void}
2518
+ *
2519
+ * @fires Highcharts.Chart#event:beforePrint
2520
+ * @fires Highcharts.Chart#event:afterPrint
2521
+ *
2522
+ * @requires modules/exporting
2523
+ */
2524
+ function print() {
2525
+ var chart = this;
2526
+ if (chart.isPrinting) { // block the button while in printing mode
2527
+ return;
2528
+ }
2529
+ printingChart = chart;
2530
+ if (!G.isSafari) {
2531
+ chart.beforePrint();
2532
+ }
2533
+ // Give the browser time to draw WebGL content, an issue that randomly
2534
+ // appears (at least) in Chrome ~67 on the Mac (#8708).
2535
+ setTimeout(function () {
2536
+ win.focus(); // #1510
2537
+ win.print();
2538
+ // allow the browser to prepare before reverting
2539
+ if (!G.isSafari) {
2540
+ setTimeout(function () {
2541
+ chart.afterPrint();
2542
+ }, 1000);
2543
+ }
2544
+ }, 1);
2290
2545
  }
2291
- };
2292
- /* eslint-disable no-invalid-this */
2293
- // Add update methods to handle chart.update and chart.exporting.update and
2294
- // chart.navigation.update. These must be added to the chart instance rather
2295
- // than the Chart prototype in order to use the chart instance inside the update
2296
- // function.
2297
- addEvent(Chart, 'init', function () {
2298
- var chart = this;
2299
2546
  /**
2547
+ * Add the buttons on chart load
2300
2548
  * @private
2301
- * @param {"exporting"|"navigation"} prop
2302
- * Property name in option root
2303
- * @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
2304
- * Options to update
2305
- * @param {boolean} [redraw=true]
2306
- * Whether to redraw
2549
+ * @function Highcharts.Chart#renderExporting
2307
2550
  * @return {void}
2551
+ * @requires modules/exporting
2308
2552
  */
2309
- function update(prop, options, redraw) {
2310
- chart.isDirtyExporting = true;
2311
- merge(true, chart.options[prop], options);
2312
- if (pick(redraw, true)) {
2313
- chart.redraw();
2553
+ function renderExporting() {
2554
+ var chart = this,
2555
+ exportingOptions = chart.options.exporting,
2556
+ buttons = exportingOptions.buttons,
2557
+ isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
2558
+ chart.buttonOffset = 0;
2559
+ if (chart.isDirtyExporting) {
2560
+ chart.destroyExport();
2561
+ }
2562
+ if (isDirty && exportingOptions.enabled !== false) {
2563
+ chart.exportEvents = [];
2564
+ chart.exportingGroup = chart.exportingGroup ||
2565
+ chart.renderer.g('exporting-group').attr({
2566
+ zIndex: 3 // #4955, // #8392
2567
+ }).add();
2568
+ objectEach(buttons, function (button) {
2569
+ chart.addButton(button);
2570
+ });
2571
+ chart.isDirtyExporting = false;
2314
2572
  }
2315
2573
  }
2316
- chart.exporting = {
2317
- update: function (options, redraw) {
2318
- update('exporting', options, redraw);
2574
+ /**
2575
+ * Exporting module only. A collection of fixes on the produced SVG to
2576
+ * account for expando properties, browser bugs, VML problems and other.
2577
+ * Returns a cleaned SVG.
2578
+ *
2579
+ * @private
2580
+ * @function Highcharts.Chart#sanitizeSVG
2581
+ * @param {string} svg
2582
+ * SVG code to sanitize
2583
+ * @param {Highcharts.Options} options
2584
+ * Chart options to apply
2585
+ * @return {string}
2586
+ * Sanitized SVG code
2587
+ * @requires modules/exporting
2588
+ */
2589
+ function sanitizeSVG(svg, options) {
2590
+ var split = svg.indexOf('</svg>') + 6;
2591
+ var html = svg.substr(split);
2592
+ // Remove any HTML added to the container after the SVG (#894, #9087)
2593
+ svg = svg.substr(0, split);
2594
+ // Move HTML into a foreignObject
2595
+ if (options && options.exporting && options.exporting.allowHTML) {
2596
+ if (html) {
2597
+ html = '<foreignObject x="0" y="0" ' +
2598
+ 'width="' + options.chart.width + '" ' +
2599
+ 'height="' + options.chart.height + '">' +
2600
+ '<body xmlns="http://www.w3.org/1999/xhtml">' +
2601
+ // Some tags needs to be closed in xhtml (#13726)
2602
+ html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
2603
+ '</body>' +
2604
+ '</foreignObject>';
2605
+ svg = svg.replace('</svg>', html + '</svg>');
2606
+ }
2319
2607
  }
2320
- };
2321
- // Register update() method for navigation. Can not be set the same way as
2322
- // for exporting, because navigation options are shared with bindings which
2323
- // has separate update() logic.
2324
- chartNavigationMixin.addUpdate(function (options, redraw) {
2325
- update('navigation', options, redraw);
2326
- }, chart);
2327
- });
2328
- /* eslint-enable no-invalid-this */
2329
- Chart.prototype.callbacks.push(function (chart) {
2330
- chart.renderExporting();
2331
- addEvent(chart, 'redraw', chart.renderExporting);
2332
- // Destroy the export elements at chart destroy
2333
- addEvent(chart, 'destroy', chart.destroyExport);
2334
- // Uncomment this to see a button directly below the chart, for quick
2335
- // testing of export
2336
- /*
2337
- let button, viewImage, viewSource;
2338
- if (!chart.renderer.forExport) {
2339
- viewImage = function () {
2340
- let div = doc.createElement('div');
2341
- div.innerHTML = chart.getSVGForExport();
2342
- chart.renderTo.parentNode.appendChild(div);
2343
- };
2344
-
2345
- viewSource = function () {
2346
- let pre = doc.createElement('pre');
2347
- pre.innerHTML = chart.getSVGForExport()
2348
- .replace(/</g, '\n&lt;')
2349
- .replace(/>/g, '&gt;');
2350
- chart.renderTo.parentNode.appendChild(pre);
2351
- };
2352
-
2353
- viewImage();
2354
-
2355
- // View SVG Image
2356
- button = doc.createElement('button');
2357
- button.innerHTML = 'View SVG Image';
2358
- chart.renderTo.parentNode.appendChild(button);
2359
- button.onclick = viewImage;
2360
-
2361
- // View SVG Source
2362
- button = doc.createElement('button');
2363
- button.innerHTML = 'View SVG Source';
2364
- chart.renderTo.parentNode.appendChild(button);
2365
- button.onclick = viewSource;
2608
+ svg = svg
2609
+ .replace(/zIndex="[^"]+"/g, '')
2610
+ .replace(/symbolName="[^"]+"/g, '')
2611
+ .replace(/jQuery[0-9]+="[^"]+"/g, '')
2612
+ .replace(/url\(("|&quot;)(.*?)("|&quot;)\;?\)/g, 'url($2)')
2613
+ .replace(/url\([^#]+#/g, 'url(#')
2614
+ .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
2615
+ .replace(/ (|NS[0-9]+\:)href=/g, ' xlink:href=') // #3567
2616
+ .replace(/\n/, ' ')
2617
+ // Batik doesn't support rgba fills and strokes (#3095)
2618
+ .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, // eslint-disable-line max-len
2619
+ '$1="rgb($2)" $1-opacity="$3"')
2620
+ // Replace HTML entities, issue #347
2621
+ .replace(/&nbsp;/g, '\u00A0') // no-break space
2622
+ .replace(/&shy;/g, '\u00AD'); // soft hyphen
2623
+ // Further sanitize for oldIE
2624
+ if (this.ieSanitizeSVG) {
2625
+ svg = this.ieSanitizeSVG(svg);
2626
+ }
2627
+ return svg;
2366
2628
  }
2367
- //*/
2368
- });
2629
+ })(Exporting || (Exporting = {}));
2630
+ /* *
2631
+ *
2632
+ * Registry
2633
+ *
2634
+ * */
2635
+ defaultOptions.exporting = merge(ExportingDefaults.exporting, defaultOptions.exporting);
2636
+ defaultOptions.lang = merge(ExportingDefaults.lang, defaultOptions.lang);
2637
+ // Buttons and menus are collected in a separate config option set called
2638
+ // 'navigation'. This can be extended later to add control buttons like
2639
+ // zoom and pan right click menus.
2640
+ /**
2641
+ * A collection of options for buttons and menus appearing in the exporting
2642
+ * module.
2643
+ *
2644
+ * @requires modules/exporting
2645
+ * @optionparent navigation
2646
+ */
2647
+ defaultOptions.navigation = merge(ExportingDefaults.navigation, defaultOptions.navigation);
2648
+ /* *
2649
+ *
2650
+ * Default Export
2651
+ *
2652
+ * */
2369
2653
  /* *
2370
2654
  *
2371
2655
  * API Declarations
@@ -2438,10 +2722,49 @@
2438
2722
  * @typedef {"image/png"|"image/jpeg"|"application/pdf"|"image/svg+xml"} Highcharts.ExportingMimeTypeValue
2439
2723
  */
2440
2724
  (''); // keeps doclets above in transpiled file
2725
+ /* *
2726
+ *
2727
+ * API Options
2728
+ *
2729
+ * */
2730
+ /**
2731
+ * Fires after a chart is printed through the context menu item or the
2732
+ * `Chart.print` method.
2733
+ *
2734
+ * @sample highcharts/chart/events-beforeprint-afterprint/
2735
+ * Rescale the chart to print
2736
+ *
2737
+ * @type {Highcharts.ExportingAfterPrintCallbackFunction}
2738
+ * @since 4.1.0
2739
+ * @context Highcharts.Chart
2740
+ * @requires modules/exporting
2741
+ * @apioption chart.events.afterPrint
2742
+ */
2743
+ /**
2744
+ * Fires before a chart is printed through the context menu item or
2745
+ * the `Chart.print` method.
2746
+ *
2747
+ * @sample highcharts/chart/events-beforeprint-afterprint/
2748
+ * Rescale the chart to print
2749
+ *
2750
+ * @type {Highcharts.ExportingBeforePrintCallbackFunction}
2751
+ * @since 4.1.0
2752
+ * @context Highcharts.Chart
2753
+ * @requires modules/exporting
2754
+ * @apioption chart.events.beforePrint
2755
+ */
2756
+ (''); // keeps doclets above in transpiled file
2441
2757
 
2758
+ return Exporting;
2442
2759
  });
2443
- _registerModule(_modules, 'masters/modules/exporting.src.js', [], function () {
2760
+ _registerModule(_modules, 'masters/modules/exporting.src.js', [_modules['Core/Globals.js'], _modules['Extensions/Exporting/Exporting.js'], _modules['Core/HttpUtilities.js']], function (Highcharts, Exporting, HttpUtilities) {
2444
2761
 
2762
+ var G = Highcharts;
2763
+ G.HttpUtilities = HttpUtilities;
2764
+ G.ajax = HttpUtilities.ajax;
2765
+ G.getJSON = HttpUtilities.getJSON;
2766
+ G.post = HttpUtilities.post;
2767
+ Exporting.compose(G.Chart, G.Renderer);
2445
2768
 
2446
2769
  });
2447
2770
  }));