highcharts 7.1.1 → 7.1.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 (415) hide show
  1. package/bower.json +1 -1
  2. package/css/annotations/popup.css +3 -3
  3. package/css/annotations/popup.scss +1 -1
  4. package/css/stocktools/gui.css +5 -5
  5. package/css/stocktools/gui.scss +1 -1
  6. package/es-modules/annotations/ControlPoint.js +1 -1
  7. package/es-modules/annotations/MockPoint.js +45 -12
  8. package/es-modules/annotations/annotations.src.js +203 -166
  9. package/es-modules/annotations/controllable/ControllableCircle.js +2 -10
  10. package/es-modules/annotations/controllable/ControllableImage.js +2 -10
  11. package/es-modules/annotations/controllable/ControllableLabel.js +54 -9
  12. package/es-modules/annotations/controllable/ControllableRect.js +2 -10
  13. package/es-modules/annotations/controllable/controllableMixin.js +32 -4
  14. package/es-modules/annotations/controllable/markerMixin.js +1 -0
  15. package/es-modules/annotations/eventEmitterMixin.js +1 -0
  16. package/es-modules/annotations/navigationBindings.js +15 -11
  17. package/es-modules/annotations/popup.js +59 -81
  18. package/es-modules/annotations/types/CrookedLine.js +19 -7
  19. package/es-modules/annotations/types/ElliottWave.js +7 -6
  20. package/es-modules/annotations/types/Fibonacci.js +14 -14
  21. package/es-modules/annotations/types/InfinityLine.js +4 -4
  22. package/es-modules/annotations/types/Measure.js +41 -41
  23. package/es-modules/annotations/types/Pitchfork.js +5 -4
  24. package/es-modules/annotations/types/VerticalLine.js +6 -5
  25. package/es-modules/error-messages.js +6 -1
  26. package/es-modules/indicators/indicators.src.js +5 -3
  27. package/es-modules/mixins/nodes.js +16 -8
  28. package/es-modules/modules/accessibility/AccessibilityComponent.js +4 -4
  29. package/es-modules/modules/accessibility/KeyboardNavigation.js +17 -4
  30. package/es-modules/modules/accessibility/components/RangeSelectorComponent.js +3 -2
  31. package/es-modules/modules/accessibility/components/SeriesComponent.js +110 -2
  32. package/es-modules/modules/accessibility/components/ZoomComponent.js +1 -1
  33. package/es-modules/modules/accessibility/options.js +2 -1
  34. package/es-modules/modules/bellcurve.src.js +27 -29
  35. package/es-modules/modules/boost/boost-init.js +14 -0
  36. package/es-modules/modules/boost/boost-overrides.js +13 -3
  37. package/es-modules/modules/boost/wgl-renderer.js +30 -15
  38. package/es-modules/modules/boost/wgl-shader.js +33 -16
  39. package/es-modules/modules/boost/wgl-vbuffer.js +8 -4
  40. package/es-modules/modules/broken-axis.src.js +1 -1
  41. package/es-modules/modules/bullet.src.js +68 -68
  42. package/es-modules/modules/cylinder.src.js +3 -1
  43. package/es-modules/modules/data.src.js +9 -5
  44. package/es-modules/modules/draggable-points.src.js +1 -1
  45. package/es-modules/modules/drilldown.src.js +1 -1
  46. package/es-modules/modules/export-data.src.js +7 -8
  47. package/es-modules/modules/exporting.src.js +9 -1
  48. package/es-modules/modules/full-screen.src.js +1 -1
  49. package/es-modules/modules/funnel3d.src.js +10 -3
  50. package/es-modules/modules/histogram.src.js +162 -164
  51. package/es-modules/modules/item-series.src.js +10 -10
  52. package/es-modules/modules/networkgraph/layouts.js +16 -12
  53. package/es-modules/modules/networkgraph/networkgraph.src.js +147 -51
  54. package/es-modules/modules/offline-exporting.src.js +15 -2
  55. package/es-modules/modules/oldie-polyfills.src.js +1 -1
  56. package/es-modules/modules/organization.src.js +65 -20
  57. package/es-modules/modules/pareto.src.js +52 -51
  58. package/es-modules/modules/pattern-fill.src.js +1 -1
  59. package/es-modules/modules/price-indicator.src.js +1 -1
  60. package/es-modules/modules/pyramid3d.src.js +1 -1
  61. package/es-modules/modules/sankey.src.js +22 -10
  62. package/es-modules/modules/series-label.src.js +16 -8
  63. package/es-modules/modules/solid-gauge.src.js +128 -79
  64. package/es-modules/modules/static-scale.src.js +8 -1
  65. package/es-modules/modules/stock-tools-gui.js +1 -1
  66. package/es-modules/modules/streamgraph.src.js +11 -11
  67. package/es-modules/modules/sunburst.src.js +23 -2
  68. package/es-modules/modules/tilemap.src.js +58 -57
  69. package/es-modules/modules/timeline.src.js +17 -12
  70. package/es-modules/modules/treemap.src.js +6 -6
  71. package/es-modules/modules/variwide.src.js +39 -39
  72. package/es-modules/modules/vector.src.js +108 -107
  73. package/es-modules/modules/venn.src.js +4 -2
  74. package/es-modules/modules/windbarb.src.js +43 -43
  75. package/es-modules/modules/wordcloud.src.js +1 -0
  76. package/es-modules/modules/xrange.src.js +112 -104
  77. package/es-modules/parts/AreaSeries.js +4 -1
  78. package/es-modules/parts/Axis.js +809 -1870
  79. package/es-modules/parts/Chart.js +254 -743
  80. package/es-modules/parts/Color.js +160 -113
  81. package/es-modules/parts/ColumnSeries.js +9 -3
  82. package/es-modules/parts/DataLabels.js +31 -2
  83. package/es-modules/parts/Dynamics.js +73 -26
  84. package/es-modules/parts/FlagsSeries.js +6 -4
  85. package/es-modules/parts/Globals.js +20 -36
  86. package/es-modules/parts/Html.js +116 -235
  87. package/es-modules/parts/Interaction.js +17 -7
  88. package/es-modules/parts/Legend.js +277 -632
  89. package/es-modules/parts/MSPointer.js +62 -106
  90. package/es-modules/parts/Options.js +128 -367
  91. package/es-modules/parts/OrdinalAxis.js +12 -0
  92. package/es-modules/parts/PieSeries.js +61 -44
  93. package/es-modules/parts/PlotLineOrBand.js +38 -3
  94. package/es-modules/parts/Point.js +117 -227
  95. package/es-modules/parts/Pointer.js +273 -558
  96. package/es-modules/parts/RangeSelector.js +5 -3
  97. package/es-modules/parts/Responsive.js +8 -4
  98. package/es-modules/parts/ScrollablePlotArea.js +215 -81
  99. package/es-modules/parts/Scrollbar.js +38 -23
  100. package/es-modules/parts/Series.js +151 -47
  101. package/es-modules/parts/Stacking.js +8 -3
  102. package/es-modules/parts/StockChart.js +42 -29
  103. package/es-modules/parts/SvgRenderer.js +1080 -2100
  104. package/es-modules/parts/Tick.js +11 -4
  105. package/es-modules/parts/Time.js +179 -363
  106. package/es-modules/parts/Tooltip.js +23 -12
  107. package/es-modules/parts/TouchPointer.js +69 -187
  108. package/es-modules/parts/Utilities.js +593 -846
  109. package/es-modules/parts-3d/Axis.js +2 -2
  110. package/es-modules/parts-3d/Column.js +18 -8
  111. package/es-modules/parts-gantt/GanttSeries.js +17 -21
  112. package/es-modules/parts-gantt/GridAxis.js +183 -101
  113. package/es-modules/parts-gantt/PathfinderAlgorithms.js +2 -2
  114. package/es-modules/parts-gantt/TreeGrid.js +53 -36
  115. package/es-modules/parts-map/ColorAxis.js +35 -14
  116. package/es-modules/parts-map/MapBubbleSeries.js +2 -1
  117. package/es-modules/parts-map/MapSeries.js +29 -18
  118. package/es-modules/parts-more/AreaRangeSeries.js +13 -12
  119. package/es-modules/parts-more/ColumnRangeSeries.js +8 -2
  120. package/es-modules/parts-more/GaugeSeries.js +9 -9
  121. package/es-modules/parts-more/PackedBubbleSeries.js +152 -115
  122. package/es-modules/parts-more/RadialAxis.js +102 -8
  123. package/es-modules/parts-more/WaterfallSeries.js +148 -35
  124. package/highcharts-3d.js +68 -67
  125. package/highcharts-3d.js.map +1 -1
  126. package/highcharts-3d.src.js +21 -11
  127. package/highcharts-gantt.d.ts +5 -3
  128. package/highcharts-gantt.js +618 -610
  129. package/highcharts-gantt.js.map +1 -1
  130. package/highcharts-gantt.src.d.ts +5 -3
  131. package/highcharts-gantt.src.js +5185 -8892
  132. package/highcharts-more.js +144 -140
  133. package/highcharts-more.js.map +1 -1
  134. package/highcharts-more.src.js +449 -194
  135. package/highcharts.d.ts +3943 -5236
  136. package/highcharts.js +454 -449
  137. package/highcharts.js.map +1 -1
  138. package/highcharts.src.d.ts +3943 -5236
  139. package/highcharts.src.js +4767 -8601
  140. package/highmaps.d.ts +5 -3
  141. package/highmaps.js +498 -494
  142. package/highmaps.js.map +1 -1
  143. package/highmaps.src.d.ts +5 -3
  144. package/highmaps.src.js +4547 -8507
  145. package/highstock.d.ts +5 -3
  146. package/highstock.js +597 -590
  147. package/highstock.js.map +1 -1
  148. package/highstock.src.d.ts +5 -3
  149. package/highstock.src.js +4871 -8661
  150. package/indicators/acceleration-bands.js +1 -1
  151. package/indicators/acceleration-bands.src.js +1 -1
  152. package/indicators/accumulation-distribution.js +1 -1
  153. package/indicators/accumulation-distribution.src.js +1 -1
  154. package/indicators/ao.js +1 -1
  155. package/indicators/ao.src.js +1 -1
  156. package/indicators/apo.js +1 -1
  157. package/indicators/apo.src.js +1 -1
  158. package/indicators/aroon-oscillator.js +1 -1
  159. package/indicators/aroon-oscillator.src.js +1 -1
  160. package/indicators/aroon.js +1 -1
  161. package/indicators/aroon.src.js +1 -1
  162. package/indicators/atr.js +1 -1
  163. package/indicators/atr.src.js +1 -1
  164. package/indicators/bollinger-bands.js +1 -1
  165. package/indicators/bollinger-bands.src.js +1 -1
  166. package/indicators/cci.js +1 -1
  167. package/indicators/cci.src.js +1 -1
  168. package/indicators/chaikin.js +1 -1
  169. package/indicators/chaikin.src.js +1 -1
  170. package/indicators/cmf.js +1 -1
  171. package/indicators/cmf.src.js +1 -1
  172. package/indicators/dema.js +1 -1
  173. package/indicators/dema.src.js +1 -1
  174. package/indicators/dpo.js +1 -1
  175. package/indicators/dpo.src.js +1 -1
  176. package/indicators/ema.js +1 -1
  177. package/indicators/ema.src.js +1 -1
  178. package/indicators/ichimoku-kinko-hyo.js +1 -1
  179. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  180. package/indicators/indicators-all.js +105 -105
  181. package/indicators/indicators-all.js.map +1 -1
  182. package/indicators/indicators-all.src.js +6 -4
  183. package/indicators/indicators.js +9 -9
  184. package/indicators/indicators.js.map +1 -1
  185. package/indicators/indicators.src.js +6 -4
  186. package/indicators/keltner-channels.js +1 -1
  187. package/indicators/keltner-channels.src.js +1 -1
  188. package/indicators/macd.js +1 -1
  189. package/indicators/macd.src.js +1 -1
  190. package/indicators/mfi.js +1 -1
  191. package/indicators/mfi.src.js +1 -1
  192. package/indicators/momentum.js +1 -1
  193. package/indicators/momentum.src.js +1 -1
  194. package/indicators/natr.js +1 -1
  195. package/indicators/natr.src.js +1 -1
  196. package/indicators/pivot-points.js +1 -1
  197. package/indicators/pivot-points.src.js +1 -1
  198. package/indicators/ppo.js +1 -1
  199. package/indicators/ppo.src.js +1 -1
  200. package/indicators/price-channel.js +1 -1
  201. package/indicators/price-channel.src.js +1 -1
  202. package/indicators/price-envelopes.js +1 -1
  203. package/indicators/price-envelopes.src.js +1 -1
  204. package/indicators/psar.js +1 -1
  205. package/indicators/psar.src.js +1 -1
  206. package/indicators/regressions.js +1 -1
  207. package/indicators/regressions.src.js +1 -1
  208. package/indicators/roc.js +1 -1
  209. package/indicators/roc.src.js +1 -1
  210. package/indicators/rsi.js +1 -1
  211. package/indicators/rsi.src.js +1 -1
  212. package/indicators/stochastic.js +1 -1
  213. package/indicators/stochastic.src.js +1 -1
  214. package/indicators/supertrend.js +1 -1
  215. package/indicators/supertrend.src.js +1 -1
  216. package/indicators/tema.js +1 -1
  217. package/indicators/tema.src.js +1 -1
  218. package/indicators/trix.js +1 -1
  219. package/indicators/trix.src.js +1 -1
  220. package/indicators/volume-by-price.js +1 -1
  221. package/indicators/volume-by-price.src.js +1 -1
  222. package/indicators/vwap.js +1 -1
  223. package/indicators/vwap.src.js +1 -1
  224. package/indicators/williams-r.js +1 -1
  225. package/indicators/williams-r.src.js +1 -1
  226. package/indicators/wma.js +1 -1
  227. package/indicators/wma.src.js +1 -1
  228. package/indicators/zigzag.js +1 -1
  229. package/indicators/zigzag.src.js +1 -1
  230. package/modules/accessibility.js +92 -89
  231. package/modules/accessibility.js.map +1 -1
  232. package/modules/accessibility.src.js +138 -15
  233. package/modules/annotations-advanced.js +128 -127
  234. package/modules/annotations-advanced.js.map +1 -1
  235. package/modules/annotations-advanced.src.js +514 -396
  236. package/modules/annotations.d.ts +36 -0
  237. package/modules/annotations.js +81 -81
  238. package/modules/annotations.js.map +1 -1
  239. package/modules/annotations.src.d.ts +36 -0
  240. package/modules/annotations.src.js +418 -315
  241. package/modules/arrow-symbols.js +1 -1
  242. package/modules/arrow-symbols.src.js +1 -1
  243. package/modules/boost-canvas.js +1 -1
  244. package/modules/boost-canvas.src.js +1 -1
  245. package/modules/boost.js +63 -63
  246. package/modules/boost.js.map +1 -1
  247. package/modules/boost.src.js +99 -39
  248. package/modules/broken-axis.js +1 -1
  249. package/modules/broken-axis.src.js +2 -2
  250. package/modules/bullet.js +1 -1
  251. package/modules/bullet.src.js +69 -69
  252. package/modules/current-date-indicator.js +1 -1
  253. package/modules/current-date-indicator.src.js +1 -1
  254. package/modules/cylinder.js +1 -1
  255. package/modules/cylinder.js.map +1 -1
  256. package/modules/cylinder.src.js +4 -2
  257. package/modules/data.js +4 -4
  258. package/modules/data.js.map +1 -1
  259. package/modules/data.src.js +10 -6
  260. package/modules/datagrouping.js +1 -1
  261. package/modules/datagrouping.src.js +1 -1
  262. package/modules/debugger.js +4 -4
  263. package/modules/debugger.js.map +1 -1
  264. package/modules/debugger.src.js +7 -2
  265. package/modules/dependency-wheel.js +1 -1
  266. package/modules/dependency-wheel.src.js +1 -1
  267. package/modules/dotplot.js +1 -1
  268. package/modules/dotplot.src.js +1 -1
  269. package/modules/drag-panes.js +1 -1
  270. package/modules/drag-panes.src.js +1 -1
  271. package/modules/draggable-points.js +1 -1
  272. package/modules/draggable-points.src.js +2 -2
  273. package/modules/drilldown.js +1 -1
  274. package/modules/drilldown.src.js +2 -2
  275. package/modules/export-data.js +2 -2
  276. package/modules/export-data.js.map +1 -1
  277. package/modules/export-data.src.js +8 -9
  278. package/modules/exporting.js +25 -25
  279. package/modules/exporting.js.map +1 -1
  280. package/modules/exporting.src.js +11 -3
  281. package/modules/full-screen.js +1 -1
  282. package/modules/full-screen.src.js +2 -2
  283. package/modules/funnel.js +1 -1
  284. package/modules/funnel.src.js +1 -1
  285. package/modules/funnel3d.js +2 -2
  286. package/modules/funnel3d.js.map +1 -1
  287. package/modules/funnel3d.src.js +11 -4
  288. package/modules/gantt.js +166 -164
  289. package/modules/gantt.js.map +1 -1
  290. package/modules/gantt.src.js +422 -295
  291. package/modules/grid-axis.js +18 -16
  292. package/modules/grid-axis.js.map +1 -1
  293. package/modules/grid-axis.src.js +184 -102
  294. package/modules/heatmap.js +22 -22
  295. package/modules/heatmap.js.map +1 -1
  296. package/modules/heatmap.src.js +36 -15
  297. package/modules/histogram-bellcurve.js +1 -1
  298. package/modules/histogram-bellcurve.js.map +1 -1
  299. package/modules/histogram-bellcurve.src.js +186 -183
  300. package/modules/item-series.js +1 -1
  301. package/modules/item-series.src.js +11 -11
  302. package/modules/map-parser.js +1 -1
  303. package/modules/map-parser.src.js +1 -1
  304. package/modules/map.js +83 -83
  305. package/modules/map.js.map +1 -1
  306. package/modules/map.src.js +67 -34
  307. package/modules/networkgraph.js +10 -9
  308. package/modules/networkgraph.js.map +1 -1
  309. package/modules/networkgraph.src.js +180 -72
  310. package/modules/no-data-to-display.js +1 -1
  311. package/modules/no-data-to-display.src.js +1 -1
  312. package/modules/offline-exporting.js +15 -15
  313. package/modules/offline-exporting.js.map +1 -1
  314. package/modules/offline-exporting.src.js +17 -4
  315. package/modules/oldie-polyfills.js +1 -1
  316. package/modules/oldie-polyfills.src.js +2 -2
  317. package/modules/oldie.js +2 -2
  318. package/modules/oldie.src.js +2 -2
  319. package/modules/organization.js +1 -1
  320. package/modules/organization.js.map +1 -1
  321. package/modules/organization.src.js +66 -21
  322. package/modules/overlapping-datalabels.js +1 -1
  323. package/modules/overlapping-datalabels.src.js +1 -1
  324. package/modules/parallel-coordinates.js +1 -1
  325. package/modules/parallel-coordinates.src.js +1 -1
  326. package/modules/pareto.js +1 -1
  327. package/modules/pareto.js.map +1 -1
  328. package/modules/pareto.src.js +53 -52
  329. package/modules/pathfinder.js +3 -3
  330. package/modules/pathfinder.js.map +1 -1
  331. package/modules/pathfinder.src.js +3 -3
  332. package/modules/pattern-fill.js +1 -1
  333. package/modules/pattern-fill.src.js +2 -2
  334. package/modules/price-indicator.js +1 -1
  335. package/modules/price-indicator.src.js +2 -2
  336. package/modules/pyramid3d.js +1 -1
  337. package/modules/pyramid3d.src.js +2 -2
  338. package/modules/sankey.js +14 -14
  339. package/modules/sankey.js.map +1 -1
  340. package/modules/sankey.src.js +39 -19
  341. package/modules/series-label.js +16 -16
  342. package/modules/series-label.js.map +1 -1
  343. package/modules/series-label.src.js +17 -9
  344. package/modules/solid-gauge.js +5 -5
  345. package/modules/solid-gauge.js.map +1 -1
  346. package/modules/solid-gauge.src.js +129 -80
  347. package/modules/sonification.js +1 -1
  348. package/modules/sonification.src.js +1 -1
  349. package/modules/static-scale.js +4 -4
  350. package/modules/static-scale.js.map +1 -1
  351. package/modules/static-scale.src.js +9 -2
  352. package/modules/stock-tools.js +2 -2
  353. package/modules/stock-tools.src.js +3 -3
  354. package/modules/stock.js +146 -145
  355. package/modules/stock.js.map +1 -1
  356. package/modules/stock.src.js +105 -61
  357. package/modules/streamgraph.js +1 -1
  358. package/modules/streamgraph.src.js +12 -12
  359. package/modules/sunburst.js +40 -40
  360. package/modules/sunburst.js.map +1 -1
  361. package/modules/sunburst.src.js +30 -9
  362. package/modules/tilemap.js +1 -1
  363. package/modules/tilemap.js.map +1 -1
  364. package/modules/tilemap.src.js +59 -58
  365. package/modules/timeline.js +12 -11
  366. package/modules/timeline.js.map +1 -1
  367. package/modules/timeline.src.js +18 -13
  368. package/modules/treegrid.js +45 -43
  369. package/modules/treegrid.js.map +1 -1
  370. package/modules/treegrid.src.js +238 -139
  371. package/modules/treemap.js +1 -1
  372. package/modules/treemap.src.js +7 -7
  373. package/modules/variable-pie.js +1 -1
  374. package/modules/variable-pie.src.js +1 -1
  375. package/modules/variwide.js +1 -1
  376. package/modules/variwide.src.js +40 -40
  377. package/modules/vector.js +1 -1
  378. package/modules/vector.js.map +1 -1
  379. package/modules/vector.src.js +109 -108
  380. package/modules/venn.js +23 -23
  381. package/modules/venn.js.map +1 -1
  382. package/modules/venn.src.js +5 -3
  383. package/modules/windbarb.js +1 -1
  384. package/modules/windbarb.src.js +44 -44
  385. package/modules/wordcloud.js +10 -10
  386. package/modules/wordcloud.js.map +1 -1
  387. package/modules/wordcloud.src.js +2 -1
  388. package/modules/xrange.js +12 -12
  389. package/modules/xrange.js.map +1 -1
  390. package/modules/xrange.src.js +113 -105
  391. package/package.json +1 -1
  392. package/themes/avocado.js +21 -37
  393. package/themes/avocado.src.js +1 -1
  394. package/themes/dark-blue.js +1 -1
  395. package/themes/dark-blue.src.js +1 -1
  396. package/themes/dark-green.js +1 -1
  397. package/themes/dark-green.src.js +1 -1
  398. package/themes/dark-unica.js +1 -1
  399. package/themes/dark-unica.src.js +1 -1
  400. package/themes/gray.js +1 -1
  401. package/themes/gray.src.js +1 -1
  402. package/themes/grid-light.js +1 -1
  403. package/themes/grid-light.src.js +1 -1
  404. package/themes/grid.js +1 -1
  405. package/themes/grid.src.js +1 -1
  406. package/themes/sand-signika.js +1 -1
  407. package/themes/sand-signika.src.js +1 -1
  408. package/themes/skies.js +1 -1
  409. package/themes/skies.src.js +1 -1
  410. package/themes/sunset.js +21 -37
  411. package/themes/sunset.src.js +1 -1
  412. package/.DS_Store +0 -0
  413. package/es-modules/.DS_Store +0 -0
  414. package/es-modules/modules/annotations-legacy.src.js +0 -1977
  415. package/js/.DS_Store +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v7.1.1 (2019-04-09)
2
+ * @license Highcharts JS v7.1.2 (2019-06-04)
3
3
  *
4
4
  * (c) 2009-2018 Torstein Honsi
5
5
  *
@@ -740,8 +740,8 @@
740
740
 
741
741
  // Polygonal plot bands
742
742
  if (this.options.gridLineInterpolation === 'polygon') {
743
- ret = this.getPlotLinePath(from).concat(
744
- this.getPlotLinePath(to, true)
743
+ ret = this.getPlotLinePath({ value: from }).concat(
744
+ this.getPlotLinePath({ value: to, reverse: true })
745
745
  );
746
746
 
747
747
  // Circular grid bands
@@ -826,10 +826,12 @@
826
826
  /* *
827
827
  * Find the path for plot lines perpendicular to the radial axis.
828
828
  */
829
- getPlotLinePath: function (value, reverse) {
829
+ getPlotLinePath: function (options) {
830
830
  var axis = this,
831
831
  center = axis.center,
832
832
  chart = axis.chart,
833
+ value = options.value,
834
+ reverse = options.reverse,
833
835
  end = axis.getPosition(value),
834
836
  xAxis,
835
837
  xy,
@@ -880,6 +882,7 @@
880
882
  });
881
883
 
882
884
  }
885
+
883
886
  return ret;
884
887
  },
885
888
 
@@ -1023,6 +1026,7 @@
1023
1026
  addEvent(Tick, 'afterGetLabelPosition', function (e) {
1024
1027
  var axis = this.axis,
1025
1028
  label = this.label,
1029
+ labelBBox = label.getBBox(),
1026
1030
  labelOptions = axis.options.labels,
1027
1031
  optionsY = labelOptions.y,
1028
1032
  ret,
@@ -1031,11 +1035,27 @@
1031
1035
  angle = (
1032
1036
  (axis.translate(this.pos) + axis.startAngleRad + Math.PI / 2) /
1033
1037
  Math.PI * 180
1034
- ) % 360;
1038
+ ) % 360,
1039
+ correctAngle = Math.round(angle),
1040
+ labelDir = 'end', // Direction of the label 'start' or 'end'
1041
+ reducedAngle1 = correctAngle < 0 ?
1042
+ correctAngle + 360 : correctAngle,
1043
+ reducedAngle2 = reducedAngle1,
1044
+ translateY = 0,
1045
+ translateX = 0,
1046
+ labelYPosCorrection =
1047
+ labelOptions.y === null ? -labelBBox.height * 0.3 : 0;
1035
1048
 
1036
1049
  if (axis.isRadial) { // Both X and Y axes in a polar chart
1037
- ret = axis.getPosition(this.pos, (axis.center[2] / 2) +
1038
- pick(labelOptions.distance, -25));
1050
+ ret = axis.getPosition(
1051
+ this.pos,
1052
+ (axis.center[2] / 2) +
1053
+ H.relativeLength(
1054
+ pick(labelOptions.distance, -25),
1055
+ axis.center[2] / 2,
1056
+ -axis.center[2] / 2
1057
+ )
1058
+ );
1039
1059
 
1040
1060
  // Automatically rotated
1041
1061
  if (labelOptions.rotation === 'auto') {
@@ -1048,7 +1068,7 @@
1048
1068
  optionsY = (
1049
1069
  axis.chart.renderer
1050
1070
  .fontMetrics(label.styles && label.styles.fontSize).b -
1051
- label.getBBox().height / 2
1071
+ labelBBox.height / 2
1052
1072
  );
1053
1073
  }
1054
1074
 
@@ -1056,7 +1076,7 @@
1056
1076
  if (align === null) {
1057
1077
  if (axis.isCircular) { // Y axis
1058
1078
  if (
1059
- this.label.getBBox().width >
1079
+ labelBBox.width >
1060
1080
  axis.len * axis.tickInterval / (axis.max - axis.min)
1061
1081
  ) { // #3506
1062
1082
  centerSlot = 0;
@@ -1079,6 +1099,80 @@
1079
1099
  });
1080
1100
  }
1081
1101
 
1102
+ // Auto alignment for solid-gauges with two labels (#10635)
1103
+ if (
1104
+ align === 'auto' &&
1105
+ axis.tickPositions.length === 2 &&
1106
+ axis.isCircular
1107
+ ) {
1108
+ // Angles reduced to 0 - 90 or 180 - 270
1109
+ if (reducedAngle1 > 90 && reducedAngle1 < 180) {
1110
+ reducedAngle1 = 180 - reducedAngle1;
1111
+ } else if (reducedAngle1 > 270 && reducedAngle1 <= 360) {
1112
+ reducedAngle1 = 540 - reducedAngle1;
1113
+ }
1114
+
1115
+ // Angles reduced to 0 - 180
1116
+ if (reducedAngle2 > 180 && reducedAngle2 <= 360) {
1117
+ reducedAngle2 = 360 - reducedAngle2;
1118
+ }
1119
+
1120
+ if (
1121
+ (axis.pane.options.startAngle === correctAngle) ||
1122
+ (axis.pane.options.startAngle === correctAngle + 360) ||
1123
+ (axis.pane.options.startAngle === correctAngle - 360)
1124
+ ) {
1125
+ labelDir = 'start';
1126
+ }
1127
+
1128
+ if (
1129
+ (correctAngle >= -90 && correctAngle <= 90) ||
1130
+ (correctAngle >= -360 && correctAngle <= -270) ||
1131
+ (correctAngle >= 270 && correctAngle <= 360)
1132
+ ) {
1133
+ align = (labelDir === 'start') ? 'right' : 'left';
1134
+ } else {
1135
+ align = (labelDir === 'start') ? 'left' : 'right';
1136
+ }
1137
+
1138
+ // For angles beetwen (90 + n * 180) +- 20
1139
+ if (reducedAngle2 > 70 && reducedAngle2 < 110) {
1140
+ align = 'center';
1141
+ }
1142
+
1143
+ // auto Y translation
1144
+ if (
1145
+ reducedAngle1 < 15 ||
1146
+ (reducedAngle1 >= 180 && reducedAngle1 < 195)
1147
+ ) {
1148
+ translateY = labelBBox.height * 0.3;
1149
+ } else if (reducedAngle1 >= 15 && reducedAngle1 <= 35) {
1150
+ translateY = labelDir === 'start' ?
1151
+ 0 : labelBBox.height * 0.75;
1152
+ } else if (reducedAngle1 >= 195 && reducedAngle1 <= 215) {
1153
+ translateY = labelDir === 'start' ?
1154
+ labelBBox.height * 0.75 : 0;
1155
+ } else if (reducedAngle1 > 35 && reducedAngle1 <= 90) {
1156
+ translateY = labelDir === 'start' ?
1157
+ -labelBBox.height * 0.25 : labelBBox.height;
1158
+ } else if (reducedAngle1 > 215 && reducedAngle1 <= 270) {
1159
+ translateY = labelDir === 'start' ?
1160
+ labelBBox.height : -labelBBox.height * 0.25;
1161
+ }
1162
+
1163
+ // auto X translation
1164
+ if (reducedAngle2 < 15) {
1165
+ translateX = labelDir === 'start' ?
1166
+ -labelBBox.height * 0.15 : labelBBox.height * 0.15;
1167
+ } else if (reducedAngle2 > 165 && reducedAngle2 <= 180) {
1168
+ translateX = labelDir === 'start' ?
1169
+ labelBBox.height * 0.15 : -labelBBox.height * 0.15;
1170
+ }
1171
+
1172
+ label.attr({ align: align });
1173
+ label.translate(translateX, translateY + labelYPosCorrection);
1174
+ }
1175
+
1082
1176
  e.pos.x = ret.x + labelOptions.x;
1083
1177
  e.pos.y = ret.y + optionsY;
1084
1178
 
@@ -1141,7 +1235,7 @@
1141
1235
  * `x` and `y` options. Instead, they have `xLow`, `xHigh`, `yLow` and `yHigh`
1142
1236
  * options to allow the higher and lower data label sets individually.
1143
1237
  *
1144
- * @interface Highcharts.PlotAreaRangeDataLabelsOptionsObject
1238
+ * @interface Highcharts.SeriesAreaRangeDataLabelsOptionsObject
1145
1239
  * @extends Highcharts.DataLabelsOptionsObject
1146
1240
  * @since 2.3.0
1147
1241
  * @product highcharts highstock
@@ -1153,7 +1247,7 @@
1153
1247
  * @see {@link https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/arearange-datalabels/|Highcharts-Demo:}
1154
1248
  * Data labels on range series
1155
1249
  *
1156
- * @name Highcharts.PlotAreaRangeDataLabelsOptionsObject#xLow
1250
+ * @name Highcharts.SeriesAreaRangeDataLabelsOptionsObject#xLow
1157
1251
  * @type {number|undefined}
1158
1252
  * @default 0
1159
1253
  * @since 2.3.0
@@ -1164,7 +1258,7 @@
1164
1258
  * @see {@link https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/arearange-datalabels/|Highcharts-Demo:}
1165
1259
  * Data labels on range series
1166
1260
  *
1167
- * @name Highcharts.PlotAreaRangeDataLabelsOptionsObject#xHigh
1261
+ * @name Highcharts.SeriesAreaRangeDataLabelsOptionsObject#xHigh
1168
1262
  * @type {number|undefined}
1169
1263
  * @default 0
1170
1264
  * @since 2.3.0
@@ -1175,7 +1269,7 @@
1175
1269
  * @see {@link https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/arearange-datalabels/|Highcharts-Demo:}
1176
1270
  * Data labels on range series
1177
1271
  *
1178
- * @name Highcharts.PlotAreaRangeDataLabelsOptionsObject#yLow
1272
+ * @name Highcharts.SeriesAreaRangeDataLabelsOptionsObject#yLow
1179
1273
  * @type {number|undefined}
1180
1274
  * @default 0
1181
1275
  * @since 2.3.0
@@ -1186,7 +1280,7 @@
1186
1280
  * @see {@link https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/arearange-datalabels/|Highcharts-Demo:}
1187
1281
  * Data labels on range series
1188
1282
  *
1189
- * @name Highcharts.PlotAreaRangeDataLabelsOptionsObject#yHigh
1283
+ * @name Highcharts.SeriesAreaRangeDataLabelsOptionsObject#yHigh
1190
1284
  * @type {number|undefined}
1191
1285
  * @default 0
1192
1286
  * @since 2.3.0
@@ -1261,7 +1355,8 @@
1261
1355
  trackByArea: true,
1262
1356
 
1263
1357
  /**
1264
- * @type {Highcharts.DataLabelsOptionsObject|Highcharts.PlotAreaRangeDataLabelsOptionsObject}
1358
+ * @type {Highcharts.SeriesAreaRangeDataLabelsOptionsObject|Array<Highcharts.SeriesAreaRangeDataLabelsOptionsObject>}
1359
+ * @default {"xLow": 0, "xHigh": 0, "yLow": 0, "yHigh": 0}
1265
1360
  *
1266
1361
  * @private
1267
1362
  */
@@ -1840,6 +1935,12 @@
1840
1935
  * @apioption series.arearange.data
1841
1936
  */
1842
1937
 
1938
+ /**
1939
+ * @type {Highcharts.SeriesAreaRangeDataLabelsOptionsObject|Array<Highcharts.SeriesAreaRangeDataLabelsOptionsObject>}
1940
+ * @product highcharts highstock
1941
+ * @apioption series.arearange.data.dataLabels
1942
+ */
1943
+
1843
1944
  /**
1844
1945
  * The high or maximum value for each data point.
1845
1946
  *
@@ -1856,12 +1957,6 @@
1856
1957
  * @apioption series.arearange.data.low
1857
1958
  */
1858
1959
 
1859
- /**
1860
- * @excluding x, y
1861
- * @product highcharts highstock
1862
- * @apioption series.arearange.dataLabels
1863
- */
1864
-
1865
1960
  });
1866
1961
  _registerModule(_modules, 'parts-more/AreaSplineRangeSeries.js', [_modules['parts/Globals.js']], function (H) {
1867
1962
  /* *
@@ -2000,9 +2095,9 @@
2000
2095
  * `yLow` and `yHigh` options to allow the higher and lower data label
2001
2096
  * sets individually.
2002
2097
  *
2003
- * @extends plotOptions.arearange.dataLabels
2098
+ * @type {Highcharts.SeriesAreaRangeDataLabelsOptionsObject|Array<Highcharts.SeriesAreaRangeDataLabelsOptionsObject>}
2099
+ * @default {"xLow": 0, "xHigh": 0, "yLow": 0, "yHigh": 0}
2004
2100
  * @since 2.3.0
2005
- * @excluding x, y
2006
2101
  * @product highcharts highstock
2007
2102
  * @apioption plotOptions.columnrange.dataLabels
2008
2103
  */
@@ -2225,6 +2320,12 @@
2225
2320
  * @apioption series.columnrange.data
2226
2321
  */
2227
2322
 
2323
+ /**
2324
+ * @type {Highcharts.SeriesAreaRangeDataLabelsOptionsObject|Array<Highcharts.SeriesAreaRangeDataLabelsOptionsObject>}
2325
+ * @product highcharts highstock
2326
+ * @apioption series.columnrange.data.dataLabels
2327
+ */
2328
+
2228
2329
  /**
2229
2330
  * @excluding halo, lineWidth, lineWidthPlus, marker
2230
2331
  * @product highcharts highstock
@@ -2939,16 +3040,16 @@
2939
3040
  })
2940
3041
  .addClass('highcharts-dial')
2941
3042
  .add(series.group);
3043
+ }
2942
3044
 
2943
- // Presentational attributes
2944
- if (!chart.styledMode) {
2945
- point.graphic.attr({
2946
- stroke: dialOptions.borderColor || 'none',
2947
- 'stroke-width': dialOptions.borderWidth || 0,
2948
- fill: dialOptions.backgroundColor ||
2949
- '#000000'
2950
- });
2951
- }
3045
+ // Presentational attributes
3046
+ if (!chart.styledMode) {
3047
+ point.graphic[graphic ? 'animate' : 'attr']({
3048
+ stroke: dialOptions.borderColor || 'none',
3049
+ 'stroke-width': dialOptions.borderWidth || 0,
3050
+ fill: dialOptions.backgroundColor ||
3051
+ '#000000'
3052
+ });
2952
3053
  }
2953
3054
  });
2954
3055
 
@@ -3908,12 +4009,15 @@
3908
4009
  Chart = H.Chart,
3909
4010
  Point = H.Point,
3910
4011
  Series = H.Series,
4012
+ StackItem = H.StackItem,
3911
4013
  seriesType = H.seriesType,
3912
4014
  seriesTypes = H.seriesTypes;
3913
4015
 
3914
4016
  addEvent(Axis, 'afterInit', function () {
3915
4017
  if (!this.isXAxis) {
3916
- this.waterfallStacks = {};
4018
+ this.waterfallStacks = {
4019
+ changed: false
4020
+ };
3917
4021
  }
3918
4022
  });
3919
4023
 
@@ -3926,7 +4030,7 @@
3926
4030
  if (series[i].options.stacking) {
3927
4031
  axes.forEach(function (axis) {
3928
4032
  if (!axis.isXAxis) {
3929
- axis.waterfallStacks = {};
4033
+ axis.waterfallStacks.changed = true;
3930
4034
  }
3931
4035
  });
3932
4036
  i = 0;
@@ -3934,6 +4038,53 @@
3934
4038
  }
3935
4039
  });
3936
4040
 
4041
+ addEvent(Axis, 'afterRender', function () {
4042
+ var stackLabelOptions = this.options.stackLabels;
4043
+
4044
+ if (stackLabelOptions && stackLabelOptions.enabled &&
4045
+ this.waterfallStacks) {
4046
+ this.renderWaterfallStackTotals();
4047
+ }
4048
+ });
4049
+
4050
+ /**
4051
+ * Calls StackItem.prototype.render function that creates and renders stack
4052
+ * total label for each waterfall stack item.
4053
+ *
4054
+ * @private
4055
+ * @function Highcharts.Axis#renderWaterfallStackTotals
4056
+ */
4057
+ Axis.prototype.renderWaterfallStackTotals = function () {
4058
+ var yAxis = this,
4059
+ waterfallStacks = yAxis.waterfallStacks,
4060
+ stackTotalGroup = yAxis.stackTotalGroup,
4061
+ dummyStackItem = new StackItem(
4062
+ yAxis,
4063
+ yAxis.options.stackLabels,
4064
+ false,
4065
+ 0,
4066
+ undefined
4067
+ );
4068
+
4069
+ yAxis.dummyStackItem = dummyStackItem;
4070
+
4071
+ // Render each waterfall stack total
4072
+ objectEach(waterfallStacks, function (type) {
4073
+ objectEach(type, function (stackItem) {
4074
+ dummyStackItem.total = stackItem.stackTotal;
4075
+
4076
+ if (stackItem.label) {
4077
+ dummyStackItem.label = stackItem.label;
4078
+ }
4079
+
4080
+ StackItem.prototype.render.call(dummyStackItem, stackTotalGroup);
4081
+ stackItem.label = dummyStackItem.label;
4082
+ delete dummyStackItem.label;
4083
+ });
4084
+ });
4085
+ dummyStackItem.total = null;
4086
+ };
4087
+
3937
4088
  /**
3938
4089
  * A waterfall chart displays sequentially introduced positive or negative
3939
4090
  * values in cumulative columns.
@@ -4079,6 +4230,7 @@
4079
4230
  tooltipY,
4080
4231
  actualStack = yAxis.waterfallStacks[series.stackKey],
4081
4232
  actualStackX,
4233
+ dummyStackItem,
4082
4234
  total,
4083
4235
  pointY,
4084
4236
  yPos,
@@ -4106,10 +4258,17 @@
4106
4258
  actualStackX = actualStack[i];
4107
4259
 
4108
4260
  if (stacking === 'overlap') {
4109
- total = actualStackX.threshold + actualStackX.total;
4110
- actualStackX.total -= pointY;
4261
+ total =
4262
+ actualStackX.stackState[actualStackX.stateIndex--];
4111
4263
 
4112
4264
  y = pointY >= 0 ? total : total - pointY;
4265
+ if (actualStackX.hasOwnProperty('absolutePos')) {
4266
+ delete actualStackX.absolutePos;
4267
+ }
4268
+
4269
+ if (actualStackX.hasOwnProperty('absoluteNeg')) {
4270
+ delete actualStackX.absoluteNeg;
4271
+ }
4113
4272
  } else {
4114
4273
  if (pointY >= 0) {
4115
4274
  total = actualStackX.threshold +
@@ -4124,6 +4283,22 @@
4124
4283
  actualStackX.negTotal -= pointY;
4125
4284
  y = total - pointY;
4126
4285
  }
4286
+
4287
+ if (!actualStackX.posTotal) {
4288
+ if (actualStackX.hasOwnProperty('absolutePos')) {
4289
+ actualStackX.posTotal =
4290
+ actualStackX.absolutePos;
4291
+ delete actualStackX.absolutePos;
4292
+ }
4293
+ }
4294
+
4295
+ if (!actualStackX.negTotal) {
4296
+ if (actualStackX.hasOwnProperty('absoluteNeg')) {
4297
+ actualStackX.negTotal =
4298
+ actualStackX.absoluteNeg;
4299
+ delete actualStackX.absoluteNeg;
4300
+ }
4301
+ }
4127
4302
  }
4128
4303
 
4129
4304
  if (!point.isSum) {
@@ -4148,6 +4323,18 @@
4148
4323
  shapeArgs.height = Math.abs(shapeArgs.y -
4149
4324
  yAxis.translate(hPos, 0, 1, 0, 1));
4150
4325
  }
4326
+
4327
+ dummyStackItem = yAxis.dummyStackItem;
4328
+ if (dummyStackItem) {
4329
+ dummyStackItem.x = i;
4330
+ dummyStackItem.label = actualStack[i].label;
4331
+ dummyStackItem.setOffset(
4332
+ series.pointXOffset || 0,
4333
+ series.barW || 0,
4334
+ series.stackedYNeg[i],
4335
+ series.stackedYPos[i]
4336
+ );
4337
+ }
4151
4338
  } else {
4152
4339
  // up points
4153
4340
  y = Math.max(previousY, previousY + pointY) + range[0];
@@ -4414,18 +4601,46 @@
4414
4601
  waterfallStacks = series.yAxis.waterfallStacks,
4415
4602
  seriesThreshold = options.threshold,
4416
4603
  stackThreshold = seriesThreshold || 0,
4417
- interSum = seriesThreshold || 0,
4604
+ interSum = stackThreshold,
4418
4605
  stackKey = series.stackKey,
4419
4606
  xData = series.xData,
4420
4607
  xLength = xData.length,
4421
4608
  actualStack,
4422
4609
  actualStackX,
4610
+ totalYVal,
4611
+ actualSum,
4612
+ prevSum,
4613
+ statesLen,
4423
4614
  posTotal,
4424
4615
  negTotal,
4425
4616
  xPoint,
4426
4617
  yVal,
4427
4618
  x;
4428
4619
 
4620
+ // function responsible for calculating correct values for stackState
4621
+ // array of each stack item. The arguments are: firstS - the value for
4622
+ // the first state, nextS - the difference between the previous and the
4623
+ // newest state, sInx - counter used in the for that updates each state
4624
+ // when necessary, sOff - offset that must be added to each state when
4625
+ // they need to be updated (if point isn't a total sum)
4626
+ function calculateStackState(firstS, nextS, sInx, sOff) {
4627
+ if (!statesLen) {
4628
+ actualStackX.stackState[0] = firstS;
4629
+ statesLen = actualStackX.stackState.length;
4630
+ } else {
4631
+ for (sInx; sInx < statesLen; sInx++) {
4632
+ actualStackX.stackState[sInx] += sOff;
4633
+ }
4634
+ }
4635
+
4636
+ actualStackX.stackState.push(
4637
+ actualStackX.stackState[statesLen - 1] + nextS
4638
+ );
4639
+ }
4640
+
4641
+ series.yAxis.usePercentage = false;
4642
+ totalYVal = actualSum = prevSum = stackThreshold;
4643
+
4429
4644
  // code responsible for creating stacks for waterfall series
4430
4645
  if (series.visible || !series.chart.options.chart.ignoreHiddenSeries) {
4431
4646
  if (!waterfallStacks[stackKey]) {
@@ -4433,18 +4648,18 @@
4433
4648
  }
4434
4649
 
4435
4650
  actualStack = waterfallStacks[stackKey];
4436
-
4437
4651
  for (var i = 0; i < xLength; i++) {
4438
4652
  x = xData[i];
4439
-
4440
- if (!actualStack[x]) {
4653
+ if (!actualStack[x] || waterfallStacks.changed) {
4441
4654
  actualStack[x] = {
4442
4655
  negTotal: 0,
4443
4656
  posTotal: 0,
4444
- total: 0,
4445
4657
  stackTotal: 0,
4446
4658
  threshold: 0,
4447
- stackState: [stackThreshold]
4659
+ stateIndex: 0,
4660
+ stackState: [],
4661
+ label: (waterfallStacks.changed && actualStack[x]) ?
4662
+ actualStack[x].label : undefined
4448
4663
  };
4449
4664
  }
4450
4665
 
@@ -4459,27 +4674,40 @@
4459
4674
 
4460
4675
  // points do not exist yet, so raw data is used
4461
4676
  xPoint = options.data[i];
4462
- posTotal = actualStackX.posTotal;
4463
- negTotal = actualStackX.negTotal;
4677
+
4678
+ posTotal = actualStackX.absolutePos = actualStackX.posTotal;
4679
+ negTotal = actualStackX.absoluteNeg = actualStackX.negTotal;
4680
+ actualStackX.stackTotal = posTotal + negTotal;
4681
+ statesLen = actualStackX.stackState.length;
4464
4682
 
4465
4683
  if (xPoint && xPoint.isIntermediateSum) {
4684
+ calculateStackState(prevSum, actualSum, 0, prevSum);
4685
+
4686
+ prevSum = actualSum;
4687
+ actualSum = seriesThreshold;
4688
+
4466
4689
  // swapping values
4467
4690
  stackThreshold ^= interSum;
4468
4691
  interSum ^= stackThreshold;
4469
4692
  stackThreshold ^= interSum;
4470
4693
  } else if (xPoint && xPoint.isSum) {
4694
+ calculateStackState(seriesThreshold, totalYVal, statesLen);
4695
+
4471
4696
  stackThreshold = seriesThreshold;
4697
+ } else {
4698
+ calculateStackState(stackThreshold, yVal, 0, totalYVal);
4699
+
4700
+ if (xPoint) {
4701
+ totalYVal += yVal;
4702
+ actualSum += yVal;
4703
+ }
4472
4704
  }
4473
4705
 
4474
- actualStackX.stackTotal = posTotal + negTotal;
4475
- actualStackX.total = actualStackX.stackTotal;
4706
+ actualStackX.stateIndex++;
4476
4707
  actualStackX.threshold = stackThreshold;
4477
-
4478
- actualStackX.stackState[0] = stackThreshold;
4479
- actualStackX.stackState.push(actualStackX.stackTotal);
4480
-
4481
4708
  stackThreshold += actualStackX.stackTotal;
4482
4709
  }
4710
+ waterfallStacks.changed = false;
4483
4711
  }
4484
4712
  },
4485
4713
 
@@ -4490,9 +4718,7 @@
4490
4718
  yAxis,
4491
4719
  waterfallStacks,
4492
4720
  stackedYNeg,
4493
- stackedYPos,
4494
- states,
4495
- firstState;
4721
+ stackedYPos;
4496
4722
 
4497
4723
  if (stacking) {
4498
4724
  yAxis = this.yAxis;
@@ -4504,20 +4730,8 @@
4504
4730
  // overlap and different when it's set to normal
4505
4731
  if (stacking === 'overlap') {
4506
4732
  objectEach(waterfallStacks[this.stackKey], function (stackX) {
4507
-
4508
- states = [];
4509
- stackX.stackState.forEach(function (state, stateIndex) {
4510
- firstState = stackX.stackState[0];
4511
-
4512
- if (stateIndex) {
4513
- states.push(state + firstState);
4514
- } else {
4515
- states.push(firstState);
4516
- }
4517
- });
4518
-
4519
- stackedYNeg.push(arrayMin(states));
4520
- stackedYPos.push(arrayMax(states));
4733
+ stackedYNeg.push(arrayMin(stackX.stackState));
4734
+ stackedYPos.push(arrayMax(stackX.stackState));
4521
4735
  });
4522
4736
  } else {
4523
4737
  objectEach(waterfallStacks[this.stackKey], function (stackX) {
@@ -7911,16 +8125,20 @@
7911
8125
  ) {
7912
8126
  distanceXY = layout.getDistXY(node, repNode);
7913
8127
  distanceR = layout.vectorLength(distanceXY);
7914
-
7915
- force = layout.repulsiveForce(distanceR, layout.k);
7916
-
7917
- layout.force(
7918
- 'repulsive',
7919
- node,
7920
- force * repNode.mass,
7921
- distanceXY,
7922
- distanceR
7923
- );
8128
+ if (distanceR !== 0) {
8129
+ force = layout.repulsiveForce(
8130
+ distanceR,
8131
+ layout.k
8132
+ );
8133
+
8134
+ layout.force(
8135
+ 'repulsive',
8136
+ node,
8137
+ force * repNode.mass,
8138
+ distanceXY,
8139
+ distanceR
8140
+ );
8141
+ }
7924
8142
  }
7925
8143
  });
7926
8144
  });
@@ -8085,9 +8303,9 @@
8085
8303
  }
8086
8304
  );
8087
8305
 
8088
- /*
8306
+ /* ************************************************************************** *
8089
8307
  * Multiple series support:
8090
- */
8308
+ * ************************************************************************** */
8091
8309
  // Clear previous layouts
8092
8310
  addEvent(Chart, 'predraw', function () {
8093
8311
  if (this.graphLayoutsLookup) {
@@ -8352,9 +8570,9 @@
8352
8570
  /**
8353
8571
  * Formatter callback function.
8354
8572
  *
8355
- * @callback Highcharts.PlotPackedBubbleDataLabelsFormatterCallbackFunction
8573
+ * @callback Highcharts.SeriesPackedBubbleDataLabelsFormatterCallbackFunction
8356
8574
  *
8357
- * @param {Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject|Highcharts.DataLabelsFormatterContextObject} this
8575
+ * @param {Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject|Highcharts.DataLabelsFormatterContextObject} this
8358
8576
  * Data label context to format
8359
8577
  *
8360
8578
  * @return {string}
@@ -8364,24 +8582,24 @@
8364
8582
  /**
8365
8583
  * Context for the formatter function.
8366
8584
  *
8367
- * @interface Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject
8585
+ * @interface Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject
8368
8586
  * @extends Highcharts.DataLabelsFormatterContextObject
8369
8587
  * @since 7.0.0
8370
8588
  *//**
8371
8589
  * The color of the node.
8372
- * @name Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject#color
8590
+ * @name Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject#color
8373
8591
  * @type {Highcharts.ColorString}
8374
8592
  * @since 7.0.0
8375
8593
  *//**
8376
8594
  * The point (node) object. The node name, if defined, is available through
8377
8595
  * `this.point.name`. Arrays: `this.point.linksFrom` and `this.point.linksTo`
8378
8596
  * contains all nodes connected to this point.
8379
- * @name Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject#point
8597
+ * @name Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject#point
8380
8598
  * @type {Highcharts.Point}
8381
8599
  * @since 7.0.0
8382
8600
  *//**
8383
8601
  * The ID of the node.
8384
- * @name Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject#key
8602
+ * @name Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject#key
8385
8603
  * @type {string}
8386
8604
  * @since 7.0.0
8387
8605
  */
@@ -8389,7 +8607,7 @@
8389
8607
  /**
8390
8608
  * Data labels options
8391
8609
  *
8392
- * @interface Highcharts.PlotPackedBubbleDataLabelsOptionsObject
8610
+ * @interface Highcharts.SeriesPackedBubbleDataLabelsOptionsObject
8393
8611
  * @extends Highcharts.DataLabelsOptionsObject
8394
8612
  * @since 7.0.0
8395
8613
  *//**
@@ -8397,54 +8615,54 @@
8397
8615
  * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)
8398
8616
  * specifying what to show for _node_ in the networkgraph. In v7.0 defaults to
8399
8617
  * `{key}`, since v7.1 defaults to `undefined` and `formatter` is used instead.
8400
- * @name Highcharts.PlotPackedBubbleDataLabelsOptionsObject#format
8618
+ * @name Highcharts.SeriesPackedBubbleDataLabelsOptionsObject#format
8401
8619
  * @type {string}
8402
8620
  * @since 7.0.0
8403
8621
  *//**
8404
8622
  * Callback JavaScript function to format the data label for a node. Note that
8405
8623
  * if a `format` is defined, the format takes precedence and the formatter is
8406
8624
  * ignored.
8407
- * @name Highcharts.PlotPackedBubbleDataLabelsOptionsObject#formatter
8408
- * @type {Highcharts.PlotPackedBubbleDataLabelsFormatterCallbackFunction|undefined}
8625
+ * @name Highcharts.SeriesPackedBubbleDataLabelsOptionsObject#formatter
8626
+ * @type {Highcharts.SeriesPackedBubbleDataLabelsFormatterCallbackFunction|undefined}
8409
8627
  * @since 7.0.0
8410
8628
  *//**
8411
8629
  * Callback to format data labels for _parentNodes_. The `parentNodeFormat`
8412
8630
  * option takes precedence over the `parentNodeFormatter`.
8413
- * @name Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject#parentNodeFormatter
8631
+ * @name Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject#parentNodeFormatter
8414
8632
  * @type {Highcharts.FormatterCallbackFunction<Highcharts.DataLabelsFormatterContextObject>}
8415
8633
  * @since 7.1.0
8416
8634
  *//**
8417
8635
  * Options for a _parentNode_ label text.
8418
8636
  * @sample highcharts/series-packedbubble/packed-dashboard
8419
8637
  * Dashboard with dataLabels on parentNodes
8420
- * @name Highcharts.PlotPackedBubbleDataLabelsFormatterContextObject#parentNodeTextPath
8421
- * @type {Highcharts.PlotPackedBubbleDataLabelsTextPath}
8638
+ * @name Highcharts.SeriesPackedBubbleDataLabelsFormatterContextObject#parentNodeTextPath
8639
+ * @type {Highcharts.SeriesPackedBubbleDataLabelsTextPath}
8422
8640
  * @since 7.1.0
8423
8641
  *//**
8424
8642
  * Options for a _node_ label text which should follow marker's shape.
8425
8643
  * **Note:** Only SVG-based renderer supports this option.
8426
- * @see {@link Highcharts.PlotPackedBubbleDataLabelsTextPath#linkTextPath}
8427
- * @name Highcharts.PlotPackedBubbleDataLabelsOptionsObject#textPath
8428
- * @type {Highcharts.PlotPackedBubbleDataLabelsTextPath}
8644
+ * @see {@link Highcharts.SeriesPackedBubbleDataLabelsTextPath#linkTextPath}
8645
+ * @name Highcharts.SeriesPackedBubbleDataLabelsOptionsObject#textPath
8646
+ * @type {Highcharts.SeriesPackedBubbleDataLabelsTextPath}
8429
8647
  * @since 7.1.0
8430
8648
  */
8431
8649
 
8432
8650
  /**
8433
8651
  * **Note:** Only SVG-based renderer supports this option.
8434
8652
  *
8435
- * @see {@link Highcharts.PlotNetworkDataLabelsTextPath#linkTextPath}
8436
- * @see {@link Highcharts.PlotNetworkDataLabelsTextPath#textPath}
8653
+ * @see {@link Highcharts.SeriesNetworkDataLabelsTextPath#linkTextPath}
8654
+ * @see {@link Highcharts.SeriesNetworkDataLabelsTextPath#textPath}
8437
8655
  *
8438
- * @interface Highcharts.PlotPackedBubbleDataLabelsTextPath
8656
+ * @interface Highcharts.SeriesPackedBubbleDataLabelsTextPath
8439
8657
  * @since 7.1.0
8440
8658
  *//**
8441
8659
  * Presentation attributes for the text path.
8442
- * @name Highcharts.PlotPackedBubbleDataLabelsTextPath#attributes
8660
+ * @name Highcharts.SeriesPackedBubbleDataLabelsTextPath#attributes
8443
8661
  * @type {Highcharts.SVGAttributes}
8444
8662
  * @since 7.1.0
8445
8663
  *//**
8446
8664
  * Enable or disable `textPath` option for link's or marker's data labels.
8447
- * @name Highcharts.PlotPackedBubbleDataLabelsTextPath#enabled
8665
+ * @name Highcharts.SeriesPackedBubbleDataLabelsTextPath#enabled
8448
8666
  * @type {boolean|undefined}
8449
8667
  * @since 7.1.0
8450
8668
  */
@@ -8522,8 +8740,7 @@
8522
8740
  if (this.options.marker) {
8523
8741
  this.series.forEach(function (series) {
8524
8742
  if (series) {
8525
- series.translate();
8526
- series.drawPoints();
8743
+ series.calculateParentRadius();
8527
8744
  }
8528
8745
  });
8529
8746
  }
@@ -8659,7 +8876,10 @@
8659
8876
  (
8660
8877
  // In first iteration system does not move:
8661
8878
  this.systemTemperature > 0 &&
8662
- this.systemTemperature / this.nodes.length < 0.01
8879
+ (
8880
+ this.systemTemperature / this.nodes.length < 0.02 &&
8881
+ this.enableSimulation
8882
+ ) // Use only when simulation is enabled
8663
8883
  );
8664
8884
  }
8665
8885
  }
@@ -8756,7 +8976,8 @@
8756
8976
  */
8757
8977
  useSimulation: true,
8758
8978
  /**
8759
- * @type {Highcharts.PlotPackedBubbleDataLabelsOptionsObject}
8979
+ * @type {Highcharts.SeriesPackedBubbleDataLabelsOptionsObject|Array<Highcharts.SeriesPackedBubbleDataLabelsOptionsObject>}
8980
+ * @default {"formatter": function () { return this.point.value; }, "parentNodeFormatter": function () { return this.name; }, "parentNodeTextPath": {"enabled: true}, "padding": 0}
8760
8981
  *
8761
8982
  * @private
8762
8983
  */
@@ -8853,7 +9074,7 @@
8853
9074
  * @sample highcharts/series-packedbubble/parentnode-style/
8854
9075
  * Bubble size
8855
9076
  *
8856
- * @extends plotOptions.line.marker
9077
+ * @extends plotOptions.series.marker
8857
9078
  * @excluding states
8858
9079
  */
8859
9080
  marker: {
@@ -8980,14 +9201,18 @@
8980
9201
  var series = this,
8981
9202
  dataLabels = [];
8982
9203
  Series.prototype.render.apply(this, arguments);
8983
- series.data.forEach(function (point) {
8984
- if (H.isArray(point.dataLabels)) {
8985
- point.dataLabels.forEach(function (dataLabel) {
8986
- dataLabels.push(dataLabel);
8987
- });
8988
- }
8989
- });
8990
- series.chart.hideOverlappingLabels(dataLabels);
9204
+ // #10823 - dataLabels should stay visible
9205
+ // when enabled allowOverlap.
9206
+ if (!series.options.dataLabels.allowOverlap) {
9207
+ series.data.forEach(function (point) {
9208
+ if (H.isArray(point.dataLabels)) {
9209
+ point.dataLabels.forEach(function (dataLabel) {
9210
+ dataLabels.push(dataLabel);
9211
+ });
9212
+ }
9213
+ });
9214
+ series.chart.hideOverlappingLabels(dataLabels);
9215
+ }
8991
9216
  },
8992
9217
  // Needed because of z-indexing issue if point is added in series.group
8993
9218
  setVisible: function () {
@@ -9038,6 +9263,38 @@
9038
9263
  this.options.dataLabels.textPath = textPath;
9039
9264
  }
9040
9265
  },
9266
+ /**
9267
+ * The function responsible for calculating series bubble' s bBox.
9268
+ * Needed because of exporting failure when useSimulation
9269
+ * is set to false
9270
+ * @private
9271
+ */
9272
+ seriesBox: function () {
9273
+ var series = this,
9274
+ chart = series.chart,
9275
+ data = series.data,
9276
+ max = Math.max,
9277
+ min = Math.min,
9278
+ radius,
9279
+ // bBox = [xMin, xMax, yMin, yMax]
9280
+ bBox = [
9281
+ chart.plotLeft,
9282
+ chart.plotLeft + chart.plotWidth,
9283
+ chart.plotTop,
9284
+ chart.plotTop + chart.plotHeight
9285
+ ];
9286
+
9287
+ data.forEach(function (p) {
9288
+ if (defined(p.plotX) && defined(p.plotY) && p.marker.radius) {
9289
+ radius = p.marker.radius;
9290
+ bBox[0] = min(bBox[0], p.plotX - radius);
9291
+ bBox[1] = max(bBox[1], p.plotX + radius);
9292
+ bBox[2] = min(bBox[2], p.plotY - radius);
9293
+ bBox[3] = max(bBox[3], p.plotY + radius);
9294
+ }
9295
+ });
9296
+ return H.isNumber(bBox.width / bBox.height) ? bBox : null;
9297
+ },
9041
9298
  /**
9042
9299
  * The function responsible for calculating the parent node radius
9043
9300
  * based on the total surface of iniside-bubbles and the group BBox
@@ -9049,10 +9306,7 @@
9049
9306
  parentPadding = 20,
9050
9307
  minParentRadius = 20;
9051
9308
 
9052
- if (series.group) {
9053
- bBox = series.group.element.getBBox();
9054
- }
9055
-
9309
+ bBox = series.seriesBox();
9056
9310
  series.parentNodeRadius =
9057
9311
  Math.min(
9058
9312
  Math.max(
@@ -9456,16 +9710,7 @@
9456
9710
  return b[2] - a[2];
9457
9711
  });
9458
9712
 
9459
- if (sortedArr.length === 1) {
9460
- // if length is 1,return only one bubble
9461
- arr = [
9462
- 0, 0,
9463
- sortedArr[0][0],
9464
- sortedArr[0][1],
9465
- sortedArr[0][2]
9466
- ];
9467
- } else if (sortedArr.length) {
9468
-
9713
+ if (sortedArr.length) {
9469
9714
  // create first bubble in the middle of the chart
9470
9715
  bubblePos.push([
9471
9716
  [
@@ -9476,74 +9721,78 @@
9476
9721
  sortedArr[0][4]
9477
9722
  ] // point index
9478
9723
  ]); // 0 level bubble
9724
+ if (sortedArr.length > 1) {
9725
+
9726
+ bubblePos.push([
9727
+ [
9728
+ 0,
9729
+ 0 - sortedArr[1][2] - sortedArr[0][2],
9730
+ // move bubble above first one
9731
+ sortedArr[1][2],
9732
+ sortedArr[1][3],
9733
+ sortedArr[1][4]
9734
+ ]
9735
+ ]); // 1 level 1st bubble
9736
+
9737
+ // first two already positioned so starting from 2
9738
+ for (i = 2; i < sortedArr.length; i++) {
9739
+ sortedArr[i][2] = sortedArr[i][2] || 1;
9740
+ // in case if radius is calculated as 0.
9741
+ calculatedBubble = positionBubble(
9742
+ bubblePos[stage][j],
9743
+ bubblePos[stage - 1][k],
9744
+ sortedArr[i]
9745
+ ); // calculate initial bubble position
9479
9746
 
9480
- bubblePos.push([
9481
- [
9482
- 0,
9483
- 0 - sortedArr[1][2] - sortedArr[0][2],
9484
- // move bubble above first one
9485
- sortedArr[1][2],
9486
- sortedArr[1][3],
9487
- sortedArr[1][4]
9488
- ]
9489
- ]); // 1 level 1st bubble
9490
-
9491
- // first two already positioned so starting from 2
9492
- for (i = 2; i < sortedArr.length; i++) {
9493
- sortedArr[i][2] = sortedArr[i][2] || 1;
9494
- // in case if radius is calculated as 0.
9495
- calculatedBubble = positionBubble(
9496
- bubblePos[stage][j],
9497
- bubblePos[stage - 1][k],
9498
- sortedArr[i]
9499
- ); // calculate initial bubble position
9500
-
9501
- if (checkOverlap(calculatedBubble, bubblePos[stage][0])) {
9502
- /* if new bubble is overlapping with first bubble
9503
- * in current level (stage)
9504
- */
9505
-
9506
- bubblePos.push([]);
9507
- k = 0;
9508
- /* reset index of bubble, used for
9509
- * positioning the bubbles
9510
- * around it, we are starting from first bubble in next
9511
- * stage because we are changing level to higher
9512
- */
9513
- bubblePos[stage + 1].push(
9514
- positionBubble(
9515
- bubblePos[stage][j],
9516
- bubblePos[stage][0],
9517
- sortedArr[i]
9518
- )
9519
- );
9520
- // (last added bubble, 1. from curr stage, new bubble)
9521
- stage++; // the new level is created, above current one
9522
- j = 0; // set the index of bubble in current level to 0
9523
- } else if (
9524
- stage > 1 && bubblePos[stage - 1][k + 1] &&
9525
- checkOverlap(
9526
- calculatedBubble, bubblePos[stage - 1][k + 1]
9527
- )
9528
- ) {
9529
- /* if new bubble is overlapping with one of the previous
9530
- * stage bubbles, it means that - bubble, used for
9531
- * positioning the bubbles around it has changed
9532
- * so we need to recalculate it
9533
- */
9534
- k++;
9535
- bubblePos[stage].push(
9536
- positionBubble(
9537
- bubblePos[stage][j],
9538
- bubblePos[stage - 1][k],
9539
- sortedArr[i]
9747
+ if (
9748
+ checkOverlap(calculatedBubble, bubblePos[stage][0])
9749
+ ) {
9750
+ /* if new bubble is overlapping with first bubble
9751
+ * in current level (stage)
9752
+ */
9753
+
9754
+ bubblePos.push([]);
9755
+ k = 0;
9756
+ /* reset index of bubble, used for
9757
+ * positioning the bubbles around it,
9758
+ * we are starting from first bubble in next
9759
+ * stage because we are changing level to higher
9760
+ */
9761
+ bubblePos[stage + 1].push(
9762
+ positionBubble(
9763
+ bubblePos[stage][j],
9764
+ bubblePos[stage][0],
9765
+ sortedArr[i]
9766
+ )
9767
+ );
9768
+ // (last bubble, 1. from curr stage, new bubble)
9769
+ stage++; // the new level is created, above current
9770
+ j = 0; // set the index of bubble in curr level to 0
9771
+ } else if (
9772
+ stage > 1 && bubblePos[stage - 1][k + 1] &&
9773
+ checkOverlap(
9774
+ calculatedBubble, bubblePos[stage - 1][k + 1]
9540
9775
  )
9541
- );
9542
- // (last added bubble, prev stage bubble, new bubble)
9543
- j++;
9544
- } else { // simply add calculated bubble
9545
- j++;
9546
- bubblePos[stage].push(calculatedBubble);
9776
+ ) {
9777
+ /* if new bubble is overlapping with one of the prev
9778
+ * stage bubbles, it means that - bubble, used for
9779
+ * positioning the bubbles around it has changed
9780
+ * so we need to recalculate it
9781
+ */
9782
+ k++;
9783
+ bubblePos[stage].push(
9784
+ positionBubble(
9785
+ bubblePos[stage][j],
9786
+ bubblePos[stage - 1][k],
9787
+ sortedArr[i]
9788
+ )
9789
+ );
9790
+ // (last bubble, prev stage bubble, new bubble)
9791
+ j++;
9792
+ } else { // simply add calculated bubble
9793
+ j++;
9794
+ bubblePos[stage].push(calculatedBubble);
9795
+ }
9547
9796
  }
9548
9797
  }
9549
9798
  series.chart.stages = bubblePos;
@@ -9555,7 +9804,6 @@
9555
9804
 
9556
9805
  series.resizeRadius();
9557
9806
  arr = series.chart.rawPositions;
9558
-
9559
9807
  }
9560
9808
  return arr;
9561
9809
  },
@@ -9861,8 +10109,15 @@
9861
10109
  * @apioption series.packedbubble.data
9862
10110
  */
9863
10111
 
10112
+ /**
10113
+ * @type {Highcharts.SeriesPackedBubbleDataLabelsOptionsObject|Array<Highcharts.SeriesPackedBubbleDataLabelsOptionsObject>}
10114
+ * @product highcharts
10115
+ * @apioption series.packedbubble.data.dataLabels
10116
+ */
10117
+
9864
10118
  /**
9865
10119
  * @excluding enabled,enabledThreshold,height,radius,width
10120
+ * @product highcharts
9866
10121
  * @apioption series.packedbubble.marker
9867
10122
  */
9868
10123