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,2024 +0,0 @@
1
- /* *
2
- *
3
- * Exporting module
4
- *
5
- * (c) 2010-2021 Torstein Honsi
6
- *
7
- * License: www.highcharts.com/license
8
- *
9
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
10
- *
11
- * */
12
- 'use strict';
13
- import Chart from '../Core/Chart/Chart.js';
14
- import chartNavigationMixin from '../Mixins/Navigation.js';
15
- import H from '../Core/Globals.js';
16
- var doc = H.doc, isTouchDevice = H.isTouchDevice, win = H.win;
17
- import D from '../Core/DefaultOptions.js';
18
- var defaultOptions = D.defaultOptions;
19
- import palette from '../Core/Color/Palette.js';
20
- import SVGRenderer from '../Core/Renderer/SVG/SVGRenderer.js';
21
- var symbols = SVGRenderer.prototype.symbols;
22
- import U from '../Core/Utilities.js';
23
- var addEvent = U.addEvent, css = U.css, createElement = U.createElement, discardElement = U.discardElement, extend = U.extend, find = U.find, fireEvent = U.fireEvent, isObject = U.isObject, merge = U.merge, objectEach = U.objectEach, pick = U.pick, removeEvent = U.removeEvent, uniqueKey = U.uniqueKey;
24
- // Add language
25
- extend(defaultOptions.lang
26
- /**
27
- * @optionparent lang
28
- */
29
- , {
30
- /**
31
- * Exporting module only. The text for the menu item to view the chart
32
- * in full screen.
33
- *
34
- * @since 8.0.1
35
- *
36
- * @private
37
- */
38
- viewFullscreen: 'View in full screen',
39
- /**
40
- * Exporting module only. The text for the menu item to exit the chart
41
- * from full screen.
42
- *
43
- * @since 8.0.1
44
- *
45
- * @private
46
- */
47
- exitFullscreen: 'Exit from full screen',
48
- /**
49
- * Exporting module only. The text for the menu item to print the chart.
50
- *
51
- * @since 3.0.1
52
- * @requires modules/exporting
53
- *
54
- * @private
55
- */
56
- printChart: 'Print chart',
57
- /**
58
- * Exporting module only. The text for the PNG download menu item.
59
- *
60
- * @since 2.0
61
- * @requires modules/exporting
62
- *
63
- * @private
64
- */
65
- downloadPNG: 'Download PNG image',
66
- /**
67
- * Exporting module only. The text for the JPEG download menu item.
68
- *
69
- * @since 2.0
70
- * @requires modules/exporting
71
- *
72
- * @private
73
- */
74
- downloadJPEG: 'Download JPEG image',
75
- /**
76
- * Exporting module only. The text for the PDF download menu item.
77
- *
78
- * @since 2.0
79
- * @requires modules/exporting
80
- *
81
- * @private
82
- */
83
- downloadPDF: 'Download PDF document',
84
- /**
85
- * Exporting module only. The text for the SVG download menu item.
86
- *
87
- * @since 2.0
88
- * @requires modules/exporting
89
- *
90
- * @private
91
- */
92
- downloadSVG: 'Download SVG vector image',
93
- /**
94
- * Exporting module menu. The tooltip title for the context menu holding
95
- * print and export menu items.
96
- *
97
- * @since 3.0
98
- * @requires modules/exporting
99
- *
100
- * @private
101
- */
102
- contextButtonTitle: 'Chart context menu'
103
- });
104
- if (!defaultOptions.navigation) {
105
- // Buttons and menus are collected in a separate config option set called
106
- // 'navigation'. This can be extended later to add control buttons like
107
- // zoom and pan right click menus.
108
- /**
109
- * A collection of options for buttons and menus appearing in the exporting
110
- * module.
111
- *
112
- * @requires modules/exporting
113
- * @optionparent navigation
114
- */
115
- defaultOptions.navigation = {};
116
- }
117
- merge(true, defaultOptions.navigation, {
118
- /**
119
- * @optionparent navigation.buttonOptions
120
- *
121
- * @private
122
- */
123
- buttonOptions: {
124
- theme: {},
125
- /**
126
- * Whether to enable buttons.
127
- *
128
- * @sample highcharts/navigation/buttonoptions-enabled/
129
- * Exporting module loaded but buttons disabled
130
- *
131
- * @type {boolean}
132
- * @default true
133
- * @since 2.0
134
- * @apioption navigation.buttonOptions.enabled
135
- */
136
- /**
137
- * The pixel size of the symbol on the button.
138
- *
139
- * @sample highcharts/navigation/buttonoptions-height/
140
- * Bigger buttons
141
- *
142
- * @since 2.0
143
- */
144
- symbolSize: 14,
145
- /**
146
- * The x position of the center of the symbol inside the button.
147
- *
148
- * @sample highcharts/navigation/buttonoptions-height/
149
- * Bigger buttons
150
- *
151
- * @since 2.0
152
- */
153
- symbolX: 12.5,
154
- /**
155
- * The y position of the center of the symbol inside the button.
156
- *
157
- * @sample highcharts/navigation/buttonoptions-height/
158
- * Bigger buttons
159
- *
160
- * @since 2.0
161
- */
162
- symbolY: 10.5,
163
- /**
164
- * Alignment for the buttons.
165
- *
166
- * @sample highcharts/navigation/buttonoptions-align/
167
- * Center aligned
168
- *
169
- * @type {Highcharts.AlignValue}
170
- * @since 2.0
171
- */
172
- align: 'right',
173
- /**
174
- * The pixel spacing between buttons.
175
- *
176
- * @since 2.0
177
- */
178
- buttonSpacing: 3,
179
- /**
180
- * Pixel height of the buttons.
181
- *
182
- * @sample highcharts/navigation/buttonoptions-height/
183
- * Bigger buttons
184
- *
185
- * @since 2.0
186
- */
187
- height: 22,
188
- /**
189
- * A text string to add to the individual button.
190
- *
191
- * @sample highcharts/exporting/buttons-text/
192
- * Full text button
193
- * @sample highcharts/exporting/buttons-text-symbol/
194
- * Combined symbol and text
195
- *
196
- * @type {string}
197
- * @default null
198
- * @since 3.0
199
- * @apioption navigation.buttonOptions.text
200
- */
201
- /**
202
- * The vertical offset of the button's position relative to its
203
- * `verticalAlign`.
204
- *
205
- * @sample highcharts/navigation/buttonoptions-verticalalign/
206
- * Buttons at lower right
207
- *
208
- * @type {number}
209
- * @default 0
210
- * @since 2.0
211
- * @apioption navigation.buttonOptions.y
212
- */
213
- /**
214
- * The vertical alignment of the buttons. Can be one of `"top"`,
215
- * `"middle"` or `"bottom"`.
216
- *
217
- * @sample highcharts/navigation/buttonoptions-verticalalign/
218
- * Buttons at lower right
219
- *
220
- * @type {Highcharts.VerticalAlignValue}
221
- * @since 2.0
222
- */
223
- verticalAlign: 'top',
224
- /**
225
- * The pixel width of the button.
226
- *
227
- * @sample highcharts/navigation/buttonoptions-height/
228
- * Bigger buttons
229
- *
230
- * @since 2.0
231
- */
232
- width: 24
233
- }
234
- });
235
- // Presentational attributes
236
- merge(true, defaultOptions.navigation,
237
- /**
238
- * A collection of options for buttons and menus appearing in the exporting
239
- * module.
240
- *
241
- * @optionparent navigation
242
- */
243
- {
244
- /**
245
- * CSS styles for the popup menu appearing by default when the export
246
- * icon is clicked. This menu is rendered in HTML.
247
- *
248
- * @see In styled mode, the menu is styled with the `.highcharts-menu`
249
- * class.
250
- *
251
- * @sample highcharts/navigation/menustyle/
252
- * Light gray menu background
253
- *
254
- * @type {Highcharts.CSSObject}
255
- * @default {"border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0"}
256
- * @since 2.0
257
- *
258
- * @private
259
- */
260
- menuStyle: {
261
- /** @ignore-option */
262
- border: "1px solid " + palette.neutralColor40,
263
- /** @ignore-option */
264
- background: palette.backgroundColor,
265
- /** @ignore-option */
266
- padding: '5px 0'
267
- },
268
- /**
269
- * CSS styles for the individual items within the popup menu appearing
270
- * by default when the export icon is clicked. The menu items are
271
- * rendered in HTML. Font size defaults to `11px` on desktop and `14px`
272
- * on touch devices.
273
- *
274
- * @see In styled mode, the menu items are styled with the
275
- * `.highcharts-menu-item` class.
276
- *
277
- * @sample {highcharts} highcharts/navigation/menuitemstyle/
278
- * Add a grey stripe to the left
279
- *
280
- * @type {Highcharts.CSSObject}
281
- * @default {"padding": "0.5em 1em", "color": "#333333", "background": "none", "fontSize": "11px/14px", "transition": "background 250ms, color 250ms"}
282
- * @since 2.0
283
- *
284
- * @private
285
- */
286
- menuItemStyle: {
287
- /** @ignore-option */
288
- padding: '0.5em 1em',
289
- /** @ignore-option */
290
- color: palette.neutralColor80,
291
- /** @ignore-option */
292
- background: 'none',
293
- /** @ignore-option */
294
- fontSize: isTouchDevice ? '14px' : '11px',
295
- /** @ignore-option */
296
- transition: 'background 250ms, color 250ms'
297
- },
298
- /**
299
- * CSS styles for the hover state of the individual items within the
300
- * popup menu appearing by default when the export icon is clicked. The
301
- * menu items are rendered in HTML.
302
- *
303
- * @see In styled mode, the menu items are styled with the
304
- * `.highcharts-menu-item` class.
305
- *
306
- * @sample highcharts/navigation/menuitemhoverstyle/
307
- * Bold text on hover
308
- *
309
- * @type {Highcharts.CSSObject}
310
- * @default {"background": "#335cad", "color": "#ffffff"}
311
- * @since 2.0
312
- *
313
- * @private
314
- */
315
- menuItemHoverStyle: {
316
- /** @ignore-option */
317
- background: palette.highlightColor80,
318
- /** @ignore-option */
319
- color: palette.backgroundColor
320
- },
321
- /**
322
- * A collection of options for buttons appearing in the exporting
323
- * module.
324
- *
325
- * In styled mode, the buttons are styled with the
326
- * `.highcharts-contextbutton` and `.highcharts-button-symbol` classes.
327
- *
328
- * @requires modules/exporting
329
- *
330
- * @private
331
- */
332
- buttonOptions: {
333
- /**
334
- * Fill color for the symbol within the button.
335
- *
336
- * @sample highcharts/navigation/buttonoptions-symbolfill/
337
- * Blue symbol stroke for one of the buttons
338
- *
339
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
340
- * @since 2.0
341
- */
342
- symbolFill: palette.neutralColor60,
343
- /**
344
- * The color of the symbol's stroke or line.
345
- *
346
- * @sample highcharts/navigation/buttonoptions-symbolstroke/
347
- * Blue symbol stroke
348
- *
349
- * @type {Highcharts.ColorString}
350
- * @since 2.0
351
- */
352
- symbolStroke: palette.neutralColor60,
353
- /**
354
- * The pixel stroke width of the symbol on the button.
355
- *
356
- * @sample highcharts/navigation/buttonoptions-height/
357
- * Bigger buttons
358
- *
359
- * @since 2.0
360
- */
361
- symbolStrokeWidth: 3,
362
- /**
363
- * A configuration object for the button theme. The object accepts
364
- * SVG properties like `stroke-width`, `stroke` and `fill`.
365
- * Tri-state button styles are supported by the `states.hover` and
366
- * `states.select` objects.
367
- *
368
- * @sample highcharts/navigation/buttonoptions-theme/
369
- * Theming the buttons
370
- *
371
- * @requires modules/exporting
372
- *
373
- * @since 3.0
374
- */
375
- theme: {
376
- /**
377
- * The default fill exists only to capture hover events.
378
- *
379
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
380
- * @default ${palette.backgroundColor}
381
- * @apioption navigation.buttonOptions.theme.fill
382
- */
383
- /**
384
- * Default stroke for the buttons.
385
- * @type {Highcharts.ColorString}
386
- * @default none
387
- * @apioption navigation.buttonOptions.theme.stroke
388
- */
389
- /**
390
- * Padding for the button.
391
- */
392
- padding: 5
393
- }
394
- }
395
- });
396
- // Add the export related options
397
- /**
398
- * Options for the exporting module. For an overview on the matter, see
399
- * [the docs](https://www.highcharts.com/docs/export-module/export-module-overview).
400
- *
401
- * @requires modules/exporting
402
- * @optionparent exporting
403
- */
404
- defaultOptions.exporting = {
405
- /**
406
- * Experimental setting to allow HTML inside the chart (added through
407
- * the `useHTML` options), directly in the exported image. This allows
408
- * you to preserve complicated HTML structures like tables or bi-directional
409
- * text in exported charts.
410
- *
411
- * Disclaimer: The HTML is rendered in a `foreignObject` tag in the
412
- * generated SVG. The official export server is based on PhantomJS,
413
- * which supports this, but other SVG clients, like Batik, does not
414
- * support it. This also applies to downloaded SVG that you want to
415
- * open in a desktop client.
416
- *
417
- * @type {boolean}
418
- * @default false
419
- * @since 4.1.8
420
- * @apioption exporting.allowHTML
421
- */
422
- /**
423
- * Additional chart options to be merged into the chart before exporting to
424
- * an image format. This does not apply to printing the chart via the export
425
- * menu.
426
- *
427
- * For example, a common use case is to add data labels to improve
428
- * readability of the exported chart, or to add a printer-friendly color
429
- * scheme to exported PDFs.
430
- *
431
- * @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
432
- * Added data labels
433
- * @sample {highstock} highcharts/exporting/chartoptions-data-labels/
434
- * Added data labels
435
- *
436
- * @type {Highcharts.Options}
437
- * @apioption exporting.chartOptions
438
- */
439
- /**
440
- * Whether to enable the exporting module. Disabling the module will
441
- * hide the context button, but API methods will still be available.
442
- *
443
- * @sample {highcharts} highcharts/exporting/enabled-false/
444
- * Exporting module is loaded but disabled
445
- * @sample {highstock} highcharts/exporting/enabled-false/
446
- * Exporting module is loaded but disabled
447
- *
448
- * @type {boolean}
449
- * @default true
450
- * @since 2.0
451
- * @apioption exporting.enabled
452
- */
453
- /**
454
- * Function to call if the offline-exporting module fails to export
455
- * a chart on the client side, and [fallbackToExportServer](
456
- * #exporting.fallbackToExportServer) is disabled. If left undefined, an
457
- * exception is thrown instead. Receives two parameters, the exporting
458
- * options, and the error from the module.
459
- *
460
- * @see [fallbackToExportServer](#exporting.fallbackToExportServer)
461
- *
462
- * @type {Highcharts.ExportingErrorCallbackFunction}
463
- * @since 5.0.0
464
- * @requires modules/exporting
465
- * @requires modules/offline-exporting
466
- * @apioption exporting.error
467
- */
468
- /**
469
- * Whether or not to fall back to the export server if the offline-exporting
470
- * module is unable to export the chart on the client side. This happens for
471
- * certain browsers, and certain features (e.g.
472
- * [allowHTML](#exporting.allowHTML)), depending on the image type exporting
473
- * to. For very complex charts, it is possible that export can fail in
474
- * browsers that don't support Blob objects, due to data URL length limits.
475
- * It is recommended to define the [exporting.error](#exporting.error)
476
- * handler if disabling fallback, in order to notify users in case export
477
- * fails.
478
- *
479
- * @type {boolean}
480
- * @default true
481
- * @since 4.1.8
482
- * @requires modules/exporting
483
- * @requires modules/offline-exporting
484
- * @apioption exporting.fallbackToExportServer
485
- */
486
- /**
487
- * The filename, without extension, to use for the exported chart.
488
- *
489
- * @sample {highcharts} highcharts/exporting/filename/
490
- * Custom file name
491
- * @sample {highstock} highcharts/exporting/filename/
492
- * Custom file name
493
- *
494
- * @type {string}
495
- * @default chart
496
- * @since 2.0
497
- * @apioption exporting.filename
498
- */
499
- /**
500
- * An object containing additional key value data for the POST form that
501
- * sends the SVG to the export server. For example, a `target` can be set to
502
- * make sure the generated image is received in another frame, or a custom
503
- * `enctype` or `encoding` can be set.
504
- *
505
- * @type {Highcharts.HTMLAttributes}
506
- * @since 3.0.8
507
- * @apioption exporting.formAttributes
508
- */
509
- /**
510
- * Path where Highcharts will look for export module dependencies to
511
- * load on demand if they don't already exist on `window`. Should currently
512
- * point to location of [CanVG](https://github.com/canvg/canvg) library,
513
- * [jsPDF](https://github.com/yWorks/jsPDF) and
514
- * [svg2pdf.js](https://github.com/yWorks/svg2pdf.js), required for client
515
- * side export in certain browsers.
516
- *
517
- * @type {string}
518
- * @default https://code.highcharts.com/{version}/lib
519
- * @since 5.0.0
520
- * @apioption exporting.libURL
521
- */
522
- /**
523
- * Analogous to [sourceWidth](#exporting.sourceWidth).
524
- *
525
- * @type {number}
526
- * @since 3.0
527
- * @apioption exporting.sourceHeight
528
- */
529
- /**
530
- * The width of the original chart when exported, unless an explicit
531
- * [chart.width](#chart.width) is set, or a pixel width is set on the
532
- * container. The width exported raster image is then multiplied by
533
- * [scale](#exporting.scale).
534
- *
535
- * @sample {highcharts} highcharts/exporting/sourcewidth/
536
- * Source size demo
537
- * @sample {highstock} highcharts/exporting/sourcewidth/
538
- * Source size demo
539
- * @sample {highmaps} maps/exporting/sourcewidth/
540
- * Source size demo
541
- *
542
- * @type {number}
543
- * @since 3.0
544
- * @apioption exporting.sourceWidth
545
- */
546
- /**
547
- * The pixel width of charts exported to PNG or JPG. As of Highcharts
548
- * 3.0, the default pixel width is a function of the [chart.width](
549
- * #chart.width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
550
- * [exporting.scale](#exporting.scale).
551
- *
552
- * @sample {highcharts} highcharts/exporting/width/
553
- * Export to 200px wide images
554
- * @sample {highstock} highcharts/exporting/width/
555
- * Export to 200px wide images
556
- *
557
- * @type {number}
558
- * @since 2.0
559
- * @apioption exporting.width
560
- */
561
- /**
562
- * Default MIME type for exporting if `chart.exportChart()` is called
563
- * without specifying a `type` option. Possible values are `image/png`,
564
- * `image/jpeg`, `application/pdf` and `image/svg+xml`.
565
- *
566
- * @type {Highcharts.ExportingMimeTypeValue}
567
- * @since 2.0
568
- */
569
- type: 'image/png',
570
- /**
571
- * The URL for the server module converting the SVG string to an image
572
- * format. By default this points to Highchart's free web service.
573
- *
574
- * @since 2.0
575
- */
576
- url: 'https://export.highcharts.com/',
577
- /**
578
- * When printing the chart from the menu item in the burger menu, if
579
- * the on-screen chart exceeds this width, it is resized. After printing
580
- * or cancelled, it is restored. The default width makes the chart
581
- * fit into typical paper format. Note that this does not affect the
582
- * chart when printing the web page as a whole.
583
- *
584
- * @since 4.2.5
585
- */
586
- printMaxWidth: 780,
587
- /**
588
- * Defines the scale or zoom factor for the exported image compared
589
- * to the on-screen display. While for instance a 600px wide chart
590
- * may look good on a website, it will look bad in print. The default
591
- * scale of 2 makes this chart export to a 1200px PNG or JPG.
592
- *
593
- * @see [chart.width](#chart.width)
594
- * @see [exporting.sourceWidth](#exporting.sourceWidth)
595
- *
596
- * @sample {highcharts} highcharts/exporting/scale/
597
- * Scale demonstrated
598
- * @sample {highstock} highcharts/exporting/scale/
599
- * Scale demonstrated
600
- * @sample {highmaps} maps/exporting/scale/
601
- * Scale demonstrated
602
- *
603
- * @since 3.0
604
- */
605
- scale: 2,
606
- /**
607
- * Options for the export related buttons, print and export. In addition
608
- * to the default buttons listed here, custom buttons can be added.
609
- * See [navigation.buttonOptions](#navigation.buttonOptions) for general
610
- * options.
611
- *
612
- * @type {Highcharts.Dictionary<*>}
613
- * @requires modules/exporting
614
- */
615
- buttons: {
616
- /**
617
- * Options for the export button.
618
- *
619
- * In styled mode, export button styles can be applied with the
620
- * `.highcharts-contextbutton` class.
621
- *
622
- * @declare Highcharts.ExportingButtonsOptionsObject
623
- * @extends navigation.buttonOptions
624
- * @requires modules/exporting
625
- */
626
- contextButton: {
627
- /**
628
- * A click handler callback to use on the button directly instead of
629
- * the popup menu.
630
- *
631
- * @sample highcharts/exporting/buttons-contextbutton-onclick/
632
- * Skip the menu and export the chart directly
633
- *
634
- * @type {Function}
635
- * @since 2.0
636
- * @apioption exporting.buttons.contextButton.onclick
637
- */
638
- /**
639
- * See [navigation.buttonOptions.symbolFill](
640
- * #navigation.buttonOptions.symbolFill).
641
- *
642
- * @type {Highcharts.ColorString}
643
- * @default #666666
644
- * @since 2.0
645
- * @apioption exporting.buttons.contextButton.symbolFill
646
- */
647
- /**
648
- * The horizontal position of the button relative to the `align`
649
- * option.
650
- *
651
- * @type {number}
652
- * @default -10
653
- * @since 2.0
654
- * @apioption exporting.buttons.contextButton.x
655
- */
656
- /**
657
- * The class name of the context button.
658
- */
659
- className: 'highcharts-contextbutton',
660
- /**
661
- * The class name of the menu appearing from the button.
662
- */
663
- menuClassName: 'highcharts-contextmenu',
664
- /**
665
- * The symbol for the button. Points to a definition function in
666
- * the `Highcharts.Renderer.symbols` collection. The default
667
- * `menu` function is part of the exporting module. Possible
668
- * values are "circle", "square", "diamond", "triangle",
669
- * "triangle-down", "menu", "menuball" or custom shape.
670
- *
671
- * @sample highcharts/exporting/buttons-contextbutton-symbol/
672
- * Use a circle for symbol
673
- * @sample highcharts/exporting/buttons-contextbutton-symbol-custom/
674
- * Custom shape as symbol
675
- *
676
- * @type {Highcharts.SymbolKeyValue|"menu"|"menuball"|string}
677
- * @since 2.0
678
- */
679
- symbol: 'menu',
680
- /**
681
- * The key to a [lang](#lang) option setting that is used for the
682
- * button's title tooltip. When the key is `contextButtonTitle`, it
683
- * refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
684
- * that defaults to "Chart context menu".
685
- *
686
- * @since 6.1.4
687
- */
688
- titleKey: 'contextButtonTitle',
689
- /**
690
- * This option is deprecated, use
691
- * [titleKey](#exporting.buttons.contextButton.titleKey) instead.
692
- *
693
- * @deprecated
694
- * @type {string}
695
- * @apioption exporting.buttons.contextButton._titleKey
696
- */
697
- /**
698
- * A collection of strings pointing to config options for the menu
699
- * items. The config options are defined in the
700
- * `menuItemDefinitions` option.
701
- *
702
- * By default, there is the "View in full screen" and "Print" menu
703
- * items, plus one menu item for each of the available export types.
704
- *
705
- * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
706
- * Menu item definitions
707
- * @sample {highstock} highcharts/exporting/menuitemdefinitions/
708
- * Menu item definitions
709
- * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
710
- * Menu item definitions
711
- *
712
- * @type {Array<string>}
713
- * @default ["viewFullscreen", "printChart", "separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG"]
714
- * @since 2.0
715
- */
716
- menuItems: [
717
- 'viewFullscreen',
718
- 'printChart',
719
- 'separator',
720
- 'downloadPNG',
721
- 'downloadJPEG',
722
- 'downloadPDF',
723
- 'downloadSVG'
724
- ]
725
- }
726
- },
727
- /**
728
- * An object consisting of definitions for the menu items in the context
729
- * menu. Each key value pair has a `key` that is referenced in the
730
- * [menuItems](#exporting.buttons.contextButton.menuItems) setting,
731
- * and a `value`, which is an object with the following properties:
732
- *
733
- * - **onclick:** The click handler for the menu item
734
- *
735
- * - **text:** The text for the menu item
736
- *
737
- * - **textKey:** If internationalization is required, the key to a language
738
- * string
739
- *
740
- * Custom text for the "exitFullScreen" can be set only in lang options
741
- * (it is not a separate button).
742
- *
743
- * @sample {highcharts} highcharts/exporting/menuitemdefinitions/
744
- * Menu item definitions
745
- * @sample {highstock} highcharts/exporting/menuitemdefinitions/
746
- * Menu item definitions
747
- * @sample {highmaps} highcharts/exporting/menuitemdefinitions/
748
- * Menu item definitions
749
- *
750
- *
751
- * @type {Highcharts.Dictionary<Highcharts.ExportingMenuObject>}
752
- * @default {"viewFullscreen": {}, "printChart": {}, "separator": {}, "downloadPNG": {}, "downloadJPEG": {}, "downloadPDF": {}, "downloadSVG": {}}
753
- * @since 5.0.13
754
- */
755
- menuItemDefinitions: {
756
- /**
757
- * @ignore
758
- */
759
- viewFullscreen: {
760
- textKey: 'viewFullscreen',
761
- onclick: function () {
762
- this.fullscreen.toggle();
763
- }
764
- },
765
- /**
766
- * @ignore
767
- */
768
- printChart: {
769
- textKey: 'printChart',
770
- onclick: function () {
771
- this.print();
772
- }
773
- },
774
- /**
775
- * @ignore
776
- */
777
- separator: {
778
- separator: true
779
- },
780
- /**
781
- * @ignore
782
- */
783
- downloadPNG: {
784
- textKey: 'downloadPNG',
785
- onclick: function () {
786
- this.exportChart();
787
- }
788
- },
789
- /**
790
- * @ignore
791
- */
792
- downloadJPEG: {
793
- textKey: 'downloadJPEG',
794
- onclick: function () {
795
- this.exportChart({
796
- type: 'image/jpeg'
797
- });
798
- }
799
- },
800
- /**
801
- * @ignore
802
- */
803
- downloadPDF: {
804
- textKey: 'downloadPDF',
805
- onclick: function () {
806
- this.exportChart({
807
- type: 'application/pdf'
808
- });
809
- }
810
- },
811
- /**
812
- * @ignore
813
- */
814
- downloadSVG: {
815
- textKey: 'downloadSVG',
816
- onclick: function () {
817
- this.exportChart({
818
- type: 'image/svg+xml'
819
- });
820
- }
821
- }
822
- }
823
- };
824
- /**
825
- * Fires after a chart is printed through the context menu item or the
826
- * `Chart.print` method.
827
- *
828
- * @sample highcharts/chart/events-beforeprint-afterprint/
829
- * Rescale the chart to print
830
- *
831
- * @type {Highcharts.ExportingAfterPrintCallbackFunction}
832
- * @since 4.1.0
833
- * @context Highcharts.Chart
834
- * @requires modules/exporting
835
- * @apioption chart.events.afterPrint
836
- */
837
- /**
838
- * Fires before a chart is printed through the context menu item or
839
- * the `Chart.print` method.
840
- *
841
- * @sample highcharts/chart/events-beforeprint-afterprint/
842
- * Rescale the chart to print
843
- *
844
- * @type {Highcharts.ExportingBeforePrintCallbackFunction}
845
- * @since 4.1.0
846
- * @context Highcharts.Chart
847
- * @requires modules/exporting
848
- * @apioption chart.events.beforePrint
849
- */
850
- /**
851
- * The post utility
852
- *
853
- * @private
854
- * @function Highcharts.post
855
- * @param {string} url
856
- * Post URL
857
- * @param {object} data
858
- * Post data
859
- * @param {Highcharts.Dictionary<string>} [formAttributes]
860
- * Additional attributes for the post request
861
- * @return {void}
862
- */
863
- H.post = function (url, data, formAttributes) {
864
- // create the form
865
- var form = createElement('form', merge({
866
- method: 'post',
867
- action: url,
868
- enctype: 'multipart/form-data'
869
- }, formAttributes), {
870
- display: 'none'
871
- }, doc.body);
872
- // add the data
873
- objectEach(data, function (val, name) {
874
- createElement('input', {
875
- type: 'hidden',
876
- name: name,
877
- value: val
878
- }, null, form);
879
- });
880
- // submit
881
- form.submit();
882
- // clean up
883
- discardElement(form);
884
- };
885
- if (H.isSafari) {
886
- H.win.matchMedia('print').addListener(function (mqlEvent) {
887
- if (!H.printingChart) {
888
- return void 0;
889
- }
890
- if (mqlEvent.matches) {
891
- H.printingChart.beforePrint();
892
- }
893
- else {
894
- H.printingChart.afterPrint();
895
- }
896
- });
897
- }
898
- extend(Chart.prototype, /** @lends Highcharts.Chart.prototype */ {
899
- /* eslint-disable no-invalid-this, valid-jsdoc */
900
- /**
901
- * Exporting module only. A collection of fixes on the produced SVG to
902
- * account for expando properties, browser bugs, VML problems and other.
903
- * Returns a cleaned SVG.
904
- *
905
- * @private
906
- * @function Highcharts.Chart#sanitizeSVG
907
- * @param {string} svg
908
- * SVG code to sanitize
909
- * @param {Highcharts.Options} options
910
- * Chart options to apply
911
- * @return {string}
912
- * Sanitized SVG code
913
- * @requires modules/exporting
914
- */
915
- sanitizeSVG: function (svg, options) {
916
- var split = svg.indexOf('</svg>') + 6, html = svg.substr(split);
917
- // Remove any HTML added to the container after the SVG (#894, #9087)
918
- svg = svg.substr(0, split);
919
- // Move HTML into a foreignObject
920
- if (options && options.exporting && options.exporting.allowHTML) {
921
- if (html) {
922
- html = '<foreignObject x="0" y="0" ' +
923
- 'width="' + options.chart.width + '" ' +
924
- 'height="' + options.chart.height + '">' +
925
- '<body xmlns="http://www.w3.org/1999/xhtml">' +
926
- // Some tags needs to be closed in xhtml (#13726)
927
- html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
928
- '</body>' +
929
- '</foreignObject>';
930
- svg = svg.replace('</svg>', html + '</svg>');
931
- }
932
- }
933
- svg = svg
934
- .replace(/zIndex="[^"]+"/g, '')
935
- .replace(/symbolName="[^"]+"/g, '')
936
- .replace(/jQuery[0-9]+="[^"]+"/g, '')
937
- .replace(/url\(("|&quot;)(.*?)("|&quot;)\;?\)/g, 'url($2)')
938
- .replace(/url\([^#]+#/g, 'url(#')
939
- .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
940
- .replace(/ (|NS[0-9]+\:)href=/g, ' xlink:href=') // #3567
941
- .replace(/\n/, ' ')
942
- // Batik doesn't support rgba fills and strokes (#3095)
943
- .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, // eslint-disable-line max-len
944
- '$1="rgb($2)" $1-opacity="$3"')
945
- // Replace HTML entities, issue #347
946
- .replace(/&nbsp;/g, '\u00A0') // no-break space
947
- .replace(/&shy;/g, '\u00AD'); // soft hyphen
948
- // Further sanitize for oldIE
949
- if (this.ieSanitizeSVG) {
950
- svg = this.ieSanitizeSVG(svg);
951
- }
952
- return svg;
953
- },
954
- /**
955
- * Return the unfiltered innerHTML of the chart container. Used as hook for
956
- * plugins. In styled mode, it also takes care of inlining CSS style rules.
957
- *
958
- * @see Chart#getSVG
959
- *
960
- * @function Highcharts.Chart#getChartHTML
961
- *
962
- * @returns {string}
963
- * The unfiltered SVG of the chart.
964
- *
965
- * @requires modules/exporting
966
- */
967
- getChartHTML: function () {
968
- if (this.styledMode) {
969
- this.inlineStyles();
970
- }
971
- return this.container.innerHTML;
972
- },
973
- /**
974
- * Return an SVG representation of the chart.
975
- *
976
- * @sample highcharts/members/chart-getsvg/
977
- * View the SVG from a button
978
- *
979
- * @function Highcharts.Chart#getSVG
980
- *
981
- * @param {Highcharts.Options} [chartOptions]
982
- * Additional chart options for the generated SVG representation. For
983
- * collections like `xAxis`, `yAxis` or `series`, the additional
984
- * options is either merged in to the original item of the same
985
- * `id`, or to the first item if a common id is not found.
986
- *
987
- * @return {string}
988
- * The SVG representation of the rendered chart.
989
- *
990
- * @fires Highcharts.Chart#event:getSVG
991
- *
992
- * @requires modules/exporting
993
- */
994
- getSVG: function (chartOptions) {
995
- var chart = this, chartCopy, sandbox, svg, seriesOptions, sourceWidth, sourceHeight, cssWidth, cssHeight,
996
- // Copy the options and add extra options
997
- options = merge(chart.options, chartOptions);
998
- // Use userOptions to make the options chain in series right (#3881)
999
- options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions && chartOptions.plotOptions);
1000
- // ... and likewise with time, avoid that undefined time properties are
1001
- // merged over legacy global time options
1002
- options.time = merge(chart.userOptions.time, chartOptions && chartOptions.time);
1003
- // create a sandbox where a new chart will be generated
1004
- sandbox = createElement('div', null, {
1005
- position: 'absolute',
1006
- top: '-9999em',
1007
- width: chart.chartWidth + 'px',
1008
- height: chart.chartHeight + 'px'
1009
- }, doc.body);
1010
- // get the source size
1011
- cssWidth = chart.renderTo.style.width;
1012
- cssHeight = chart.renderTo.style.height;
1013
- sourceWidth = options.exporting.sourceWidth ||
1014
- options.chart.width ||
1015
- (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
1016
- (options.isGantt ? 800 : 600);
1017
- sourceHeight = options.exporting.sourceHeight ||
1018
- options.chart.height ||
1019
- (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
1020
- 400;
1021
- // override some options
1022
- extend(options.chart, {
1023
- animation: false,
1024
- renderTo: sandbox,
1025
- forExport: true,
1026
- renderer: 'SVGRenderer',
1027
- width: sourceWidth,
1028
- height: sourceHeight
1029
- });
1030
- options.exporting.enabled = false; // hide buttons in print
1031
- delete options.data; // #3004
1032
- // prepare for replicating the chart
1033
- options.series = [];
1034
- chart.series.forEach(function (serie) {
1035
- seriesOptions = merge(serie.userOptions, {
1036
- animation: false,
1037
- enableMouseTracking: false,
1038
- showCheckbox: false,
1039
- visible: serie.visible
1040
- });
1041
- // Used for the navigator series that has its own option set
1042
- if (!seriesOptions.isInternal) {
1043
- options.series.push(seriesOptions);
1044
- }
1045
- });
1046
- var colls = {};
1047
- chart.axes.forEach(function (axis) {
1048
- // Assign an internal key to ensure a one-to-one mapping (#5924)
1049
- if (!axis.userOptions.internalKey) { // #6444
1050
- axis.userOptions.internalKey = uniqueKey();
1051
- }
1052
- if (!axis.options.isInternal) {
1053
- if (!colls[axis.coll]) {
1054
- colls[axis.coll] = true;
1055
- options[axis.coll] = [];
1056
- }
1057
- options[axis.coll].push(merge(axis.userOptions, {
1058
- visible: axis.visible
1059
- }));
1060
- }
1061
- });
1062
- // generate the chart copy
1063
- chartCopy = new Chart(options, chart.callback);
1064
- // Axis options and series options (#2022, #3900, #5982)
1065
- if (chartOptions) {
1066
- ['xAxis', 'yAxis', 'series'].forEach(function (coll) {
1067
- var collOptions = {};
1068
- if (chartOptions[coll]) {
1069
- collOptions[coll] = chartOptions[coll];
1070
- chartCopy.update(collOptions);
1071
- }
1072
- });
1073
- }
1074
- // Reflect axis extremes in the export (#5924)
1075
- chart.axes.forEach(function (axis) {
1076
- var axisCopy = find(chartCopy.axes, function (copy) {
1077
- return copy.options.internalKey ===
1078
- axis.userOptions.internalKey;
1079
- }), extremes = axis.getExtremes(), userMin = extremes.userMin, userMax = extremes.userMax;
1080
- if (axisCopy &&
1081
- ((typeof userMin !== 'undefined' &&
1082
- userMin !== axisCopy.min) || (typeof userMax !== 'undefined' &&
1083
- userMax !== axisCopy.max))) {
1084
- axisCopy.setExtremes(userMin, userMax, true, false);
1085
- }
1086
- });
1087
- // Get the SVG from the container's innerHTML
1088
- svg = chartCopy.getChartHTML();
1089
- fireEvent(this, 'getSVG', { chartCopy: chartCopy });
1090
- svg = chart.sanitizeSVG(svg, options);
1091
- // free up memory
1092
- options = null;
1093
- chartCopy.destroy();
1094
- discardElement(sandbox);
1095
- return svg;
1096
- },
1097
- /**
1098
- * @private
1099
- * @function Highcharts.Chart#getSVGForExport
1100
- * @param {Highcharts.ExportingOptions} options
1101
- * @param {Highcharts.Options} chartOptions
1102
- * @return {string}
1103
- * @requires modules/exporting
1104
- */
1105
- getSVGForExport: function (options, chartOptions) {
1106
- var chartExportingOptions = this.options.exporting;
1107
- return this.getSVG(merge({ chart: { borderRadius: 0 } }, chartExportingOptions.chartOptions, chartOptions, {
1108
- exporting: {
1109
- sourceWidth: ((options && options.sourceWidth) ||
1110
- chartExportingOptions.sourceWidth),
1111
- sourceHeight: ((options && options.sourceHeight) ||
1112
- chartExportingOptions.sourceHeight)
1113
- }
1114
- }));
1115
- },
1116
- /**
1117
- * Get the default file name used for exported charts. By default it creates
1118
- * a file name based on the chart title.
1119
- *
1120
- * @function Highcharts.Chart#getFilename
1121
- *
1122
- * @return {string} A file name without extension.
1123
- *
1124
- * @requires modules/exporting
1125
- */
1126
- getFilename: function () {
1127
- var s = this.userOptions.title && this.userOptions.title.text, filename = this.options.exporting.filename;
1128
- if (filename) {
1129
- return filename.replace(/\//g, '-');
1130
- }
1131
- if (typeof s === 'string') {
1132
- filename = s
1133
- .toLowerCase()
1134
- .replace(/<\/?[^>]+(>|$)/g, '') // strip HTML tags
1135
- .replace(/[\s_]+/g, '-')
1136
- .replace(/[^a-z0-9\-]/g, '') // preserve only latin
1137
- .replace(/^[\-]+/g, '') // dashes in the start
1138
- .replace(/[\-]+/g, '-') // dashes in a row
1139
- .substr(0, 24)
1140
- .replace(/[\-]+$/g, ''); // dashes in the end;
1141
- }
1142
- if (!filename || filename.length < 5) {
1143
- filename = 'chart';
1144
- }
1145
- return filename;
1146
- },
1147
- /**
1148
- * Exporting module required. Submit an SVG version of the chart to a server
1149
- * along with some parameters for conversion.
1150
- *
1151
- * @sample highcharts/members/chart-exportchart/
1152
- * Export with no options
1153
- * @sample highcharts/members/chart-exportchart-filename/
1154
- * PDF type and custom filename
1155
- * @sample highcharts/members/chart-exportchart-custom-background/
1156
- * Different chart background in export
1157
- * @sample stock/members/chart-exportchart/
1158
- * Export with Highcharts Stock
1159
- *
1160
- * @function Highcharts.Chart#exportChart
1161
- *
1162
- * @param {Highcharts.ExportingOptions} exportingOptions
1163
- * Exporting options in addition to those defined in
1164
- * [exporting](https://api.highcharts.com/highcharts/exporting).
1165
- *
1166
- * @param {Highcharts.Options} chartOptions
1167
- * Additional chart options for the exported chart. For example a
1168
- * different background color can be added here, or `dataLabels` for
1169
- * export only.
1170
- *
1171
- * @return {void}
1172
- *
1173
- * @requires modules/exporting
1174
- */
1175
- exportChart: function (exportingOptions, chartOptions) {
1176
- var svg = this.getSVGForExport(exportingOptions, chartOptions);
1177
- // merge the options
1178
- exportingOptions = merge(this.options.exporting, exportingOptions);
1179
- // do the post
1180
- H.post(exportingOptions.url, {
1181
- filename: exportingOptions.filename ? exportingOptions.filename.replace(/\//g, '-') : this.getFilename(),
1182
- type: exportingOptions.type,
1183
- // IE8 fails to post undefined correctly, so use 0
1184
- width: exportingOptions.width || 0,
1185
- scale: exportingOptions.scale,
1186
- svg: svg
1187
- }, exportingOptions.formAttributes);
1188
- },
1189
- /**
1190
- * Move the chart container(s) to another div.
1191
- *
1192
- * @function Highcharts#moveContainers
1193
- *
1194
- * @private
1195
- *
1196
- * @param {Highcharts.HTMLDOMElement} moveTo
1197
- * Move target
1198
- * @return {void}
1199
- */
1200
- moveContainers: function (moveTo) {
1201
- var chart = this;
1202
- (chart.fixedDiv ? // When scrollablePlotArea is active (#9533)
1203
- [chart.fixedDiv, chart.scrollingContainer] :
1204
- [chart.container]).forEach(function (div) {
1205
- moveTo.appendChild(div);
1206
- });
1207
- },
1208
- /**
1209
- * Prepare chart and document before printing a chart.
1210
- *
1211
- * @function Highcharts#beforePrint
1212
- *
1213
- * @private
1214
- *
1215
- * @return {void}
1216
- *
1217
- * @fires Highcharts.Chart#event:beforePrint
1218
- */
1219
- beforePrint: function () {
1220
- var chart = this, body = doc.body, printMaxWidth = chart.options.exporting.printMaxWidth, printReverseInfo = {
1221
- childNodes: body.childNodes,
1222
- origDisplay: [],
1223
- resetParams: void 0
1224
- };
1225
- var handleMaxWidth;
1226
- chart.isPrinting = true;
1227
- chart.pointer.reset(null, 0);
1228
- fireEvent(chart, 'beforePrint');
1229
- // Handle printMaxWidth
1230
- handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
1231
- if (handleMaxWidth) {
1232
- printReverseInfo.resetParams = [
1233
- chart.options.chart.width,
1234
- void 0,
1235
- false
1236
- ];
1237
- chart.setSize(printMaxWidth, void 0, false);
1238
- }
1239
- // hide all body content
1240
- [].forEach.call(printReverseInfo.childNodes, function (node, i) {
1241
- if (node.nodeType === 1) {
1242
- printReverseInfo.origDisplay[i] = node.style.display;
1243
- node.style.display = 'none';
1244
- }
1245
- });
1246
- // pull out the chart
1247
- chart.moveContainers(body);
1248
- // Storage details for undo action after printing
1249
- chart.printReverseInfo = printReverseInfo;
1250
- },
1251
- /**
1252
- * Clena up after printing a chart.
1253
- *
1254
- * @function Highcharts#afterPrint
1255
- *
1256
- * @private
1257
- *
1258
- * @param {Highcharts.Chart} chart
1259
- * Chart that was (or suppose to be) printed
1260
- * @return {void}
1261
- *
1262
- * @fires Highcharts.Chart#event:afterPrint
1263
- */
1264
- afterPrint: function () {
1265
- var chart = this;
1266
- if (!chart.printReverseInfo) {
1267
- return void 0;
1268
- }
1269
- var childNodes = chart.printReverseInfo.childNodes, origDisplay = chart.printReverseInfo.origDisplay, resetParams = chart.printReverseInfo.resetParams;
1270
- // put the chart back in
1271
- chart.moveContainers(chart.renderTo);
1272
- // restore all body content
1273
- [].forEach.call(childNodes, function (node, i) {
1274
- if (node.nodeType === 1) {
1275
- node.style.display = (origDisplay[i] || '');
1276
- }
1277
- });
1278
- chart.isPrinting = false;
1279
- // Reset printMaxWidth
1280
- if (resetParams) {
1281
- chart.setSize.apply(chart, resetParams);
1282
- }
1283
- delete chart.printReverseInfo;
1284
- delete H.printingChart;
1285
- fireEvent(chart, 'afterPrint');
1286
- },
1287
- /**
1288
- * Exporting module required. Clears away other elements in the page and
1289
- * prints the chart as it is displayed. By default, when the exporting
1290
- * module is enabled, a context button with a drop down menu in the upper
1291
- * right corner accesses this function.
1292
- *
1293
- * @sample highcharts/members/chart-print/
1294
- * Print from a HTML button
1295
- *
1296
- * @function Highcharts.Chart#print
1297
- *
1298
- * @return {void}
1299
- *
1300
- * @fires Highcharts.Chart#event:beforePrint
1301
- * @fires Highcharts.Chart#event:afterPrint
1302
- *
1303
- * @requires modules/exporting
1304
- */
1305
- print: function () {
1306
- var chart = this;
1307
- if (chart.isPrinting) { // block the button while in printing mode
1308
- return;
1309
- }
1310
- H.printingChart = chart;
1311
- if (!H.isSafari) {
1312
- chart.beforePrint();
1313
- }
1314
- // Give the browser time to draw WebGL content, an issue that randomly
1315
- // appears (at least) in Chrome ~67 on the Mac (#8708).
1316
- setTimeout(function () {
1317
- win.focus(); // #1510
1318
- win.print();
1319
- // allow the browser to prepare before reverting
1320
- if (!H.isSafari) {
1321
- setTimeout(function () {
1322
- chart.afterPrint();
1323
- }, 1000);
1324
- }
1325
- }, 1);
1326
- },
1327
- /**
1328
- * Display a popup menu for choosing the export type.
1329
- *
1330
- * @private
1331
- * @function Highcharts.Chart#contextMenu
1332
- * @param {string} className
1333
- * An identifier for the menu.
1334
- * @param {Array<string|Highcharts.ExportingMenuObject>} items
1335
- * A collection with text and onclicks for the items.
1336
- * @param {number} x
1337
- * The x position of the opener button
1338
- * @param {number} y
1339
- * The y position of the opener button
1340
- * @param {number} width
1341
- * The width of the opener button
1342
- * @param {number} height
1343
- * The height of the opener button
1344
- * @return {void}
1345
- * @requires modules/exporting
1346
- */
1347
- contextMenu: function (className, items, x, y, width, height, button) {
1348
- var chart = this, navOptions = chart.options.navigation, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, cacheName = 'cache-' + className, menu = chart[cacheName], menuPadding = Math.max(width, height), // for mouse leave detection
1349
- innerMenu, menuStyle;
1350
- // create the menu only the first time
1351
- if (!menu) {
1352
- // create a HTML element above the SVG
1353
- chart.exportContextMenu = chart[cacheName] = menu =
1354
- createElement('div', {
1355
- className: className
1356
- }, {
1357
- position: 'absolute',
1358
- zIndex: 1000,
1359
- padding: menuPadding + 'px',
1360
- pointerEvents: 'auto'
1361
- }, chart.fixedDiv || chart.container);
1362
- innerMenu = createElement('ul', { className: 'highcharts-menu' }, {
1363
- listStyle: 'none',
1364
- margin: 0,
1365
- padding: 0
1366
- }, menu);
1367
- // Presentational CSS
1368
- if (!chart.styledMode) {
1369
- css(innerMenu, extend({
1370
- MozBoxShadow: '3px 3px 10px #888',
1371
- WebkitBoxShadow: '3px 3px 10px #888',
1372
- boxShadow: '3px 3px 10px #888'
1373
- }, navOptions.menuStyle));
1374
- }
1375
- // hide on mouse out
1376
- menu.hideMenu = function () {
1377
- css(menu, { display: 'none' });
1378
- if (button) {
1379
- button.setState(0);
1380
- }
1381
- chart.openMenu = false;
1382
- // #10361, #9998
1383
- css(chart.renderTo, { overflow: 'hidden' });
1384
- css(chart.container, { overflow: 'hidden' });
1385
- U.clearTimeout(menu.hideTimer);
1386
- fireEvent(chart, 'exportMenuHidden');
1387
- };
1388
- // Hide the menu some time after mouse leave (#1357)
1389
- chart.exportEvents.push(addEvent(menu, 'mouseleave', function () {
1390
- menu.hideTimer = win.setTimeout(menu.hideMenu, 500);
1391
- }), addEvent(menu, 'mouseenter', function () {
1392
- U.clearTimeout(menu.hideTimer);
1393
- }),
1394
- // Hide it on clicking or touching outside the menu (#2258,
1395
- // #2335, #2407)
1396
- addEvent(doc, 'mouseup', function (e) {
1397
- if (!chart.pointer.inClass(e.target, className)) {
1398
- menu.hideMenu();
1399
- }
1400
- }), addEvent(menu, 'click', function () {
1401
- if (chart.openMenu) {
1402
- menu.hideMenu();
1403
- }
1404
- }));
1405
- // create the items
1406
- items.forEach(function (item) {
1407
- if (typeof item === 'string') {
1408
- item = chart.options.exporting
1409
- .menuItemDefinitions[item];
1410
- }
1411
- if (isObject(item, true)) {
1412
- var element = void 0;
1413
- if (item.separator) {
1414
- element = createElement('hr', null, null, innerMenu);
1415
- }
1416
- else {
1417
- // When chart initialized with the table,
1418
- // wrong button text displayed, #14352.
1419
- if (item.textKey === 'viewData' && chart.isDataTableVisible) {
1420
- item.textKey = 'hideData';
1421
- }
1422
- element = createElement('li', {
1423
- className: 'highcharts-menu-item',
1424
- onclick: function (e) {
1425
- if (e) { // IE7
1426
- e.stopPropagation();
1427
- }
1428
- menu.hideMenu();
1429
- if (item.onclick) {
1430
- item.onclick
1431
- .apply(chart, arguments);
1432
- }
1433
- }
1434
- }, null, innerMenu);
1435
- element.appendChild(doc.createTextNode(item.text ||
1436
- chart.options.lang[item.textKey]));
1437
- if (!chart.styledMode) {
1438
- element.onmouseover = function () {
1439
- css(this, navOptions.menuItemHoverStyle);
1440
- };
1441
- element.onmouseout = function () {
1442
- css(this, navOptions.menuItemStyle);
1443
- };
1444
- css(element, extend({
1445
- cursor: 'pointer'
1446
- }, navOptions.menuItemStyle));
1447
- }
1448
- }
1449
- // Keep references to menu divs to be able to destroy them
1450
- chart.exportDivElements.push(element);
1451
- }
1452
- });
1453
- // Keep references to menu and innerMenu div to be able to destroy
1454
- // them
1455
- chart.exportDivElements.push(innerMenu, menu);
1456
- chart.exportMenuWidth = menu.offsetWidth;
1457
- chart.exportMenuHeight = menu.offsetHeight;
1458
- }
1459
- menuStyle = { display: 'block' };
1460
- // if outside right, right align it
1461
- if (x + chart.exportMenuWidth > chartWidth) {
1462
- menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
1463
- }
1464
- else {
1465
- menuStyle.left = (x - menuPadding) + 'px';
1466
- }
1467
- // if outside bottom, bottom align it
1468
- if (y + height + chart.exportMenuHeight > chartHeight &&
1469
- button.alignOptions.verticalAlign !== 'top') {
1470
- menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
1471
- }
1472
- else {
1473
- menuStyle.top = (y + height - menuPadding) + 'px';
1474
- }
1475
- css(menu, menuStyle);
1476
- // #10361, #9998
1477
- css(chart.renderTo, { overflow: '' });
1478
- css(chart.container, { overflow: '' });
1479
- chart.openMenu = true;
1480
- fireEvent(chart, 'exportMenuShown');
1481
- },
1482
- /**
1483
- * Add the export button to the chart, with options.
1484
- *
1485
- * @private
1486
- * @function Highcharts.Chart#addButton
1487
- * @param {Highcharts.NavigationButtonOptions} options
1488
- * @return {void}
1489
- * @requires modules/exporting
1490
- */
1491
- addButton: function (options) {
1492
- var chart = this, renderer = chart.renderer, btnOptions = merge(chart.options.navigation.buttonOptions, options), onclick = btnOptions.onclick, menuItems = btnOptions.menuItems, symbol, button, symbolSize = btnOptions.symbolSize || 12;
1493
- if (!chart.btnCount) {
1494
- chart.btnCount = 0;
1495
- }
1496
- // Keeps references to the button elements
1497
- if (!chart.exportDivElements) {
1498
- chart.exportDivElements = [];
1499
- chart.exportSVGElements = [];
1500
- }
1501
- if (btnOptions.enabled === false || !btnOptions.theme) {
1502
- return;
1503
- }
1504
- var attr = btnOptions.theme, states = attr.states, hover = states && states.hover, select = states && states.select, callback;
1505
- if (!chart.styledMode) {
1506
- attr.fill = pick(attr.fill, palette.backgroundColor);
1507
- attr.stroke = pick(attr.stroke, 'none');
1508
- }
1509
- delete attr.states;
1510
- if (onclick) {
1511
- callback = function (e) {
1512
- if (e) {
1513
- e.stopPropagation();
1514
- }
1515
- onclick.call(chart, e);
1516
- };
1517
- }
1518
- else if (menuItems) {
1519
- callback = function (e) {
1520
- // consistent with onclick call (#3495)
1521
- if (e) {
1522
- e.stopPropagation();
1523
- }
1524
- chart.contextMenu(button.menuClassName, menuItems, button.translateX, button.translateY, button.width, button.height, button);
1525
- button.setState(2);
1526
- };
1527
- }
1528
- if (btnOptions.text && btnOptions.symbol) {
1529
- attr.paddingLeft = pick(attr.paddingLeft, 30);
1530
- }
1531
- else if (!btnOptions.text) {
1532
- extend(attr, {
1533
- width: btnOptions.width,
1534
- height: btnOptions.height,
1535
- padding: 0
1536
- });
1537
- }
1538
- if (!chart.styledMode) {
1539
- attr['stroke-linecap'] = 'round';
1540
- attr.fill = pick(attr.fill, palette.backgroundColor);
1541
- attr.stroke = pick(attr.stroke, 'none');
1542
- }
1543
- button = renderer
1544
- .button(btnOptions.text, 0, 0, callback, attr, hover, select)
1545
- .addClass(options.className)
1546
- .attr({
1547
- title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
1548
- });
1549
- button.menuClassName = (options.menuClassName ||
1550
- 'highcharts-menu-' + chart.btnCount++);
1551
- if (btnOptions.symbol) {
1552
- symbol = renderer
1553
- .symbol(btnOptions.symbol, btnOptions.symbolX - (symbolSize / 2), btnOptions.symbolY - (symbolSize / 2), symbolSize, symbolSize
1554
- // If symbol is an image, scale it (#7957)
1555
- , {
1556
- width: symbolSize,
1557
- height: symbolSize
1558
- })
1559
- .addClass('highcharts-button-symbol')
1560
- .attr({
1561
- zIndex: 1
1562
- })
1563
- .add(button);
1564
- if (!chart.styledMode) {
1565
- symbol.attr({
1566
- stroke: btnOptions.symbolStroke,
1567
- fill: btnOptions.symbolFill,
1568
- 'stroke-width': btnOptions.symbolStrokeWidth || 1
1569
- });
1570
- }
1571
- }
1572
- button
1573
- .add(chart.exportingGroup)
1574
- .align(extend(btnOptions, {
1575
- width: button.width,
1576
- x: pick(btnOptions.x, chart.buttonOffset) // #1654
1577
- }), true, 'spacingBox');
1578
- chart.buttonOffset += ((button.width + btnOptions.buttonSpacing) *
1579
- (btnOptions.align === 'right' ? -1 : 1));
1580
- chart.exportSVGElements.push(button, symbol);
1581
- },
1582
- /**
1583
- * Destroy the export buttons.
1584
- * @private
1585
- * @function Highcharts.Chart#destroyExport
1586
- * @param {global.Event} [e]
1587
- * @return {void}
1588
- * @requires modules/exporting
1589
- */
1590
- destroyExport: function (e) {
1591
- var chart = e ? e.target : this, exportSVGElements = chart.exportSVGElements, exportDivElements = chart.exportDivElements, exportEvents = chart.exportEvents, cacheName;
1592
- // Destroy the extra buttons added
1593
- if (exportSVGElements) {
1594
- exportSVGElements.forEach(function (elem, i) {
1595
- // Destroy and null the svg elements
1596
- if (elem) { // #1822
1597
- elem.onclick = elem.ontouchstart = null;
1598
- cacheName = 'cache-' + elem.menuClassName;
1599
- if (chart[cacheName]) {
1600
- delete chart[cacheName];
1601
- }
1602
- chart.exportSVGElements[i] = elem.destroy();
1603
- }
1604
- });
1605
- exportSVGElements.length = 0;
1606
- }
1607
- // Destroy the exporting group
1608
- if (chart.exportingGroup) {
1609
- chart.exportingGroup.destroy();
1610
- delete chart.exportingGroup;
1611
- }
1612
- // Destroy the divs for the menu
1613
- if (exportDivElements) {
1614
- exportDivElements.forEach(function (elem, i) {
1615
- // Remove the event handler
1616
- U.clearTimeout(elem.hideTimer); // #5427
1617
- removeEvent(elem, 'mouseleave');
1618
- // Remove inline events
1619
- chart.exportDivElements[i] =
1620
- elem.onmouseout =
1621
- elem.onmouseover =
1622
- elem.ontouchstart =
1623
- elem.onclick = null;
1624
- // Destroy the div by moving to garbage bin
1625
- discardElement(elem);
1626
- });
1627
- exportDivElements.length = 0;
1628
- }
1629
- if (exportEvents) {
1630
- exportEvents.forEach(function (unbind) {
1631
- unbind();
1632
- });
1633
- exportEvents.length = 0;
1634
- }
1635
- }
1636
- /* eslint-enable no-invalid-this, valid-jsdoc */
1637
- });
1638
- // These ones are translated to attributes rather than styles
1639
- SVGRenderer.prototype.inlineToAttributes = [
1640
- 'fill',
1641
- 'stroke',
1642
- 'strokeLinecap',
1643
- 'strokeLinejoin',
1644
- 'strokeWidth',
1645
- 'textAnchor',
1646
- 'x',
1647
- 'y'
1648
- ];
1649
- // These CSS properties are not inlined. Remember camelCase.
1650
- SVGRenderer.prototype.inlineBlacklist = [
1651
- /-/,
1652
- /^(clipPath|cssText|d|height|width)$/,
1653
- /^font$/,
1654
- /[lL]ogical(Width|Height)$/,
1655
- /perspective/,
1656
- /TapHighlightColor/,
1657
- /^transition/,
1658
- /^length$/ // #7700
1659
- // /^text (border|color|cursor|height|webkitBorder)/
1660
- ];
1661
- SVGRenderer.prototype.unstyledElements = [
1662
- 'clipPath',
1663
- 'defs',
1664
- 'desc'
1665
- ];
1666
- /**
1667
- * Analyze inherited styles from stylesheets and add them inline
1668
- *
1669
- * @private
1670
- * @function Highcharts.Chart#inlineStyles
1671
- * @return {void}
1672
- *
1673
- * @todo: What are the border styles for text about? In general, text has a lot
1674
- * of properties.
1675
- * @todo: Make it work with IE9 and IE10.
1676
- *
1677
- * @requires modules/exporting
1678
- */
1679
- Chart.prototype.inlineStyles = function () {
1680
- var renderer = this.renderer, inlineToAttributes = renderer.inlineToAttributes, blacklist = renderer.inlineBlacklist, whitelist = renderer.inlineWhitelist, // For IE
1681
- unstyledElements = renderer.unstyledElements, defaultStyles = {}, dummySVG, iframe, iframeDoc;
1682
- // Create an iframe where we read default styles without pollution from this
1683
- // body
1684
- iframe = doc.createElement('iframe');
1685
- css(iframe, {
1686
- width: '1px',
1687
- height: '1px',
1688
- visibility: 'hidden'
1689
- });
1690
- doc.body.appendChild(iframe);
1691
- iframeDoc = iframe.contentWindow.document;
1692
- iframeDoc.open();
1693
- iframeDoc.write('<svg xmlns="http://www.w3.org/2000/svg"></svg>');
1694
- iframeDoc.close();
1695
- /**
1696
- * Make hyphenated property names out of camelCase
1697
- * @private
1698
- * @param {string} prop
1699
- * Property name in camelCase
1700
- * @return {string}
1701
- * Hyphenated property name
1702
- */
1703
- function hyphenate(prop) {
1704
- return prop.replace(/([A-Z])/g, function (a, b) {
1705
- return '-' + b.toLowerCase();
1706
- });
1707
- }
1708
- /**
1709
- * Call this on all elements and recurse to children
1710
- * @private
1711
- * @param {Highcharts.HTMLDOMElement} node
1712
- * Element child
1713
- * @return {void}
1714
- */
1715
- function recurse(node) {
1716
- var styles, parentStyles, cssText = '', dummy, styleAttr, blacklisted, whitelisted, i;
1717
- /**
1718
- * Check computed styles and whether they are in the white/blacklist for
1719
- * styles or atttributes.
1720
- * @private
1721
- * @param {string} val
1722
- * Style value
1723
- * @param {string} prop
1724
- * Style property name
1725
- * @return {void}
1726
- */
1727
- function filterStyles(val, prop) {
1728
- // Check against whitelist & blacklist
1729
- blacklisted = whitelisted = false;
1730
- if (whitelist) {
1731
- // Styled mode in IE has a whitelist instead.
1732
- // Exclude all props not in this list.
1733
- i = whitelist.length;
1734
- while (i-- && !whitelisted) {
1735
- whitelisted = whitelist[i].test(prop);
1736
- }
1737
- blacklisted = !whitelisted;
1738
- }
1739
- // Explicitly remove empty transforms
1740
- if (prop === 'transform' && val === 'none') {
1741
- blacklisted = true;
1742
- }
1743
- i = blacklist.length;
1744
- while (i-- && !blacklisted) {
1745
- blacklisted = (blacklist[i].test(prop) ||
1746
- typeof val === 'function');
1747
- }
1748
- if (!blacklisted) {
1749
- // If parent node has the same style, it gets inherited, no need
1750
- // to inline it. Top-level props should be diffed against parent
1751
- // (#7687).
1752
- if ((parentStyles[prop] !== val ||
1753
- node.nodeName === 'svg') &&
1754
- defaultStyles[node.nodeName][prop] !== val) {
1755
- // Attributes
1756
- if (!inlineToAttributes ||
1757
- inlineToAttributes.indexOf(prop) !== -1) {
1758
- if (val) {
1759
- node.setAttribute(hyphenate(prop), val);
1760
- }
1761
- // Styles
1762
- }
1763
- else {
1764
- cssText += hyphenate(prop) + ':' + val + ';';
1765
- }
1766
- }
1767
- }
1768
- }
1769
- if (node.nodeType === 1 &&
1770
- unstyledElements.indexOf(node.nodeName) === -1) {
1771
- styles = win.getComputedStyle(node, null);
1772
- parentStyles = node.nodeName === 'svg' ?
1773
- {} :
1774
- win.getComputedStyle(node.parentNode, null);
1775
- // Get default styles from the browser so that we don't have to add
1776
- // these
1777
- if (!defaultStyles[node.nodeName]) {
1778
- /*
1779
- if (!dummySVG) {
1780
- dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
1781
- dummySVG.setAttribute('version', '1.1');
1782
- doc.body.appendChild(dummySVG);
1783
- }
1784
- */
1785
- dummySVG = iframeDoc.getElementsByTagName('svg')[0];
1786
- dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
1787
- dummySVG.appendChild(dummy);
1788
- // Copy, so we can remove the node
1789
- defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null));
1790
- // Remove default fill, otherwise text disappears when exported
1791
- if (node.nodeName === 'text') {
1792
- delete defaultStyles.text.fill;
1793
- }
1794
- dummySVG.removeChild(dummy);
1795
- }
1796
- // Loop through all styles and add them inline if they are ok
1797
- if (H.isFirefox || H.isMS) {
1798
- // Some browsers put lots of styles on the prototype
1799
- for (var p in styles) { // eslint-disable-line guard-for-in
1800
- filterStyles(styles[p], p);
1801
- }
1802
- }
1803
- else {
1804
- objectEach(styles, filterStyles);
1805
- }
1806
- // Apply styles
1807
- if (cssText) {
1808
- styleAttr = node.getAttribute('style');
1809
- node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
1810
- }
1811
- // Set default stroke width (needed at least for IE)
1812
- if (node.nodeName === 'svg') {
1813
- node.setAttribute('stroke-width', '1px');
1814
- }
1815
- if (node.nodeName === 'text') {
1816
- return;
1817
- }
1818
- // Recurse
1819
- [].forEach.call(node.children || node.childNodes, recurse);
1820
- }
1821
- }
1822
- /**
1823
- * Remove the dummy objects used to get defaults
1824
- * @private
1825
- * @return {void}
1826
- */
1827
- function tearDown() {
1828
- dummySVG.parentNode.removeChild(dummySVG);
1829
- // Remove trash from DOM that stayed after each exporting
1830
- iframe.parentNode.removeChild(iframe);
1831
- }
1832
- recurse(this.container.querySelector('svg'));
1833
- tearDown();
1834
- };
1835
- symbols.menu = function (x, y, width, height) {
1836
- var arr = [
1837
- ['M', x, y + 2.5],
1838
- ['L', x + width, y + 2.5],
1839
- ['M', x, y + height / 2 + 0.5],
1840
- ['L', x + width, y + height / 2 + 0.5],
1841
- ['M', x, y + height - 1.5],
1842
- ['L', x + width, y + height - 1.5]
1843
- ];
1844
- return arr;
1845
- };
1846
- symbols.menuball = function (x, y, width, height) {
1847
- var path = [], h = (height / 3) - 2;
1848
- 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));
1849
- return path;
1850
- };
1851
- /**
1852
- * Add the buttons on chart load
1853
- * @private
1854
- * @function Highcharts.Chart#renderExporting
1855
- * @return {void}
1856
- * @requires modules/exporting
1857
- */
1858
- Chart.prototype.renderExporting = function () {
1859
- var chart = this, exportingOptions = chart.options.exporting, buttons = exportingOptions.buttons, isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
1860
- chart.buttonOffset = 0;
1861
- if (chart.isDirtyExporting) {
1862
- chart.destroyExport();
1863
- }
1864
- if (isDirty && exportingOptions.enabled !== false) {
1865
- chart.exportEvents = [];
1866
- chart.exportingGroup = chart.exportingGroup ||
1867
- chart.renderer.g('exporting-group').attr({
1868
- zIndex: 3 // #4955, // #8392
1869
- }).add();
1870
- objectEach(buttons, function (button) {
1871
- chart.addButton(button);
1872
- });
1873
- chart.isDirtyExporting = false;
1874
- }
1875
- };
1876
- /* eslint-disable no-invalid-this */
1877
- // Add update methods to handle chart.update and chart.exporting.update and
1878
- // chart.navigation.update. These must be added to the chart instance rather
1879
- // than the Chart prototype in order to use the chart instance inside the update
1880
- // function.
1881
- addEvent(Chart, 'init', function () {
1882
- var chart = this;
1883
- /**
1884
- * @private
1885
- * @param {"exporting"|"navigation"} prop
1886
- * Property name in option root
1887
- * @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
1888
- * Options to update
1889
- * @param {boolean} [redraw=true]
1890
- * Whether to redraw
1891
- * @return {void}
1892
- */
1893
- function update(prop, options, redraw) {
1894
- chart.isDirtyExporting = true;
1895
- merge(true, chart.options[prop], options);
1896
- if (pick(redraw, true)) {
1897
- chart.redraw();
1898
- }
1899
- }
1900
- chart.exporting = {
1901
- update: function (options, redraw) {
1902
- update('exporting', options, redraw);
1903
- }
1904
- };
1905
- // Register update() method for navigation. Can not be set the same way as
1906
- // for exporting, because navigation options are shared with bindings which
1907
- // has separate update() logic.
1908
- chartNavigationMixin.addUpdate(function (options, redraw) {
1909
- update('navigation', options, redraw);
1910
- }, chart);
1911
- });
1912
- /* eslint-enable no-invalid-this */
1913
- Chart.prototype.callbacks.push(function (chart) {
1914
- chart.renderExporting();
1915
- addEvent(chart, 'redraw', chart.renderExporting);
1916
- // Destroy the export elements at chart destroy
1917
- addEvent(chart, 'destroy', chart.destroyExport);
1918
- // Uncomment this to see a button directly below the chart, for quick
1919
- // testing of export
1920
- /*
1921
- let button, viewImage, viewSource;
1922
- if (!chart.renderer.forExport) {
1923
- viewImage = function () {
1924
- let div = doc.createElement('div');
1925
- div.innerHTML = chart.getSVGForExport();
1926
- chart.renderTo.parentNode.appendChild(div);
1927
- };
1928
-
1929
- viewSource = function () {
1930
- let pre = doc.createElement('pre');
1931
- pre.innerHTML = chart.getSVGForExport()
1932
- .replace(/</g, '\n&lt;')
1933
- .replace(/>/g, '&gt;');
1934
- chart.renderTo.parentNode.appendChild(pre);
1935
- };
1936
-
1937
- viewImage();
1938
-
1939
- // View SVG Image
1940
- button = doc.createElement('button');
1941
- button.innerHTML = 'View SVG Image';
1942
- chart.renderTo.parentNode.appendChild(button);
1943
- button.onclick = viewImage;
1944
-
1945
- // View SVG Source
1946
- button = doc.createElement('button');
1947
- button.innerHTML = 'View SVG Source';
1948
- chart.renderTo.parentNode.appendChild(button);
1949
- button.onclick = viewSource;
1950
- }
1951
- //*/
1952
- });
1953
- /* *
1954
- *
1955
- * API Declarations
1956
- *
1957
- * */
1958
- /**
1959
- * Gets fired after a chart is printed through the context menu item or the
1960
- * Chart.print method.
1961
- *
1962
- * @callback Highcharts.ExportingAfterPrintCallbackFunction
1963
- *
1964
- * @param {Highcharts.Chart} chart
1965
- * The chart on which the event occured.
1966
- *
1967
- * @param {global.Event} event
1968
- * The event that occured.
1969
- */
1970
- /**
1971
- * Gets fired before a chart is printed through the context menu item or the
1972
- * Chart.print method.
1973
- *
1974
- * @callback Highcharts.ExportingBeforePrintCallbackFunction
1975
- *
1976
- * @param {Highcharts.Chart} chart
1977
- * The chart on which the event occured.
1978
- *
1979
- * @param {global.Event} event
1980
- * The event that occured.
1981
- */
1982
- /**
1983
- * Function to call if the offline-exporting module fails to export a chart on
1984
- * the client side.
1985
- *
1986
- * @callback Highcharts.ExportingErrorCallbackFunction
1987
- *
1988
- * @param {Highcharts.ExportingOptions} options
1989
- * The exporting options.
1990
- *
1991
- * @param {global.Error} err
1992
- * The error from the module.
1993
- */
1994
- /**
1995
- * Definition for a menu item in the context menu.
1996
- *
1997
- * @interface Highcharts.ExportingMenuObject
1998
- */ /**
1999
- * The text for the menu item.
2000
- *
2001
- * @name Highcharts.ExportingMenuObject#text
2002
- * @type {string|undefined}
2003
- */ /**
2004
- * If internationalization is required, the key to a language string.
2005
- *
2006
- * @name Highcharts.ExportingMenuObject#textKey
2007
- * @type {string|undefined}
2008
- */ /**
2009
- * The click handler for the menu item.
2010
- *
2011
- * @name Highcharts.ExportingMenuObject#onclick
2012
- * @type {Highcharts.EventCallbackFunction<Highcharts.Chart>|undefined}
2013
- */ /**
2014
- * Indicates a separator line instead of an item.
2015
- *
2016
- * @name Highcharts.ExportingMenuObject#separator
2017
- * @type {boolean|undefined}
2018
- */
2019
- /**
2020
- * Possible MIME types for exporting.
2021
- *
2022
- * @typedef {"image/png"|"image/jpeg"|"application/pdf"|"image/svg+xml"} Highcharts.ExportingMimeTypeValue
2023
- */
2024
- (''); // keeps doclets above in transpiled file