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
@@ -8,761 +8,36 @@
8
8
  *
9
9
  * */
10
10
  'use strict';
11
- import Axis from './Axis.js';
12
11
  import AxisDefaults from './AxisDefaults.js';
13
- import Tick from './Tick.js';
14
- import HiddenAxis from './HiddenAxis.js';
12
+ import D from '../DefaultOptions.js';
13
+ var defaultOptions = D.defaultOptions;
14
+ import H from '../Globals.js';
15
+ var noop = H.noop;
15
16
  import U from '../Utilities.js';
16
17
  var addEvent = U.addEvent, correctFloat = U.correctFloat, defined = U.defined, extend = U.extend, fireEvent = U.fireEvent, merge = U.merge, pick = U.pick, relativeLength = U.relativeLength, wrap = U.wrap;
17
- /**
18
- * @private
19
- * @class
20
- */
21
- var RadialAxis = /** @class */ (function () {
22
- function RadialAxis() {
23
- }
18
+ /* *
19
+ *
20
+ * Composition
21
+ *
22
+ * */
23
+ var RadialAxis;
24
+ (function (RadialAxis) {
24
25
  /* *
25
26
  *
26
- * Static Functions
27
+ * Declarations
27
28
  *
28
29
  * */
29
- RadialAxis.init = function (axis) {
30
- var axisProto = Axis.prototype;
31
- // Merge and set options.
32
- axis.setOptions = function (userOptions) {
33
- var options = this.options = merge(axis.constructor.defaultOptions, this.defaultPolarOptions, userOptions);
34
- // Make sure the plotBands array is instanciated for each Axis
35
- // (#2649)
36
- if (!options.plotBands) {
37
- options.plotBands = [];
38
- }
39
- fireEvent(this, 'afterSetOptions');
40
- };
41
- // Wrap the getOffset method to return zero offset for title or labels
42
- // in a radial axis.
43
- axis.getOffset = function () {
44
- // Call the Axis prototype method (the method we're in now is on the
45
- // instance)
46
- axisProto.getOffset.call(this);
47
- // Title or label offsets are not counted
48
- this.chart.axisOffset[this.side] = 0;
49
- };
50
- /**
51
- * Get the path for the axis line. This method is also referenced in the
52
- * getPlotLinePath method.
53
- *
54
- * @private
55
- *
56
- * @param {number} _lineWidth
57
- * Line width is not used.
58
- *
59
- * @param {number} [radius]
60
- * Radius of radial path.
61
- *
62
- * @param {number} [innerRadius]
63
- * Inner radius of radial path.
64
- *
65
- * @return {RadialAxisPath}
66
- */
67
- axis.getLinePath = function (_lineWidth, radius, innerRadius) {
68
- var center = this.pane.center, end, chart = this.chart, r = pick(radius, center[2] / 2 - this.offset), left = this.left || 0, top = this.top || 0, path;
69
- if (typeof innerRadius === 'undefined') {
70
- innerRadius = this.horiz ? 0 : this.center && -this.center[3] / 2;
71
- }
72
- // In case when innerSize of pane is set, it must be included
73
- if (innerRadius) {
74
- r += innerRadius;
75
- }
76
- if (this.isCircular || typeof radius !== 'undefined') {
77
- path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], r, r, {
78
- start: this.startAngleRad,
79
- end: this.endAngleRad,
80
- open: true,
81
- innerR: 0
82
- });
83
- // Bounds used to position the plotLine label next to the line
84
- // (#7117)
85
- path.xBounds = [left + center[0]];
86
- path.yBounds = [top + center[1] - r];
87
- }
88
- else {
89
- end = this.postTranslate(this.angleRad, r);
90
- path = [
91
- ['M', this.center[0] + chart.plotLeft, this.center[1] + chart.plotTop],
92
- ['L', end.x, end.y]
93
- ];
94
- }
95
- return path;
96
- };
97
- /**
98
- * Override setAxisTranslation by setting the translation to the
99
- * difference in rotation. This allows the translate method to return
100
- * angle for any given value.
101
- *
102
- * @private
103
- */
104
- axis.setAxisTranslation = function () {
105
- // Call uber method
106
- axisProto.setAxisTranslation.call(this);
107
- // Set transA and minPixelPadding
108
- if (this.center) { // it's not defined the first time
109
- if (this.isCircular) {
110
- this.transA = (this.endAngleRad - this.startAngleRad) /
111
- ((this.max - this.min) || 1);
112
- }
113
- else {
114
- // The transA here is the length of the axis, so in case
115
- // of inner radius, the length must be decreased by it
116
- this.transA = ((this.center[2] - this.center[3]) / 2) /
117
- ((this.max - this.min) || 1);
118
- }
119
- if (this.isXAxis) {
120
- this.minPixelPadding = this.transA * this.minPointOffset;
121
- }
122
- else {
123
- // This is a workaround for regression #2593, but categories
124
- // still don't position correctly.
125
- this.minPixelPadding = 0;
126
- }
127
- }
128
- };
129
- /**
130
- * In case of auto connect, add one closestPointRange to the max value
131
- * right before tickPositions are computed, so that ticks will extend
132
- * passed the real max.
133
- * @private
134
- */
135
- axis.beforeSetTickPositions = function () {
136
- // If autoConnect is true, polygonal grid lines are connected, and
137
- // one closestPointRange is added to the X axis to prevent the last
138
- // point from overlapping the first.
139
- this.autoConnect = (this.isCircular &&
140
- typeof pick(this.userMax, this.options.max) === 'undefined' &&
141
- correctFloat(this.endAngleRad - this.startAngleRad) ===
142
- correctFloat(2 * Math.PI));
143
- // This will lead to add an extra tick to xAxis in order to display
144
- // a correct range on inverted polar
145
- if (!this.isCircular && this.chart.inverted) {
146
- this.max++;
147
- }
148
- if (this.autoConnect) {
149
- this.max += ((this.categories && 1) ||
150
- this.pointRange ||
151
- this.closestPointRange ||
152
- 0); // #1197, #2260
153
- }
154
- };
155
- /**
156
- * Override the setAxisSize method to use the arc's circumference as
157
- * length. This allows tickPixelInterval to apply to pixel lengths along
158
- * the perimeter.
159
- * @private
160
- */
161
- axis.setAxisSize = function () {
162
- var center, start;
163
- axisProto.setAxisSize.call(this);
164
- if (this.isRadial) {
165
- // Set the center array
166
- this.pane.updateCenter(this);
167
- // In case when the innerSize is set in a polar chart, the axis'
168
- // center cannot be a reference to pane's center
169
- center = this.center = this.pane.center.slice();
170
- // The sector is used in Axis.translate to compute the
171
- // translation of reversed axis points (#2570)
172
- if (this.isCircular) {
173
- this.sector = this.endAngleRad - this.startAngleRad;
174
- }
175
- else {
176
- // When the pane's startAngle or the axis' angle is set then
177
- // new x and y values for vertical axis' center must be
178
- // calulated
179
- start = this.postTranslate(this.angleRad, center[3] / 2);
180
- center[0] = start.x - this.chart.plotLeft;
181
- center[1] = start.y - this.chart.plotTop;
182
- }
183
- // Axis len is used to lay out the ticks
184
- this.len = this.width = this.height =
185
- (center[2] - center[3]) * pick(this.sector, 1) / 2;
186
- }
187
- };
188
- /**
189
- * Returns the x, y coordinate of a point given by a value and a pixel
190
- * distance from center.
191
- *
192
- * @private
193
- *
194
- * @param {number} value
195
- * Point value.
196
- *
197
- * @param {number} [length]
198
- * Distance from center.
199
- *
200
- * @return {Highcharts.PositionObject}
201
- */
202
- axis.getPosition = function (value, length) {
203
- var translatedVal = this.translate(value);
204
- return this.postTranslate(this.isCircular ? translatedVal : this.angleRad, // #2848
205
- // In case when translatedVal is negative, the 0 value must be
206
- // used instead, in order to deal with lines and labels that
207
- // fall out of the visible range near the center of a pane
208
- pick(this.isCircular ?
209
- length :
210
- (translatedVal < 0 ? 0 : translatedVal), this.center[2] / 2) - this.offset);
211
- };
212
- /**
213
- * Translate from intermediate plotX (angle), plotY (axis.len - radius)
214
- * to final chart coordinates.
215
- *
216
- * @private
217
- *
218
- * @param {number} angle
219
- * Translation angle.
220
- *
221
- * @param {number} radius
222
- * Translation radius.
223
- *
224
- * @return {Highcharts.PositionObject}
225
- */
226
- axis.postTranslate = function (angle, radius) {
227
- var chart = this.chart, center = this.center;
228
- angle = this.startAngleRad + angle;
229
- return {
230
- x: chart.plotLeft + center[0] + Math.cos(angle) * radius,
231
- y: chart.plotTop + center[1] + Math.sin(angle) * radius
232
- };
233
- };
234
- /**
235
- * Find the path for plot bands along the radial axis.
236
- *
237
- * @private
238
- *
239
- * @param {number} from
240
- * From value.
241
- *
242
- * @param {number} to
243
- * To value.
244
- *
245
- * @param {Highcharts.AxisPlotBandsOptions} options
246
- * Band options.
247
- *
248
- * @return {RadialAxisPath}
249
- */
250
- axis.getPlotBandPath = function (from, to, options) {
251
- var radiusToPixels = function (radius) {
252
- if (typeof radius === 'string') {
253
- var r = parseInt(radius, 10);
254
- if (percentRegex.test(radius)) {
255
- r = (r * fullRadius) / 100;
256
- }
257
- return r;
258
- }
259
- return radius;
260
- };
261
- var center = this.center, startAngleRad = this.startAngleRad, fullRadius = center[2] / 2, offset = Math.min(this.offset, 0), left = this.left || 0, top = this.top || 0, percentRegex = /%$/, start, end, angle, xOnPerimeter, open, isCircular = this.isCircular, // X axis in a polar chart
262
- path, outerRadius = pick(radiusToPixels(options.outerRadius), fullRadius), innerRadius = radiusToPixels(options.innerRadius), thickness = pick(radiusToPixels(options.thickness), 10);
263
- // Polygonal plot bands
264
- if (this.options.gridLineInterpolation === 'polygon') {
265
- path = this.getPlotLinePath({ value: from }).concat(this.getPlotLinePath({ value: to, reverse: true }));
266
- // Circular grid bands
267
- }
268
- else {
269
- // Keep within bounds
270
- from = Math.max(from, this.min);
271
- to = Math.min(to, this.max);
272
- var transFrom = this.translate(from);
273
- var transTo = this.translate(to);
274
- // Plot bands on Y axis (radial axis) - inner and outer
275
- // radius depend on to and from
276
- if (!isCircular) {
277
- outerRadius = transFrom || 0;
278
- innerRadius = transTo || 0;
279
- }
280
- // Handle full circle
281
- if (options.shape === 'circle' || !isCircular) {
282
- start = -Math.PI / 2;
283
- end = Math.PI * 1.5;
284
- open = true;
285
- }
286
- else {
287
- start = startAngleRad + (transFrom || 0);
288
- end = startAngleRad + (transTo || 0);
289
- }
290
- outerRadius -= offset; // #5283
291
- thickness -= offset; // #5283
292
- path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], outerRadius, outerRadius, {
293
- // Math is for reversed yAxis (#3606)
294
- start: Math.min(start, end),
295
- end: Math.max(start, end),
296
- innerR: pick(innerRadius, outerRadius - thickness),
297
- open: open
298
- });
299
- // Provide positioning boxes for the label (#6406)
300
- if (isCircular) {
301
- angle = (end + start) / 2;
302
- xOnPerimeter = (left +
303
- center[0] +
304
- (center[2] / 2) * Math.cos(angle));
305
- path.xBounds = angle > -Math.PI / 2 && angle < Math.PI / 2 ?
306
- // Right hemisphere
307
- [xOnPerimeter, this.chart.plotWidth] :
308
- // Left hemisphere
309
- [0, xOnPerimeter];
310
- path.yBounds = [
311
- top + center[1] + (center[2] / 2) * Math.sin(angle)
312
- ];
313
- // Shift up or down to get the label clear of the perimeter
314
- path.yBounds[0] += ((angle > -Math.PI && angle < 0) ||
315
- (angle > Math.PI)) ? -10 : 10;
316
- }
317
- }
318
- return path;
319
- };
320
- // Find the correct end values of crosshair in polar.
321
- axis.getCrosshairPosition = function (options, x1, y1) {
322
- var axis = this, value = options.value, center = axis.pane.center, shapeArgs, end, x2, y2;
323
- if (axis.isCircular) {
324
- if (!defined(value)) {
325
- // When the snap is set to false
326
- x2 = options.chartX || 0;
327
- y2 = options.chartY || 0;
328
- value = axis.translate(Math.atan2(y2 - y1, x2 - x1) - axis.startAngleRad, true);
329
- }
330
- else if (options.point) {
331
- // When the snap is set to true
332
- shapeArgs = options.point.shapeArgs || {};
333
- if (shapeArgs.start) {
334
- // Find a true value of the point based on the
335
- // angle
336
- value = axis.chart.inverted ?
337
- axis.translate(options.point.rectPlotY, true) :
338
- options.point.x;
339
- }
340
- }
341
- end = axis.getPosition(value);
342
- x2 = end.x;
343
- y2 = end.y;
344
- }
345
- else {
346
- if (!defined(value)) {
347
- x2 = options.chartX;
348
- y2 = options.chartY;
349
- }
350
- if (defined(x2) && defined(y2)) {
351
- // Calculate radius of non-circular axis' crosshair
352
- y1 = center[1] + axis.chart.plotTop;
353
- value = axis.translate(Math.min(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), center[2] / 2) - center[3] / 2, true);
354
- }
355
- }
356
- return [value, x2 || 0, y2 || 0];
357
- };
358
- // Find the path for plot lines perpendicular to the radial axis.
359
- axis.getPlotLinePath = function (options) {
360
- var axis = this, center = axis.pane.center, chart = axis.chart, inverted = chart.inverted, value = options.value, reverse = options.reverse, end = axis.getPosition(value), background = axis.pane.options.background ?
361
- (axis.pane.options.background[0] ||
362
- axis.pane.options.background) :
363
- {}, innerRadius = background.innerRadius || '0%', outerRadius = background.outerRadius || '100%', x1 = center[0] + chart.plotLeft, y1 = center[1] + chart.plotTop, x2 = end.x, y2 = end.y, height = axis.height, isCrosshair = options.isCrosshair, paneInnerR = center[3] / 2, innerRatio, distance, a, b, otherAxis, xy, tickPositions, crossPos, path;
364
- // Crosshair logic
365
- if (isCrosshair) {
366
- // Find crosshair's position and perform destructuring
367
- // assignment
368
- crossPos = this.getCrosshairPosition(options, x1, y1);
369
- value = crossPos[0];
370
- x2 = crossPos[1];
371
- y2 = crossPos[2];
372
- }
373
- // Spokes
374
- if (axis.isCircular) {
375
- distance =
376
- Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
377
- a = (typeof innerRadius === 'string') ?
378
- relativeLength(innerRadius, 1) : (innerRadius / distance);
379
- b = (typeof outerRadius === 'string') ?
380
- relativeLength(outerRadius, 1) : (outerRadius / distance);
381
- // To ensure that gridlines won't be displayed in area
382
- // defined by innerSize in case of custom radiuses of pane's
383
- // background
384
- if (center && paneInnerR) {
385
- innerRatio = paneInnerR / distance;
386
- if (a < innerRatio) {
387
- a = innerRatio;
388
- }
389
- if (b < innerRatio) {
390
- b = innerRatio;
391
- }
392
- }
393
- path = [
394
- ['M', x1 + a * (x2 - x1), y1 - a * (y1 - y2)],
395
- ['L', x2 - (1 - b) * (x2 - x1), y2 + (1 - b) * (y1 - y2)]
396
- ];
397
- // Concentric circles
398
- }
399
- else {
400
- // Pick the right values depending if it is grid line or
401
- // crosshair
402
- value = axis.translate(value);
403
- // This is required in case when xAxis is non-circular to
404
- // prevent grid lines (or crosshairs, if enabled) from
405
- // rendering above the center after they supposed to be
406
- // displayed below the center point
407
- if (value) {
408
- if (value < 0 || value > height) {
409
- value = 0;
410
- }
411
- }
412
- if (axis.options.gridLineInterpolation === 'circle') {
413
- // A value of 0 is in the center, so it won't be
414
- // visible, but draw it anyway for update and animation
415
- // (#2366)
416
- path = axis.getLinePath(0, value, paneInnerR);
417
- // Concentric polygons
418
- }
419
- else {
420
- path = [];
421
- // Find the other axis (a circular one) in the same pane
422
- chart[inverted ? 'yAxis' : 'xAxis'].forEach(function (a) {
423
- if (a.pane === axis.pane) {
424
- otherAxis = a;
425
- }
426
- });
427
- if (otherAxis) {
428
- tickPositions = otherAxis.tickPositions;
429
- if (otherAxis.autoConnect) {
430
- tickPositions =
431
- tickPositions.concat([tickPositions[0]]);
432
- }
433
- // Reverse the positions for concatenation of polygonal
434
- // plot bands
435
- if (reverse) {
436
- tickPositions = tickPositions.slice().reverse();
437
- }
438
- if (value) {
439
- value += paneInnerR;
440
- }
441
- for (var i = 0; i < tickPositions.length; i++) {
442
- xy = otherAxis.getPosition(tickPositions[i], value);
443
- path.push(i ? ['L', xy.x, xy.y] : ['M', xy.x, xy.y]);
444
- }
445
- }
446
- }
447
- }
448
- return path;
449
- };
450
- // Find the position for the axis title, by default inside the gauge.
451
- axis.getTitlePosition = function () {
452
- var center = this.center, chart = this.chart, titleOptions = this.options.title;
453
- return {
454
- x: chart.plotLeft + center[0] + (titleOptions.x || 0),
455
- y: (chart.plotTop +
456
- center[1] -
457
- ({
458
- high: 0.5,
459
- middle: 0.25,
460
- low: 0
461
- }[titleOptions.align] *
462
- center[2]) +
463
- (titleOptions.y || 0))
464
- };
465
- };
466
- /**
467
- * Attach and return collecting function for labels in radial axis for
468
- * anti-collision.
469
- *
470
- * @private
471
- *
472
- * @return {Highcharts.ChartLabelCollectorFunction}
473
- */
474
- axis.createLabelCollector = function () {
475
- var axis = this;
476
- return function () {
477
- if (axis.isRadial &&
478
- axis.tickPositions &&
479
- // undocumented option for now, but working
480
- axis.options.labels &&
481
- axis.options.labels.allowOverlap !== true) {
482
- return axis.tickPositions
483
- .map(function (pos) {
484
- return axis.ticks[pos] && axis.ticks[pos].label;
485
- })
486
- .filter(function (label) {
487
- return Boolean(label);
488
- });
489
- }
490
- };
491
- };
492
- };
493
- /**
494
- * Augments methods for the value axis.
495
- *
496
- * @private
497
- *
498
- * @param {Highcharts.Axis} AxisClass
499
- * Axis class to extend.
500
- *
501
- * @param {Highcharts.Tick} TickClass
502
- * Tick class to use.
503
- */
504
- RadialAxis.compose = function (AxisClass, TickClass) {
505
- /* eslint-disable no-invalid-this */
506
- // Actions before axis init.
507
- addEvent(AxisClass, 'init', function (e) {
508
- var axis = this, chart = axis.chart;
509
- var inverted = chart.inverted, angular = chart.angular, polar = chart.polar, isX = axis.isXAxis, coll = axis.coll, isHidden = angular && isX, isCircular, chartOptions = chart.options, paneIndex = e.userOptions.pane || 0, pane = axis.pane = chart.pane && chart.pane[paneIndex];
510
- // Prevent changes for colorAxis
511
- if (coll === 'colorAxis') {
512
- this.isRadial = false;
513
- return;
514
- }
515
- // Before prototype.init
516
- if (angular) {
517
- if (isHidden) {
518
- HiddenAxis.init(axis);
519
- }
520
- else {
521
- RadialAxis.init(axis);
522
- }
523
- isCircular = !isX;
524
- if (isCircular) {
525
- axis.defaultPolarOptions = RadialAxis.defaultRadialGaugeOptions;
526
- }
527
- }
528
- else if (polar) {
529
- RadialAxis.init(axis);
530
- // Check which axis is circular
531
- isCircular = axis.horiz;
532
- axis.defaultPolarOptions = isCircular ?
533
- RadialAxis.defaultCircularOptions :
534
- merge(coll === 'xAxis' ?
535
- AxisDefaults.defaultXAxisOptions :
536
- AxisDefaults.defaultYAxisOptions, RadialAxis.defaultRadialOptions);
537
- // Apply the stack labels for yAxis in case of inverted chart
538
- if (inverted && coll === 'yAxis') {
539
- axis.defaultPolarOptions.stackLabels = AxisDefaults.defaultYAxisOptions.stackLabels;
540
- axis.defaultPolarOptions.reversedStacks = true;
541
- }
542
- }
543
- // Disable certain features on angular and polar axes
544
- if (angular || polar) {
545
- axis.isRadial = true;
546
- chartOptions.chart.zoomType = null;
547
- if (!axis.labelCollector) {
548
- axis.labelCollector = axis.createLabelCollector();
549
- }
550
- if (axis.labelCollector) {
551
- // Prevent overlapping axis labels (#9761)
552
- chart.labelCollectors.push(axis.labelCollector);
553
- }
554
- }
555
- else {
556
- this.isRadial = false;
557
- }
558
- // A pointer back to this axis to borrow geometry
559
- if (pane && isCircular) {
560
- pane.axis = axis;
561
- }
562
- axis.isCircular = isCircular;
563
- });
564
- addEvent(AxisClass, 'afterInit', function () {
565
- var axis = this;
566
- var chart = axis.chart, options = axis.options, isHidden = chart.angular && axis.isXAxis, pane = axis.pane, paneOptions = pane && pane.options;
567
- if (!isHidden && pane && (chart.angular || chart.polar)) {
568
- // Start and end angle options are given in degrees relative to
569
- // top, while internal computations are in radians relative to
570
- // right (like SVG).
571
- // Y axis in polar charts
572
- axis.angleRad = (options.angle || 0) * Math.PI / 180;
573
- // Gauges
574
- axis.startAngleRad =
575
- (paneOptions.startAngle - 90) * Math.PI / 180;
576
- axis.endAngleRad = (pick(paneOptions.endAngle, paneOptions.startAngle + 360) - 90) * Math.PI / 180; // Gauges
577
- axis.offset = options.offset || 0;
578
- }
579
- });
580
- // Wrap auto label align to avoid setting axis-wide rotation on radial
581
- // axes. (#4920)
582
- addEvent(AxisClass, 'autoLabelAlign', function (e) {
583
- if (this.isRadial) {
584
- e.align = void 0;
585
- e.preventDefault();
586
- }
587
- });
588
- // Remove label collector function on axis remove/update
589
- addEvent(AxisClass, 'destroy', function () {
590
- var axis = this;
591
- if (axis.chart &&
592
- axis.chart.labelCollectors) {
593
- var index = (axis.labelCollector ?
594
- axis.chart.labelCollectors.indexOf(axis.labelCollector) :
595
- -1);
596
- if (index >= 0) {
597
- axis.chart.labelCollectors.splice(index, 1);
598
- }
599
- }
600
- });
601
- addEvent(AxisClass, 'initialAxisTranslation', function () {
602
- var axis = this;
603
- if (axis.isRadial) {
604
- axis.beforeSetTickPositions();
605
- }
606
- });
607
- // Add special cases within the Tick class' methods for radial axes.
608
- addEvent(TickClass, 'afterGetPosition', function (e) {
609
- var tick = this;
610
- if (tick.axis.getPosition) {
611
- extend(e.pos, tick.axis.getPosition(this.pos));
612
- }
613
- });
614
- // Find the center position of the label based on the distance option.
615
- addEvent(TickClass, 'afterGetLabelPosition', function (e) {
616
- var tick = this, axis = tick.axis, label = tick.label;
617
- if (!label) {
618
- return;
619
- }
620
- var labelBBox = label.getBBox(), labelOptions = axis.options.labels, optionsY = labelOptions.y, ret, centerSlot = 20, // 20 degrees to each side at the top and bottom
621
- align = labelOptions.align, angle = ((axis.translate(this.pos) + axis.startAngleRad +
622
- Math.PI / 2) / Math.PI * 180) % 360, correctAngle = Math.round(angle), labelDir = 'end', // Direction of the label 'start' or 'end'
623
- reducedAngle1 = correctAngle < 0 ?
624
- correctAngle + 360 : correctAngle, reducedAngle2 = reducedAngle1, translateY = 0, translateX = 0, labelYPosCorrection = !defined(optionsY) ? -labelBBox.height * 0.3 : 0;
625
- if (axis.isRadial) { // Both X and Y axes in a polar chart
626
- ret = axis.getPosition(this.pos, (axis.center[2] / 2) +
627
- relativeLength(pick(labelOptions.distance, -25), axis.center[2] / 2, -axis.center[2] / 2));
628
- // Automatically rotated
629
- if (labelOptions.rotation === 'auto') {
630
- label.attr({
631
- rotation: angle
632
- });
633
- // Vertically centered
634
- }
635
- else if (!defined(optionsY)) {
636
- optionsY = (axis.chart.renderer
637
- .fontMetrics(label.styles && label.styles.fontSize).b -
638
- labelBBox.height / 2);
639
- }
640
- // Automatic alignment
641
- if (!defined(align)) {
642
- if (axis.isCircular) { // Y axis
643
- if (labelBBox.width >
644
- axis.len * axis.tickInterval / (axis.max - axis.min)) { // #3506
645
- centerSlot = 0;
646
- }
647
- if (angle > centerSlot && angle < 180 - centerSlot) {
648
- align = 'left'; // right hemisphere
649
- }
650
- else if (angle > 180 + centerSlot &&
651
- angle < 360 - centerSlot) {
652
- align = 'right'; // left hemisphere
653
- }
654
- else {
655
- align = 'center'; // top or bottom
656
- }
657
- }
658
- else {
659
- align = 'center';
660
- }
661
- label.attr({
662
- align: align
663
- });
664
- }
665
- // Auto alignment for solid-gauges with two labels (#10635)
666
- if (align === 'auto' &&
667
- axis.tickPositions.length === 2 &&
668
- axis.isCircular) {
669
- // Angles reduced to 0 - 90 or 180 - 270
670
- if (reducedAngle1 > 90 && reducedAngle1 < 180) {
671
- reducedAngle1 = 180 - reducedAngle1;
672
- }
673
- else if (reducedAngle1 > 270 && reducedAngle1 <= 360) {
674
- reducedAngle1 = 540 - reducedAngle1;
675
- }
676
- // Angles reduced to 0 - 180
677
- if (reducedAngle2 > 180 && reducedAngle2 <= 360) {
678
- reducedAngle2 = 360 - reducedAngle2;
679
- }
680
- if ((axis.pane.options.startAngle === correctAngle) ||
681
- (axis.pane.options.startAngle === correctAngle + 360) ||
682
- (axis.pane.options.startAngle === correctAngle - 360)) {
683
- labelDir = 'start';
684
- }
685
- if ((correctAngle >= -90 && correctAngle <= 90) ||
686
- (correctAngle >= -360 && correctAngle <= -270) ||
687
- (correctAngle >= 270 && correctAngle <= 360)) {
688
- align = (labelDir === 'start') ? 'right' : 'left';
689
- }
690
- else {
691
- align = (labelDir === 'start') ? 'left' : 'right';
692
- }
693
- // For angles beetwen (90 + n * 180) +- 20
694
- if (reducedAngle2 > 70 && reducedAngle2 < 110) {
695
- align = 'center';
696
- }
697
- // auto Y translation
698
- if (reducedAngle1 < 15 ||
699
- (reducedAngle1 >= 180 && reducedAngle1 < 195)) {
700
- translateY = labelBBox.height * 0.3;
701
- }
702
- else if (reducedAngle1 >= 15 && reducedAngle1 <= 35) {
703
- translateY = labelDir === 'start' ?
704
- 0 : labelBBox.height * 0.75;
705
- }
706
- else if (reducedAngle1 >= 195 && reducedAngle1 <= 215) {
707
- translateY = labelDir === 'start' ?
708
- labelBBox.height * 0.75 : 0;
709
- }
710
- else if (reducedAngle1 > 35 && reducedAngle1 <= 90) {
711
- translateY = labelDir === 'start' ?
712
- -labelBBox.height * 0.25 : labelBBox.height;
713
- }
714
- else if (reducedAngle1 > 215 && reducedAngle1 <= 270) {
715
- translateY = labelDir === 'start' ?
716
- labelBBox.height : -labelBBox.height * 0.25;
717
- }
718
- // auto X translation
719
- if (reducedAngle2 < 15) {
720
- translateX = labelDir === 'start' ?
721
- -labelBBox.height * 0.15 : labelBBox.height * 0.15;
722
- }
723
- else if (reducedAngle2 > 165 && reducedAngle2 <= 180) {
724
- translateX = labelDir === 'start' ?
725
- labelBBox.height * 0.15 : -labelBBox.height * 0.15;
726
- }
727
- label.attr({ align: align });
728
- label.translate(translateX, translateY + labelYPosCorrection);
729
- }
730
- e.pos.x = ret.x + (labelOptions.x || 0);
731
- e.pos.y = ret.y + (optionsY || 0);
732
- }
733
- });
734
- // Wrap the getMarkPath function to return the path of the radial marker
735
- wrap(TickClass.prototype, 'getMarkPath', function (proceed, x, y, tickLength, tickWidth, horiz, renderer) {
736
- var tick = this;
737
- var axis = tick.axis;
738
- var endPoint, ret;
739
- if (axis.isRadial) {
740
- endPoint = axis.getPosition(this.pos, axis.center[2] / 2 + tickLength);
741
- ret = [
742
- 'M',
743
- x,
744
- y,
745
- 'L',
746
- endPoint.x,
747
- endPoint.y
748
- ];
749
- }
750
- else {
751
- ret = proceed.call(this, x, y, tickLength, tickWidth, horiz, renderer);
752
- }
753
- return ret;
754
- });
755
- };
756
30
  /* *
757
31
  *
758
- * Static Properties
32
+ * Constants
759
33
  *
760
34
  * */
35
+ var composedClasses = [];
761
36
  /**
762
37
  * Circular axis around the perimeter of a polar chart.
763
38
  * @private
764
39
  */
765
- RadialAxis.defaultCircularOptions = {
40
+ var defaultCircularOptions = {
766
41
  gridLineWidth: 1,
767
42
  labels: {
768
43
  align: void 0,
@@ -782,7 +57,7 @@ var RadialAxis = /** @class */ (function () {
782
57
  * The default options extend defaultYAxisOptions.
783
58
  * @private
784
59
  */
785
- RadialAxis.defaultRadialGaugeOptions = {
60
+ var defaultRadialGaugeOptions = {
786
61
  labels: {
787
62
  align: 'center',
788
63
  x: 0,
@@ -805,7 +80,7 @@ var RadialAxis = /** @class */ (function () {
805
80
  * Radial axis, like a spoke in a polar chart.
806
81
  * @private
807
82
  */
808
- RadialAxis.defaultRadialOptions = {
83
+ var defaultRadialOptions = {
809
84
  /**
810
85
  * In a polar chart, this is the angle of the Y axis in degrees, where
811
86
  * 0 is up and 90 is right. The angle determines the position of the
@@ -856,7 +131,845 @@ var RadialAxis = /** @class */ (function () {
856
131
  rotation: 90
857
132
  }
858
133
  };
859
- return RadialAxis;
860
- }());
861
- RadialAxis.compose(Axis, Tick); // @todo move outside
134
+ /* *
135
+ *
136
+ * Functions
137
+ *
138
+ * */
139
+ /* eslint-disable valid-jsdoc */
140
+ /**
141
+ * In case of auto connect, add one closestPointRange to the max value
142
+ * right before tickPositions are computed, so that ticks will extend
143
+ * passed the real max.
144
+ * @private
145
+ */
146
+ function beforeSetTickPositions() {
147
+ // If autoConnect is true, polygonal grid lines are connected, and
148
+ // one closestPointRange is added to the X axis to prevent the last
149
+ // point from overlapping the first.
150
+ this.autoConnect = (this.isCircular &&
151
+ typeof pick(this.userMax, this.options.max) === 'undefined' &&
152
+ correctFloat(this.endAngleRad - this.startAngleRad) ===
153
+ correctFloat(2 * Math.PI));
154
+ // This will lead to add an extra tick to xAxis in order to display
155
+ // a correct range on inverted polar
156
+ if (!this.isCircular && this.chart.inverted) {
157
+ this.max++;
158
+ }
159
+ if (this.autoConnect) {
160
+ this.max += ((this.categories && 1) ||
161
+ this.pointRange ||
162
+ this.closestPointRange ||
163
+ 0); // #1197, #2260
164
+ }
165
+ }
166
+ /**
167
+ * Augments methods for the value axis.
168
+ *
169
+ * @private
170
+ *
171
+ * @param {Highcharts.Axis} AxisClass
172
+ * Axis class to extend.
173
+ *
174
+ * @param {Highcharts.Tick} TickClass
175
+ * Tick class to use.
176
+ *
177
+ * @return {Highcharts.Axis}
178
+ * Axis composition.
179
+ */
180
+ function compose(AxisClass, TickClass) {
181
+ if (composedClasses.indexOf(AxisClass) === -1) {
182
+ composedClasses.push(AxisClass);
183
+ addEvent(AxisClass, 'afterInit', onAxisAfterInit);
184
+ addEvent(AxisClass, 'autoLabelAlign', onAxisAutoLabelAlign);
185
+ addEvent(AxisClass, 'destroy', onAxisDestroy);
186
+ addEvent(AxisClass, 'init', onAxisInit);
187
+ addEvent(AxisClass, 'initialAxisTranslation', onAxisInitialAxisTranslation);
188
+ }
189
+ if (composedClasses.indexOf(TickClass) === -1) {
190
+ composedClasses.push(TickClass);
191
+ addEvent(TickClass, 'afterGetLabelPosition', onTickAfterGetLabelPosition);
192
+ addEvent(TickClass, 'afterGetPosition', onTickAfterGetPosition);
193
+ wrap(TickClass.prototype, 'getMarkPath', wrapTickGetMarkPath);
194
+ }
195
+ return AxisClass;
196
+ }
197
+ RadialAxis.compose = compose;
198
+ /**
199
+ * Attach and return collecting function for labels in radial axis for
200
+ * anti-collision.
201
+ *
202
+ * @private
203
+ *
204
+ * @return {Highcharts.ChartLabelCollectorFunction}
205
+ */
206
+ function createLabelCollector() {
207
+ var _this = this;
208
+ return function () {
209
+ if (_this.isRadial &&
210
+ _this.tickPositions &&
211
+ // undocumented option for now, but working
212
+ _this.options.labels &&
213
+ _this.options.labels.allowOverlap !== true) {
214
+ return _this.tickPositions
215
+ .map(function (pos) {
216
+ return _this.ticks[pos] && _this.ticks[pos].label;
217
+ })
218
+ .filter(function (label) {
219
+ return Boolean(label);
220
+ });
221
+ }
222
+ };
223
+ }
224
+ /**
225
+ * Creates an empty collector function.
226
+ * @private
227
+ */
228
+ function createLabelCollectorHidden() {
229
+ return noop;
230
+ }
231
+ /**
232
+ * Find the correct end values of crosshair in polar.
233
+ * @private
234
+ */
235
+ function getCrosshairPosition(options, x1, y1) {
236
+ var center = this.pane.center;
237
+ var value = options.value, shapeArgs, end, x2, y2;
238
+ if (this.isCircular) {
239
+ if (!defined(value)) {
240
+ // When the snap is set to false
241
+ x2 = options.chartX || 0;
242
+ y2 = options.chartY || 0;
243
+ value = this.translate(Math.atan2(y2 - y1, x2 - x1) - this.startAngleRad, true);
244
+ }
245
+ else if (options.point) {
246
+ // When the snap is set to true
247
+ shapeArgs = options.point.shapeArgs || {};
248
+ if (shapeArgs.start) {
249
+ // Find a true value of the point based on the
250
+ // angle
251
+ value = this.chart.inverted ?
252
+ this.translate(options.point.rectPlotY, true) :
253
+ options.point.x;
254
+ }
255
+ }
256
+ end = this.getPosition(value);
257
+ x2 = end.x;
258
+ y2 = end.y;
259
+ }
260
+ else {
261
+ if (!defined(value)) {
262
+ x2 = options.chartX;
263
+ y2 = options.chartY;
264
+ }
265
+ if (defined(x2) && defined(y2)) {
266
+ // Calculate radius of non-circular axis' crosshair
267
+ y1 = center[1] + this.chart.plotTop;
268
+ value = this.translate(Math.min(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), center[2] / 2) - center[3] / 2, true);
269
+ }
270
+ }
271
+ return [value, x2 || 0, y2 || 0];
272
+ }
273
+ /**
274
+ * Get the path for the axis line. This method is also referenced in the
275
+ * getPlotLinePath method.
276
+ *
277
+ * @private
278
+ *
279
+ * @param {number} _lineWidth
280
+ * Line width is not used.
281
+ *
282
+ * @param {number} [radius]
283
+ * Radius of radial path.
284
+ *
285
+ * @param {number} [innerRadius]
286
+ * Inner radius of radial path.
287
+ *
288
+ * @return {Highcharts.RadialAxisPath}
289
+ */
290
+ function getLinePath(_lineWidth, radius, innerRadius) {
291
+ var center = this.pane.center, chart = this.chart, left = this.left || 0, top = this.top || 0;
292
+ var end, r = pick(radius, center[2] / 2 - this.offset), path;
293
+ if (typeof innerRadius === 'undefined') {
294
+ innerRadius = this.horiz ? 0 : this.center && -this.center[3] / 2;
295
+ }
296
+ // In case when innerSize of pane is set, it must be included
297
+ if (innerRadius) {
298
+ r += innerRadius;
299
+ }
300
+ if (this.isCircular || typeof radius !== 'undefined') {
301
+ path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], r, r, {
302
+ start: this.startAngleRad,
303
+ end: this.endAngleRad,
304
+ open: true,
305
+ innerR: 0
306
+ });
307
+ // Bounds used to position the plotLine label next to the line
308
+ // (#7117)
309
+ path.xBounds = [left + center[0]];
310
+ path.yBounds = [top + center[1] - r];
311
+ }
312
+ else {
313
+ end = this.postTranslate(this.angleRad, r);
314
+ path = [
315
+ ['M', this.center[0] + chart.plotLeft, this.center[1] + chart.plotTop],
316
+ ['L', end.x, end.y]
317
+ ];
318
+ }
319
+ return path;
320
+ }
321
+ /**
322
+ * Wrap the getOffset method to return zero offset for title or labels
323
+ * in a radial axis.
324
+ */
325
+ function getOffset() {
326
+ var axisProto = this.constructor.prototype;
327
+ // Call the Axis prototype method (the method we're in now is on the
328
+ // instance)
329
+ axisProto.getOffset.call(this);
330
+ // Title or label offsets are not counted
331
+ this.chart.axisOffset[this.side] = 0;
332
+ }
333
+ /**
334
+ * Find the path for plot bands along the radial axis.
335
+ *
336
+ * @private
337
+ *
338
+ * @param {number} from
339
+ * From value.
340
+ *
341
+ * @param {number} to
342
+ * To value.
343
+ *
344
+ * @param {Highcharts.AxisPlotBandsOptions} options
345
+ * Band options.
346
+ *
347
+ * @return {Highcharts.RadialAxisPath}
348
+ */
349
+ function getPlotBandPath(from, to, options) {
350
+ var chart = this.chart, radiusToPixels = function (radius) {
351
+ if (typeof radius === 'string') {
352
+ var r = parseInt(radius, 10);
353
+ if (percentRegex.test(radius)) {
354
+ r = (r * fullRadius) / 100;
355
+ }
356
+ return r;
357
+ }
358
+ return radius;
359
+ }, center = this.center, startAngleRad = this.startAngleRad, fullRadius = center[2] / 2, offset = Math.min(this.offset, 0), left = this.left || 0, top = this.top || 0, percentRegex = /%$/, isCircular = this.isCircular; // X axis in a polar chart
360
+ var start, end, angle, xOnPerimeter, open, path, outerRadius = pick(radiusToPixels(options.outerRadius), fullRadius), innerRadius = radiusToPixels(options.innerRadius), thickness = pick(radiusToPixels(options.thickness), 10);
361
+ // Polygonal plot bands
362
+ if (this.options.gridLineInterpolation === 'polygon') {
363
+ path = this.getPlotLinePath({ value: from }).concat(this.getPlotLinePath({ value: to, reverse: true }));
364
+ // Circular grid bands
365
+ }
366
+ else {
367
+ // Keep within bounds
368
+ from = Math.max(from, this.min);
369
+ to = Math.min(to, this.max);
370
+ var transFrom = this.translate(from), transTo = this.translate(to);
371
+ // Plot bands on Y axis (radial axis) - inner and outer
372
+ // radius depend on to and from
373
+ if (!isCircular) {
374
+ outerRadius = transFrom || 0;
375
+ innerRadius = transTo || 0;
376
+ }
377
+ // Handle full circle
378
+ if (options.shape === 'circle' || !isCircular) {
379
+ start = -Math.PI / 2;
380
+ end = Math.PI * 1.5;
381
+ open = true;
382
+ }
383
+ else {
384
+ start = startAngleRad + (transFrom || 0);
385
+ end = startAngleRad + (transTo || 0);
386
+ }
387
+ outerRadius -= offset; // #5283
388
+ thickness -= offset; // #5283
389
+ path = chart.renderer.symbols.arc(left + center[0], top + center[1], outerRadius, outerRadius, {
390
+ // Math is for reversed yAxis (#3606)
391
+ start: Math.min(start, end),
392
+ end: Math.max(start, end),
393
+ innerR: pick(innerRadius, outerRadius - thickness),
394
+ open: open
395
+ });
396
+ // Provide positioning boxes for the label (#6406)
397
+ if (isCircular) {
398
+ angle = (end + start) / 2;
399
+ xOnPerimeter = (left +
400
+ center[0] +
401
+ (center[2] / 2) * Math.cos(angle));
402
+ path.xBounds = angle > -Math.PI / 2 && angle < Math.PI / 2 ?
403
+ // Right hemisphere
404
+ [xOnPerimeter, chart.plotWidth] :
405
+ // Left hemisphere
406
+ [0, xOnPerimeter];
407
+ path.yBounds = [
408
+ top + center[1] + (center[2] / 2) * Math.sin(angle)
409
+ ];
410
+ // Shift up or down to get the label clear of the perimeter
411
+ path.yBounds[0] += ((angle > -Math.PI && angle < 0) ||
412
+ (angle > Math.PI)) ? -10 : 10;
413
+ }
414
+ }
415
+ return path;
416
+ }
417
+ /**
418
+ * Find the path for plot lines perpendicular to the radial axis.
419
+ */
420
+ function getPlotLinePath(options) {
421
+ var _this = this;
422
+ var center = this.pane.center, chart = this.chart, inverted = chart.inverted, reverse = options.reverse, background = this.pane.options.background ?
423
+ (this.pane.options.background[0] ||
424
+ this.pane.options.background) :
425
+ {}, innerRadius = background.innerRadius || '0%', outerRadius = background.outerRadius || '100%', x1 = center[0] + chart.plotLeft, y1 = center[1] + chart.plotTop, height = this.height, isCrosshair = options.isCrosshair, paneInnerR = center[3] / 2;
426
+ var value = options.value, innerRatio, distance, a, b, otherAxis, xy, tickPositions, crossPos, path;
427
+ var end = this.getPosition(value);
428
+ var x2 = end.x, y2 = end.y;
429
+ // Crosshair logic
430
+ if (isCrosshair) {
431
+ // Find crosshair's position and perform destructuring
432
+ // assignment
433
+ crossPos = this.getCrosshairPosition(options, x1, y1);
434
+ value = crossPos[0];
435
+ x2 = crossPos[1];
436
+ y2 = crossPos[2];
437
+ }
438
+ // Spokes
439
+ if (this.isCircular) {
440
+ distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
441
+ a = (typeof innerRadius === 'string') ?
442
+ relativeLength(innerRadius, 1) :
443
+ (innerRadius / distance);
444
+ b = (typeof outerRadius === 'string') ?
445
+ relativeLength(outerRadius, 1) :
446
+ (outerRadius / distance);
447
+ // To ensure that gridlines won't be displayed in area
448
+ // defined by innerSize in case of custom radiuses of pane's
449
+ // background
450
+ if (center && paneInnerR) {
451
+ innerRatio = paneInnerR / distance;
452
+ if (a < innerRatio) {
453
+ a = innerRatio;
454
+ }
455
+ if (b < innerRatio) {
456
+ b = innerRatio;
457
+ }
458
+ }
459
+ path = [
460
+ ['M', x1 + a * (x2 - x1), y1 - a * (y1 - y2)],
461
+ ['L', x2 - (1 - b) * (x2 - x1), y2 + (1 - b) * (y1 - y2)]
462
+ ];
463
+ // Concentric circles
464
+ }
465
+ else {
466
+ // Pick the right values depending if it is grid line or
467
+ // crosshair
468
+ value = this.translate(value);
469
+ // This is required in case when xAxis is non-circular to
470
+ // prevent grid lines (or crosshairs, if enabled) from
471
+ // rendering above the center after they supposed to be
472
+ // displayed below the center point
473
+ if (value) {
474
+ if (value < 0 || value > height) {
475
+ value = 0;
476
+ }
477
+ }
478
+ if (this.options.gridLineInterpolation === 'circle') {
479
+ // A value of 0 is in the center, so it won't be
480
+ // visible, but draw it anyway for update and animation
481
+ // (#2366)
482
+ path = this.getLinePath(0, value, paneInnerR);
483
+ // Concentric polygons
484
+ }
485
+ else {
486
+ path = [];
487
+ // Find the other axis (a circular one) in the same pane
488
+ chart[inverted ? 'yAxis' : 'xAxis'].forEach(function (a) {
489
+ if (a.pane === _this.pane) {
490
+ otherAxis = a;
491
+ }
492
+ });
493
+ if (otherAxis) {
494
+ tickPositions = otherAxis.tickPositions;
495
+ if (otherAxis.autoConnect) {
496
+ tickPositions =
497
+ tickPositions.concat([tickPositions[0]]);
498
+ }
499
+ // Reverse the positions for concatenation of polygonal
500
+ // plot bands
501
+ if (reverse) {
502
+ tickPositions = tickPositions.slice().reverse();
503
+ }
504
+ if (value) {
505
+ value += paneInnerR;
506
+ }
507
+ for (var i = 0; i < tickPositions.length; i++) {
508
+ xy = otherAxis.getPosition(tickPositions[i], value);
509
+ path.push(i ? ['L', xy.x, xy.y] : ['M', xy.x, xy.y]);
510
+ }
511
+ }
512
+ }
513
+ }
514
+ return path;
515
+ }
516
+ /**
517
+ * Returns the x, y coordinate of a point given by a value and a pixel
518
+ * distance from center.
519
+ *
520
+ * @private
521
+ *
522
+ * @param {number} value
523
+ * Point value.
524
+ *
525
+ * @param {number} [length]
526
+ * Distance from center.
527
+ *
528
+ * @return {Highcharts.PositionObject}
529
+ */
530
+ function getPosition(value, length) {
531
+ var translatedVal = this.translate(value);
532
+ return this.postTranslate(this.isCircular ? translatedVal : this.angleRad, // #2848
533
+ // In case when translatedVal is negative, the 0 value must be
534
+ // used instead, in order to deal with lines and labels that
535
+ // fall out of the visible range near the center of a pane
536
+ pick(this.isCircular ?
537
+ length :
538
+ (translatedVal < 0 ? 0 : translatedVal), this.center[2] / 2) - this.offset);
539
+ }
540
+ /**
541
+ * Find the position for the axis title, by default inside the gauge.
542
+ */
543
+ function getTitlePosition() {
544
+ var center = this.center, chart = this.chart, titleOptions = this.options.title;
545
+ return {
546
+ x: chart.plotLeft + center[0] + (titleOptions.x || 0),
547
+ y: (chart.plotTop +
548
+ center[1] -
549
+ ({
550
+ high: 0.5,
551
+ middle: 0.25,
552
+ low: 0
553
+ }[titleOptions.align] *
554
+ center[2]) +
555
+ (titleOptions.y || 0))
556
+ };
557
+ }
558
+ /**
559
+ * Modify radial axis.
560
+ * @private
561
+ *
562
+ * @param {Highcharts.Axis} radialAxis
563
+ * Radial axis to modify.
564
+ */
565
+ function modify(axis) {
566
+ axis.beforeSetTickPositions = beforeSetTickPositions;
567
+ axis.createLabelCollector = createLabelCollector;
568
+ axis.getCrosshairPosition = getCrosshairPosition;
569
+ axis.getLinePath = getLinePath;
570
+ axis.getOffset = getOffset;
571
+ axis.getPlotBandPath = getPlotBandPath;
572
+ axis.getPlotLinePath = getPlotLinePath;
573
+ axis.getPosition = getPosition;
574
+ axis.getTitlePosition = getTitlePosition;
575
+ axis.postTranslate = postTranslate;
576
+ axis.setAxisSize = setAxisSize;
577
+ axis.setAxisTranslation = setAxisTranslation;
578
+ axis.setOptions = setOptions;
579
+ }
580
+ /**
581
+ * Modify radial axis as hidden.
582
+ * @private
583
+ *
584
+ * @param {Highcharts.Axis} radialAxis
585
+ * Radial axis to modify.
586
+ */
587
+ function modifyAsHidden(radialAxis) {
588
+ radialAxis.isHidden = true;
589
+ radialAxis.createLabelCollector = createLabelCollectorHidden;
590
+ radialAxis.getOffset = noop;
591
+ radialAxis.redraw = renderHidden;
592
+ radialAxis.render = renderHidden;
593
+ radialAxis.setScale = noop;
594
+ radialAxis.setCategories = noop;
595
+ radialAxis.setTitle = noop;
596
+ }
597
+ /**
598
+ * Finalize modification of axis instance with radial logic.
599
+ */
600
+ function onAxisAfterInit() {
601
+ var chart = this.chart, options = this.options, isHidden = chart.angular && this.isXAxis, pane = this.pane, paneOptions = pane && pane.options;
602
+ if (!isHidden && pane && (chart.angular || chart.polar)) {
603
+ // Start and end angle options are given in degrees relative to
604
+ // top, while internal computations are in radians relative to
605
+ // right (like SVG).
606
+ // Y axis in polar charts
607
+ this.angleRad = (options.angle || 0) * Math.PI / 180;
608
+ // Gauges
609
+ this.startAngleRad =
610
+ (paneOptions.startAngle - 90) * Math.PI / 180;
611
+ this.endAngleRad = (pick(paneOptions.endAngle, paneOptions.startAngle + 360) - 90) * Math.PI / 180; // Gauges
612
+ this.offset = options.offset || 0;
613
+ }
614
+ }
615
+ /**
616
+ * Wrap auto label align to avoid setting axis-wide rotation on radial axes.
617
+ * (#4920)
618
+ */
619
+ function onAxisAutoLabelAlign(e) {
620
+ if (this.isRadial) {
621
+ e.align = void 0;
622
+ e.preventDefault();
623
+ }
624
+ }
625
+ /**
626
+ * Remove label collector function on axis remove/update.
627
+ */
628
+ function onAxisDestroy() {
629
+ if (this.chart &&
630
+ this.chart.labelCollectors) {
631
+ var index = (this.labelCollector ?
632
+ this.chart.labelCollectors.indexOf(this.labelCollector) :
633
+ -1);
634
+ if (index >= 0) {
635
+ this.chart.labelCollectors.splice(index, 1);
636
+ }
637
+ }
638
+ }
639
+ /**
640
+ * Modify axis instance with radial logic before common axis init.
641
+ */
642
+ function onAxisInit(e) {
643
+ var chart = this.chart, inverted = chart.inverted, angular = chart.angular, polar = chart.polar, isX = this.isXAxis, coll = this.coll, isHidden = angular && isX, chartOptions = chart.options, paneIndex = e.userOptions.pane || 0, pane = this.pane = chart.pane && chart.pane[paneIndex];
644
+ var isCircular;
645
+ // Prevent changes for colorAxis
646
+ if (coll === 'colorAxis') {
647
+ this.isRadial = false;
648
+ return;
649
+ }
650
+ // Before prototype.init
651
+ if (angular) {
652
+ if (isHidden) {
653
+ modifyAsHidden(this);
654
+ }
655
+ else {
656
+ modify(this);
657
+ }
658
+ isCircular = !isX;
659
+ if (isCircular) {
660
+ this.defaultPolarOptions = defaultRadialGaugeOptions;
661
+ }
662
+ }
663
+ else if (polar) {
664
+ modify(this);
665
+ // Check which axis is circular
666
+ isCircular = this.horiz;
667
+ this.defaultPolarOptions = isCircular ?
668
+ defaultCircularOptions :
669
+ merge(coll === 'xAxis' ?
670
+ AxisDefaults.defaultXAxisOptions :
671
+ AxisDefaults.defaultYAxisOptions, defaultRadialOptions);
672
+ // Apply the stack labels for yAxis in case of inverted chart
673
+ if (inverted && coll === 'yAxis') {
674
+ this.defaultPolarOptions.stackLabels = AxisDefaults.defaultYAxisOptions.stackLabels;
675
+ this.defaultPolarOptions.reversedStacks = true;
676
+ }
677
+ }
678
+ // Disable certain features on angular and polar axes
679
+ if (angular || polar) {
680
+ this.isRadial = true;
681
+ chartOptions.chart.zoomType = null;
682
+ if (!this.labelCollector) {
683
+ this.labelCollector = this.createLabelCollector();
684
+ }
685
+ if (this.labelCollector) {
686
+ // Prevent overlapping axis labels (#9761)
687
+ chart.labelCollectors.push(this.labelCollector);
688
+ }
689
+ }
690
+ else {
691
+ this.isRadial = false;
692
+ }
693
+ // A pointer back to this axis to borrow geometry
694
+ if (pane && isCircular) {
695
+ pane.axis = this;
696
+ }
697
+ this.isCircular = isCircular;
698
+ }
699
+ /**
700
+ * Prepare axis translation.
701
+ */
702
+ function onAxisInitialAxisTranslation() {
703
+ if (this.isRadial) {
704
+ this.beforeSetTickPositions();
705
+ }
706
+ }
707
+ /**
708
+ * Find the center position of the label based on the distance option.
709
+ */
710
+ function onTickAfterGetLabelPosition(e) {
711
+ var label = this.label;
712
+ if (!label) {
713
+ return;
714
+ }
715
+ var axis = this.axis, labelBBox = label.getBBox(), labelOptions = axis.options.labels, angle = ((axis.translate(this.pos) + axis.startAngleRad +
716
+ Math.PI / 2) / Math.PI * 180) % 360, correctAngle = Math.round(angle), labelYPosCorrection = !defined(labelOptions.y) ? -labelBBox.height * 0.3 : 0;
717
+ var optionsY = labelOptions.y, ret, centerSlot = 20, // 20 degrees to each side at the top and bottom
718
+ align = labelOptions.align, labelDir = 'end', // Direction of the label 'start' or 'end'
719
+ reducedAngle1 = correctAngle < 0 ?
720
+ correctAngle + 360 : correctAngle, reducedAngle2 = reducedAngle1, translateY = 0, translateX = 0;
721
+ if (axis.isRadial) { // Both X and Y axes in a polar chart
722
+ ret = axis.getPosition(this.pos, (axis.center[2] / 2) +
723
+ relativeLength(pick(labelOptions.distance, -25), axis.center[2] / 2, -axis.center[2] / 2));
724
+ // Automatically rotated
725
+ if (labelOptions.rotation === 'auto') {
726
+ label.attr({
727
+ rotation: angle
728
+ });
729
+ // Vertically centered
730
+ }
731
+ else if (!defined(optionsY)) {
732
+ optionsY = (axis.chart.renderer
733
+ .fontMetrics(label.styles && label.styles.fontSize).b -
734
+ labelBBox.height / 2);
735
+ }
736
+ // Automatic alignment
737
+ if (!defined(align)) {
738
+ if (axis.isCircular) { // Y axis
739
+ if (labelBBox.width >
740
+ axis.len * axis.tickInterval / (axis.max - axis.min)) { // #3506
741
+ centerSlot = 0;
742
+ }
743
+ if (angle > centerSlot && angle < 180 - centerSlot) {
744
+ align = 'left'; // right hemisphere
745
+ }
746
+ else if (angle > 180 + centerSlot &&
747
+ angle < 360 - centerSlot) {
748
+ align = 'right'; // left hemisphere
749
+ }
750
+ else {
751
+ align = 'center'; // top or bottom
752
+ }
753
+ }
754
+ else {
755
+ align = 'center';
756
+ }
757
+ label.attr({
758
+ align: align
759
+ });
760
+ }
761
+ // Auto alignment for solid-gauges with two labels (#10635)
762
+ if (align === 'auto' &&
763
+ axis.tickPositions.length === 2 &&
764
+ axis.isCircular) {
765
+ // Angles reduced to 0 - 90 or 180 - 270
766
+ if (reducedAngle1 > 90 && reducedAngle1 < 180) {
767
+ reducedAngle1 = 180 - reducedAngle1;
768
+ }
769
+ else if (reducedAngle1 > 270 && reducedAngle1 <= 360) {
770
+ reducedAngle1 = 540 - reducedAngle1;
771
+ }
772
+ // Angles reduced to 0 - 180
773
+ if (reducedAngle2 > 180 && reducedAngle2 <= 360) {
774
+ reducedAngle2 = 360 - reducedAngle2;
775
+ }
776
+ if ((axis.pane.options.startAngle === correctAngle) ||
777
+ (axis.pane.options.startAngle === correctAngle + 360) ||
778
+ (axis.pane.options.startAngle === correctAngle - 360)) {
779
+ labelDir = 'start';
780
+ }
781
+ if ((correctAngle >= -90 && correctAngle <= 90) ||
782
+ (correctAngle >= -360 && correctAngle <= -270) ||
783
+ (correctAngle >= 270 && correctAngle <= 360)) {
784
+ align = (labelDir === 'start') ? 'right' : 'left';
785
+ }
786
+ else {
787
+ align = (labelDir === 'start') ? 'left' : 'right';
788
+ }
789
+ // For angles beetwen (90 + n * 180) +- 20
790
+ if (reducedAngle2 > 70 && reducedAngle2 < 110) {
791
+ align = 'center';
792
+ }
793
+ // auto Y translation
794
+ if (reducedAngle1 < 15 ||
795
+ (reducedAngle1 >= 180 && reducedAngle1 < 195)) {
796
+ translateY = labelBBox.height * 0.3;
797
+ }
798
+ else if (reducedAngle1 >= 15 && reducedAngle1 <= 35) {
799
+ translateY = labelDir === 'start' ?
800
+ 0 : labelBBox.height * 0.75;
801
+ }
802
+ else if (reducedAngle1 >= 195 && reducedAngle1 <= 215) {
803
+ translateY = labelDir === 'start' ?
804
+ labelBBox.height * 0.75 : 0;
805
+ }
806
+ else if (reducedAngle1 > 35 && reducedAngle1 <= 90) {
807
+ translateY = labelDir === 'start' ?
808
+ -labelBBox.height * 0.25 : labelBBox.height;
809
+ }
810
+ else if (reducedAngle1 > 215 && reducedAngle1 <= 270) {
811
+ translateY = labelDir === 'start' ?
812
+ labelBBox.height : -labelBBox.height * 0.25;
813
+ }
814
+ // auto X translation
815
+ if (reducedAngle2 < 15) {
816
+ translateX = labelDir === 'start' ?
817
+ -labelBBox.height * 0.15 : labelBBox.height * 0.15;
818
+ }
819
+ else if (reducedAngle2 > 165 && reducedAngle2 <= 180) {
820
+ translateX = labelDir === 'start' ?
821
+ labelBBox.height * 0.15 : -labelBBox.height * 0.15;
822
+ }
823
+ label.attr({ align: align });
824
+ label.translate(translateX, translateY + labelYPosCorrection);
825
+ }
826
+ e.pos.x = ret.x + (labelOptions.x || 0);
827
+ e.pos.y = ret.y + (optionsY || 0);
828
+ }
829
+ }
830
+ /**
831
+ * Add special cases within the Tick class' methods for radial axes.
832
+ */
833
+ function onTickAfterGetPosition(e) {
834
+ if (this.axis.getPosition) {
835
+ extend(e.pos, this.axis.getPosition(this.pos));
836
+ }
837
+ }
838
+ /**
839
+ * Translate from intermediate plotX (angle), plotY (axis.len - radius)
840
+ * to final chart coordinates.
841
+ *
842
+ * @private
843
+ *
844
+ * @param {number} angle
845
+ * Translation angle.
846
+ *
847
+ * @param {number} radius
848
+ * Translation radius.
849
+ *
850
+ * @return {Highcharts.PositionObject}
851
+ */
852
+ function postTranslate(angle, radius) {
853
+ var chart = this.chart, center = this.center;
854
+ angle = this.startAngleRad + angle;
855
+ return {
856
+ x: chart.plotLeft + center[0] + Math.cos(angle) * radius,
857
+ y: chart.plotTop + center[1] + Math.sin(angle) * radius
858
+ };
859
+ }
860
+ /**
861
+ * Prevent setting Y axis dirty.
862
+ */
863
+ function renderHidden() {
864
+ this.isDirty = false;
865
+ }
866
+ /**
867
+ * Override the setAxisSize method to use the arc's circumference as
868
+ * length. This allows tickPixelInterval to apply to pixel lengths along
869
+ * the perimeter.
870
+ * @private
871
+ */
872
+ function setAxisSize() {
873
+ var axisProto = this.constructor.prototype;
874
+ var center, start;
875
+ axisProto.setAxisSize.call(this);
876
+ if (this.isRadial) {
877
+ // Set the center array
878
+ this.pane.updateCenter(this);
879
+ // In case when the innerSize is set in a polar chart, the axis'
880
+ // center cannot be a reference to pane's center
881
+ center = this.center = this.pane.center.slice();
882
+ // The sector is used in Axis.translate to compute the
883
+ // translation of reversed axis points (#2570)
884
+ if (this.isCircular) {
885
+ this.sector = this.endAngleRad - this.startAngleRad;
886
+ }
887
+ else {
888
+ // When the pane's startAngle or the axis' angle is set then
889
+ // new x and y values for vertical axis' center must be
890
+ // calulated
891
+ start = this.postTranslate(this.angleRad, center[3] / 2);
892
+ center[0] = start.x - this.chart.plotLeft;
893
+ center[1] = start.y - this.chart.plotTop;
894
+ }
895
+ // Axis len is used to lay out the ticks
896
+ this.len = this.width = this.height =
897
+ (center[2] - center[3]) * pick(this.sector, 1) / 2;
898
+ }
899
+ }
900
+ /**
901
+ * Override setAxisTranslation by setting the translation to the
902
+ * difference in rotation. This allows the translate method to return
903
+ * angle for any given value.
904
+ *
905
+ * @private
906
+ */
907
+ function setAxisTranslation() {
908
+ var axisProto = this.constructor.prototype;
909
+ // Call uber method
910
+ axisProto.setAxisTranslation.call(this);
911
+ // Set transA and minPixelPadding
912
+ if (this.center) { // it's not defined the first time
913
+ if (this.isCircular) {
914
+ this.transA = (this.endAngleRad - this.startAngleRad) /
915
+ ((this.max - this.min) || 1);
916
+ }
917
+ else {
918
+ // The transA here is the length of the axis, so in case
919
+ // of inner radius, the length must be decreased by it
920
+ this.transA = ((this.center[2] - this.center[3]) / 2) /
921
+ ((this.max - this.min) || 1);
922
+ }
923
+ if (this.isXAxis) {
924
+ this.minPixelPadding = this.transA * this.minPointOffset;
925
+ }
926
+ else {
927
+ // This is a workaround for regression #2593, but categories
928
+ // still don't position correctly.
929
+ this.minPixelPadding = 0;
930
+ }
931
+ }
932
+ }
933
+ /**
934
+ * Merge and set options.
935
+ */
936
+ function setOptions(userOptions) {
937
+ var options = this.options = merge(this.constructor.defaultOptions, this.defaultPolarOptions, defaultOptions[this.coll], // #16112
938
+ userOptions);
939
+ // Make sure the plotBands array is instanciated for each Axis
940
+ // (#2649)
941
+ if (!options.plotBands) {
942
+ options.plotBands = [];
943
+ }
944
+ fireEvent(this, 'afterSetOptions');
945
+ }
946
+ /**
947
+ * Wrap the getMarkPath function to return the path of the radial marker.
948
+ */
949
+ function wrapTickGetMarkPath(proceed, x, y, tickLength, tickWidth, horiz, renderer) {
950
+ var axis = this.axis;
951
+ var endPoint, ret;
952
+ if (axis.isRadial) {
953
+ endPoint = axis.getPosition(this.pos, axis.center[2] / 2 + tickLength);
954
+ ret = [
955
+ 'M',
956
+ x,
957
+ y,
958
+ 'L',
959
+ endPoint.x,
960
+ endPoint.y
961
+ ];
962
+ }
963
+ else {
964
+ ret = proceed.call(this, x, y, tickLength, tickWidth, horiz, renderer);
965
+ }
966
+ return ret;
967
+ }
968
+ /* eslint-enable valid-jsdoc */
969
+ })(RadialAxis || (RadialAxis = {}));
970
+ /* *
971
+ *
972
+ * Default Export
973
+ *
974
+ * */
862
975
  export default RadialAxis;