highcharts 12.0.2 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/bower.json +1 -1
  2. package/es-modules/Accessibility/Options/A11yDefaults.js +2 -0
  3. package/es-modules/Core/Color/Color.js +5 -12
  4. package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -3
  5. package/es-modules/Core/Renderer/SVG/SVGElement.js +3 -1
  6. package/es-modules/Core/Renderer/SVG/SVGLabel.js +8 -11
  7. package/es-modules/Core/Series/DataLabel.js +3 -1
  8. package/es-modules/Core/Series/Series.js +13 -15
  9. package/es-modules/Core/Templating.js +14 -10
  10. package/es-modules/Core/Time.js +6 -3
  11. package/es-modules/Core/Utilities.js +1 -1
  12. package/es-modules/Data/Converters/CSVConverter.js +1 -0
  13. package/es-modules/Data/Converters/DataConverter.js +31 -0
  14. package/es-modules/Data/Converters/GoogleSheetsConverter.js +1 -0
  15. package/es-modules/Data/Converters/HTMLTableConverter.js +1 -0
  16. package/es-modules/Data/Converters/JSONConverter.js +1 -0
  17. package/es-modules/Extensions/Boost/BoostSeries.js +13 -7
  18. package/es-modules/Extensions/DragPanes/AxisResizer.js +1 -1
  19. package/es-modules/Extensions/SeriesLabel/SeriesLabelDefaults.js +7 -2
  20. package/es-modules/Series/Bubble/BubbleSeries.js +24 -0
  21. package/es-modules/Series/Organization/OrganizationSeriesDefaults.js +3 -1
  22. package/es-modules/Series/Timeline/TimelineSeriesDefaults.js +3 -1
  23. package/es-modules/Series/Treegraph/TreegraphSeriesDefaults.js +3 -1
  24. package/es-modules/Series/Treemap/TreemapPoint.js +7 -2
  25. package/es-modules/Series/Treemap/TreemapSeries.js +154 -53
  26. package/es-modules/Series/Treemap/TreemapSeriesDefaults.js +126 -4
  27. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +1 -0
  28. package/es-modules/Stock/RangeSelector/RangeSelector.js +68 -72
  29. package/es-modules/Stock/RangeSelector/RangeSelectorDefaults.js +10 -4
  30. package/es-modules/masters/indicators/indicators-all.src.js +4 -0
  31. package/es-modules/tsconfig.tsbuildinfo +1 -1
  32. package/highcharts-3d.js +2 -2
  33. package/highcharts-3d.src.js +1 -1
  34. package/highcharts-gantt.js +5 -5
  35. package/highcharts-gantt.src.js +140 -141
  36. package/highcharts-more.js +2 -2
  37. package/highcharts-more.src.js +25 -1
  38. package/highcharts.d.ts +281 -762
  39. package/highcharts.js +3 -3
  40. package/highcharts.src.d.ts +281 -762
  41. package/highcharts.src.js +57 -60
  42. package/highmaps.js +5 -5
  43. package/highmaps.src.js +84 -63
  44. package/highstock.js +5 -5
  45. package/highstock.src.js +140 -141
  46. package/indicators/acceleration-bands.js +2 -2
  47. package/indicators/acceleration-bands.src.js +1 -1
  48. package/indicators/accumulation-distribution.js +2 -2
  49. package/indicators/accumulation-distribution.src.js +1 -1
  50. package/indicators/ao.js +2 -2
  51. package/indicators/ao.src.js +1 -1
  52. package/indicators/apo.js +2 -2
  53. package/indicators/apo.src.js +1 -1
  54. package/indicators/aroon-oscillator.js +2 -2
  55. package/indicators/aroon-oscillator.src.js +1 -1
  56. package/indicators/aroon.js +2 -2
  57. package/indicators/aroon.src.js +1 -1
  58. package/indicators/atr.js +2 -2
  59. package/indicators/atr.src.js +1 -1
  60. package/indicators/bollinger-bands.js +2 -2
  61. package/indicators/bollinger-bands.src.js +1 -1
  62. package/indicators/cci.js +2 -2
  63. package/indicators/cci.src.js +1 -1
  64. package/indicators/chaikin.js +2 -2
  65. package/indicators/chaikin.src.js +1 -1
  66. package/indicators/cmf.js +2 -2
  67. package/indicators/cmf.src.js +1 -1
  68. package/indicators/cmo.js +2 -2
  69. package/indicators/cmo.src.js +1 -1
  70. package/indicators/dema.js +2 -2
  71. package/indicators/dema.src.js +1 -1
  72. package/indicators/disparity-index.js +2 -2
  73. package/indicators/disparity-index.src.js +1 -1
  74. package/indicators/dmi.js +2 -2
  75. package/indicators/dmi.src.js +1 -1
  76. package/indicators/dpo.js +2 -2
  77. package/indicators/dpo.src.js +1 -1
  78. package/indicators/ema.js +1 -1
  79. package/indicators/ichimoku-kinko-hyo.js +2 -2
  80. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  81. package/indicators/indicators-all.js +2 -2
  82. package/indicators/indicators-all.src.js +6 -1
  83. package/indicators/indicators.js +2 -2
  84. package/indicators/indicators.src.js +1 -1
  85. package/indicators/keltner-channels.js +2 -2
  86. package/indicators/keltner-channels.src.js +1 -1
  87. package/indicators/klinger.js +2 -2
  88. package/indicators/klinger.src.js +1 -1
  89. package/indicators/macd.js +2 -2
  90. package/indicators/macd.src.js +1 -1
  91. package/indicators/mfi.js +2 -2
  92. package/indicators/mfi.src.js +1 -1
  93. package/indicators/momentum.js +2 -2
  94. package/indicators/momentum.src.js +1 -1
  95. package/indicators/natr.js +2 -2
  96. package/indicators/natr.src.js +1 -1
  97. package/indicators/obv.js +2 -2
  98. package/indicators/obv.src.js +1 -1
  99. package/indicators/pivot-points.js +2 -2
  100. package/indicators/pivot-points.src.js +1 -1
  101. package/indicators/ppo.js +2 -2
  102. package/indicators/ppo.src.js +1 -1
  103. package/indicators/price-channel.js +2 -2
  104. package/indicators/price-channel.src.js +1 -1
  105. package/indicators/price-envelopes.js +2 -2
  106. package/indicators/price-envelopes.src.js +1 -1
  107. package/indicators/psar.js +2 -2
  108. package/indicators/psar.src.js +1 -1
  109. package/indicators/regressions.js +2 -2
  110. package/indicators/regressions.src.js +1 -1
  111. package/indicators/roc.js +2 -2
  112. package/indicators/roc.src.js +1 -1
  113. package/indicators/rsi.js +2 -2
  114. package/indicators/rsi.src.js +1 -1
  115. package/indicators/slow-stochastic.js +2 -2
  116. package/indicators/slow-stochastic.src.js +1 -1
  117. package/indicators/stochastic.js +2 -2
  118. package/indicators/stochastic.src.js +1 -1
  119. package/indicators/supertrend.js +2 -2
  120. package/indicators/supertrend.src.js +1 -1
  121. package/indicators/tema.js +2 -2
  122. package/indicators/tema.src.js +1 -1
  123. package/indicators/trendline.js +2 -2
  124. package/indicators/trendline.src.js +1 -1
  125. package/indicators/trix.js +2 -2
  126. package/indicators/trix.src.js +1 -1
  127. package/indicators/volume-by-price.js +2 -2
  128. package/indicators/volume-by-price.src.js +2 -1
  129. package/indicators/vwap.js +2 -2
  130. package/indicators/vwap.src.js +1 -1
  131. package/indicators/williams-r.js +2 -2
  132. package/indicators/williams-r.src.js +1 -1
  133. package/indicators/wma.js +2 -2
  134. package/indicators/wma.src.js +1 -1
  135. package/indicators/zigzag.js +2 -2
  136. package/indicators/zigzag.src.js +1 -1
  137. package/modules/accessibility.js +2 -2
  138. package/modules/accessibility.src.js +3 -1
  139. package/modules/annotations-advanced.js +3 -3
  140. package/modules/annotations-advanced.src.js +4 -4
  141. package/modules/annotations.js +2 -2
  142. package/modules/annotations.src.js +3 -3
  143. package/modules/arc-diagram.js +2 -2
  144. package/modules/arc-diagram.src.js +1 -1
  145. package/modules/arrow-symbols.js +2 -2
  146. package/modules/arrow-symbols.src.js +1 -1
  147. package/modules/boost-canvas.js +2 -2
  148. package/modules/boost-canvas.src.js +14 -11
  149. package/modules/boost.js +2 -2
  150. package/modules/boost.src.js +14 -11
  151. package/modules/broken-axis.js +2 -2
  152. package/modules/broken-axis.src.js +1 -1
  153. package/modules/bullet.js +2 -2
  154. package/modules/bullet.src.js +1 -1
  155. package/modules/coloraxis.js +2 -2
  156. package/modules/coloraxis.src.js +1 -1
  157. package/modules/current-date-indicator.js +2 -2
  158. package/modules/current-date-indicator.src.js +1 -1
  159. package/modules/cylinder.js +2 -2
  160. package/modules/cylinder.src.js +1 -1
  161. package/modules/data-tools.js +2 -2
  162. package/modules/data-tools.src.js +36 -1
  163. package/modules/data.js +2 -2
  164. package/modules/data.src.js +1 -1
  165. package/modules/datagrouping.js +2 -2
  166. package/modules/datagrouping.src.js +1 -1
  167. package/modules/debugger.js +2 -2
  168. package/modules/debugger.src.js +1 -1
  169. package/modules/dependency-wheel.js +2 -2
  170. package/modules/dependency-wheel.src.js +1 -1
  171. package/modules/dotplot.js +2 -2
  172. package/modules/dotplot.src.js +1 -1
  173. package/modules/drag-panes.js +2 -2
  174. package/modules/drag-panes.src.js +2 -2
  175. package/modules/draggable-points.js +2 -2
  176. package/modules/draggable-points.src.js +1 -1
  177. package/modules/drilldown.js +2 -2
  178. package/modules/drilldown.src.js +1 -1
  179. package/modules/dumbbell.js +2 -2
  180. package/modules/dumbbell.src.js +1 -1
  181. package/modules/export-data.js +2 -2
  182. package/modules/export-data.src.js +1 -1
  183. package/modules/exporting.js +2 -2
  184. package/modules/exporting.src.js +1 -1
  185. package/modules/flowmap.js +2 -2
  186. package/modules/flowmap.src.js +1 -1
  187. package/modules/full-screen.js +2 -2
  188. package/modules/full-screen.src.js +1 -1
  189. package/modules/funnel.js +2 -2
  190. package/modules/funnel.src.js +1 -1
  191. package/modules/funnel3d.js +2 -2
  192. package/modules/funnel3d.src.js +1 -1
  193. package/modules/gantt.js +6 -6
  194. package/modules/gantt.src.js +82 -80
  195. package/modules/geoheatmap.js +2 -2
  196. package/modules/geoheatmap.src.js +1 -1
  197. package/modules/grid-axis.js +2 -2
  198. package/modules/grid-axis.src.js +1 -1
  199. package/modules/heatmap.js +3 -3
  200. package/modules/heatmap.src.js +2 -2
  201. package/modules/heikinashi.js +2 -2
  202. package/modules/heikinashi.src.js +1 -1
  203. package/modules/histogram-bellcurve.js +2 -2
  204. package/modules/histogram-bellcurve.src.js +1 -1
  205. package/modules/hollowcandlestick.js +2 -2
  206. package/modules/hollowcandlestick.src.js +1 -1
  207. package/modules/item-series.js +2 -2
  208. package/modules/item-series.src.js +1 -1
  209. package/modules/lollipop.js +2 -2
  210. package/modules/lollipop.src.js +1 -1
  211. package/modules/map.js +4 -4
  212. package/modules/map.src.js +26 -2
  213. package/modules/marker-clusters.js +2 -2
  214. package/modules/marker-clusters.src.js +1 -1
  215. package/modules/mouse-wheel-zoom.js +2 -2
  216. package/modules/mouse-wheel-zoom.src.js +1 -1
  217. package/modules/navigator.js +2 -2
  218. package/modules/navigator.src.js +1 -1
  219. package/modules/networkgraph.js +2 -2
  220. package/modules/networkgraph.src.js +1 -1
  221. package/modules/no-data-to-display.js +2 -2
  222. package/modules/no-data-to-display.src.js +1 -1
  223. package/modules/offline-exporting.js +2 -2
  224. package/modules/offline-exporting.src.js +2 -2
  225. package/modules/organization.js +2 -2
  226. package/modules/organization.src.js +4 -2
  227. package/modules/overlapping-datalabels.js +2 -2
  228. package/modules/overlapping-datalabels.src.js +1 -1
  229. package/modules/parallel-coordinates.js +2 -2
  230. package/modules/parallel-coordinates.src.js +1 -1
  231. package/modules/pareto.js +2 -2
  232. package/modules/pareto.src.js +1 -1
  233. package/modules/pathfinder.js +2 -2
  234. package/modules/pathfinder.src.js +1 -1
  235. package/modules/pattern-fill.js +2 -2
  236. package/modules/pattern-fill.src.js +1 -1
  237. package/modules/pictorial.js +2 -2
  238. package/modules/pictorial.src.js +1 -1
  239. package/modules/pointandfigure.js +2 -2
  240. package/modules/pointandfigure.src.js +1 -1
  241. package/modules/price-indicator.js +2 -2
  242. package/modules/price-indicator.src.js +1 -1
  243. package/modules/pyramid3d.js +2 -2
  244. package/modules/pyramid3d.src.js +1 -1
  245. package/modules/renko.js +2 -2
  246. package/modules/renko.src.js +1 -1
  247. package/modules/sankey.js +2 -2
  248. package/modules/sankey.src.js +1 -1
  249. package/modules/series-label.js +2 -2
  250. package/modules/series-label.src.js +8 -3
  251. package/modules/series-on-point.js +2 -2
  252. package/modules/series-on-point.src.js +1 -1
  253. package/modules/solid-gauge.js +2 -2
  254. package/modules/solid-gauge.src.js +1 -1
  255. package/modules/sonification.js +2 -2
  256. package/modules/sonification.src.js +1 -1
  257. package/modules/static-scale.js +2 -2
  258. package/modules/static-scale.src.js +1 -1
  259. package/modules/stock-tools.js +2 -2
  260. package/modules/stock-tools.src.js +3 -3
  261. package/modules/stock.js +6 -6
  262. package/modules/stock.src.js +82 -80
  263. package/modules/streamgraph.js +2 -2
  264. package/modules/streamgraph.src.js +1 -1
  265. package/modules/sunburst.js +2 -2
  266. package/modules/sunburst.src.js +290 -62
  267. package/modules/textpath.js +2 -2
  268. package/modules/textpath.src.js +1 -1
  269. package/modules/tiledwebmap.js +3 -3
  270. package/modules/tiledwebmap.src.js +1 -1
  271. package/modules/tilemap.js +2 -2
  272. package/modules/tilemap.src.js +1 -1
  273. package/modules/timeline.js +2 -2
  274. package/modules/timeline.src.js +4 -2
  275. package/modules/treegraph.js +2 -2
  276. package/modules/treegraph.src.js +4 -2
  277. package/modules/treegrid.js +2 -2
  278. package/modules/treegrid.src.js +1 -1
  279. package/modules/treemap.js +2 -2
  280. package/modules/treemap.src.js +288 -60
  281. package/modules/variable-pie.js +2 -2
  282. package/modules/variable-pie.src.js +1 -1
  283. package/modules/variwide.js +2 -2
  284. package/modules/variwide.src.js +1 -1
  285. package/modules/vector.js +2 -2
  286. package/modules/vector.src.js +1 -1
  287. package/modules/venn.js +2 -2
  288. package/modules/venn.src.js +1 -1
  289. package/modules/windbarb.js +2 -2
  290. package/modules/windbarb.src.js +1 -1
  291. package/modules/wordcloud.js +2 -2
  292. package/modules/wordcloud.src.js +1 -1
  293. package/modules/xrange.js +2 -2
  294. package/modules/xrange.src.js +1 -1
  295. package/options/treegraph.d.ts +559 -70
  296. package/options/treegraph.src.d.ts +559 -70
  297. package/options/treemap.d.ts +314 -160
  298. package/options/treemap.src.d.ts +314 -160
  299. package/options/vbp.d.ts +1 -1
  300. package/options/vbp.src.d.ts +1 -1
  301. package/package.json +1 -1
  302. package/standalone-navigator.js +3 -3
  303. package/standalone-navigator.src.js +58 -61
  304. package/themes/avocado.js +2 -2
  305. package/themes/avocado.src.js +1 -1
  306. package/themes/brand-dark.js +2 -2
  307. package/themes/brand-dark.src.js +1 -1
  308. package/themes/brand-light.js +2 -2
  309. package/themes/brand-light.src.js +1 -1
  310. package/themes/dark-blue.js +2 -2
  311. package/themes/dark-blue.src.js +1 -1
  312. package/themes/dark-green.js +2 -2
  313. package/themes/dark-green.src.js +1 -1
  314. package/themes/dark-unica.js +2 -2
  315. package/themes/dark-unica.src.js +1 -1
  316. package/themes/gray.js +2 -2
  317. package/themes/gray.src.js +1 -1
  318. package/themes/grid-light.js +2 -2
  319. package/themes/grid-light.src.js +1 -1
  320. package/themes/grid.js +2 -2
  321. package/themes/grid.src.js +1 -1
  322. package/themes/high-contrast-dark.js +2 -2
  323. package/themes/high-contrast-dark.src.js +1 -1
  324. package/themes/high-contrast-light.js +2 -2
  325. package/themes/high-contrast-light.src.js +1 -1
  326. package/themes/sand-signika.js +2 -2
  327. package/themes/sand-signika.src.js +1 -1
  328. package/themes/skies.js +2 -2
  329. package/themes/skies.src.js +1 -1
  330. package/themes/sunset.js +2 -2
  331. package/themes/sunset.src.js +1 -1
@@ -29,6 +29,7 @@ const { addEvent, createElement, css, defined, destroyObjectProperties, diffObje
29
29
  * @function preferredInputType
30
30
  */
31
31
  function preferredInputType(format) {
32
+ const hasTimeKey = (char) => new RegExp(`%[[a-zA-Z]*${char}`).test(format);
32
33
  const ms = isString(format) ?
33
34
  format.indexOf('%L') !== -1 :
34
35
  // Implemented but not typed as of 2024
@@ -38,11 +39,10 @@ function preferredInputType(format) {
38
39
  }
39
40
  const date = isString(format) ?
40
41
  ['a', 'A', 'd', 'e', 'w', 'b', 'B', 'm', 'o', 'y', 'Y']
41
- .some((char) => format.indexOf('%' + char) !== -1) :
42
+ .some(hasTimeKey) :
42
43
  format.dateStyle || format.day || format.month || format.year;
43
44
  const time = isString(format) ?
44
- ['H', 'k', 'I', 'l', 'M', 'S']
45
- .some((char) => format.indexOf('%' + char) !== -1) :
45
+ ['H', 'k', 'I', 'l', 'M', 'S'].some(hasTimeKey) :
46
46
  format.timeStyle || format.hour || format.minute || format.second;
47
47
  if (date && time) {
48
48
  return 'datetime-local';
@@ -89,6 +89,16 @@ class RangeSelector {
89
89
  this.isDirty = false;
90
90
  this.buttonOptions = RangeSelector.prototype.defaultButtons;
91
91
  this.initialButtonGroupWidth = 0;
92
+ this.maxButtonWidth = () => {
93
+ let buttonWidth = 0;
94
+ this.buttons.forEach((button) => {
95
+ const bBox = button.getBBox();
96
+ if (bBox.width > buttonWidth) {
97
+ buttonWidth = bBox.width;
98
+ }
99
+ });
100
+ return buttonWidth;
101
+ };
92
102
  this.init(chart);
93
103
  }
94
104
  /* *
@@ -382,9 +392,15 @@ class RangeSelector {
382
392
  if (selectedIndex !== null) {
383
393
  buttonStates[selectedIndex] = 2;
384
394
  rangeSelector.setSelected(selectedIndex);
395
+ if (this.dropdown) {
396
+ this.dropdown.selectedIndex = selectedIndex + 1;
397
+ }
385
398
  }
386
399
  else {
387
400
  rangeSelector.setSelected();
401
+ if (this.dropdown) {
402
+ this.dropdown.selectedIndex = -1;
403
+ }
388
404
  if (dropdownLabel) {
389
405
  dropdownLabel.setState(0);
390
406
  dropdownLabel.attr({
@@ -1003,11 +1019,11 @@ class RangeSelector {
1003
1019
  const { buttonPosition, inputPosition, verticalAlign } = options;
1004
1020
  // Get the X offset required to avoid overlapping with the exporting
1005
1021
  // button. This is used both by the buttonGroup and the inputGroup.
1006
- const getXOffsetForExportButton = (group, position) => {
1022
+ const getXOffsetForExportButton = (group, position, rightAligned) => {
1007
1023
  if (navButtonOptions &&
1008
1024
  this.titleCollision(chart) &&
1009
1025
  verticalAlign === 'top' &&
1010
- position.align === 'right' && ((position.y -
1026
+ rightAligned && ((position.y -
1011
1027
  group.getBBox().height - 12) <
1012
1028
  ((navButtonOptions.y || 0) +
1013
1029
  (navButtonOptions.height || 0) +
@@ -1036,7 +1052,8 @@ class RangeSelector {
1036
1052
  }
1037
1053
  plotLeft -= chart.spacing[3];
1038
1054
  // Detect collision between button group and exporting
1039
- const xOffsetForExportButton = getXOffsetForExportButton(buttonGroup, buttonPosition);
1055
+ const xOffsetForExportButton = getXOffsetForExportButton(buttonGroup, buttonPosition, buttonPosition.align === 'right' ||
1056
+ inputPosition.align === 'right');
1040
1057
  this.alignButtonGroup(xOffsetForExportButton);
1041
1058
  if (this.buttonGroup?.translateY) {
1042
1059
  this.dropdownLabel
@@ -1048,7 +1065,8 @@ class RangeSelector {
1048
1065
  let xOffsetForExportButton = 0;
1049
1066
  if (options.inputEnabled && inputGroup) {
1050
1067
  // Detect collision between the input group and exporting button
1051
- xOffsetForExportButton = getXOffsetForExportButton(inputGroup, inputPosition);
1068
+ xOffsetForExportButton = getXOffsetForExportButton(inputGroup, inputPosition, buttonPosition.align === 'right' ||
1069
+ inputPosition.align === 'right');
1052
1070
  if (inputPosition.align === 'left') {
1053
1071
  translateX = plotLeft;
1054
1072
  }
@@ -1201,16 +1219,35 @@ class RangeSelector {
1201
1219
  * @param {number} [width]
1202
1220
  */
1203
1221
  alignButtonGroup(xOffsetForExportButton, width) {
1204
- const { chart, options, buttonGroup } = this;
1222
+ const { chart, options, buttonGroup, dropdown, dropdownLabel } = this;
1205
1223
  const { buttonPosition } = options;
1206
1224
  const plotLeft = chart.plotLeft - chart.spacing[3];
1207
1225
  let translateX = buttonPosition.x - chart.spacing[3];
1226
+ let dropdownTranslateX = chart.plotLeft;
1208
1227
  if (buttonPosition.align === 'right') {
1209
1228
  translateX += xOffsetForExportButton - plotLeft; // #13014
1229
+ if (this.hasVisibleDropdown) {
1230
+ dropdownTranslateX = chart.chartWidth +
1231
+ xOffsetForExportButton -
1232
+ this.maxButtonWidth() - 20;
1233
+ }
1210
1234
  }
1211
1235
  else if (buttonPosition.align === 'center') {
1212
1236
  translateX -= plotLeft / 2;
1237
+ if (this.hasVisibleDropdown) {
1238
+ dropdownTranslateX = chart.chartWidth / 2 -
1239
+ this.maxButtonWidth();
1240
+ }
1213
1241
  }
1242
+ if (dropdown) {
1243
+ css(dropdown, {
1244
+ left: dropdownTranslateX + 'px',
1245
+ top: buttonGroup?.translateY + 'px'
1246
+ });
1247
+ }
1248
+ dropdownLabel?.attr({
1249
+ x: dropdownTranslateX
1250
+ });
1214
1251
  if (buttonGroup) {
1215
1252
  // Align button group
1216
1253
  buttonGroup.align({
@@ -1264,36 +1301,6 @@ class RangeSelector {
1264
1301
  handleCollision(xOffsetForExportButton) {
1265
1302
  const { chart, buttonGroup, inputGroup } = this;
1266
1303
  const { buttonPosition, dropdown, inputPosition } = this.options;
1267
- const maxButtonWidth = () => {
1268
- let buttonWidth = 0;
1269
- this.buttons.forEach((button) => {
1270
- const bBox = button.getBBox();
1271
- if (bBox.width > buttonWidth) {
1272
- buttonWidth = bBox.width;
1273
- }
1274
- });
1275
- return buttonWidth;
1276
- };
1277
- const groupsOverlap = (buttonGroupWidth) => {
1278
- if (inputGroup?.alignOptions && buttonGroup) {
1279
- const inputGroupX = (inputGroup.alignAttr.translateX +
1280
- inputGroup.alignOptions.x -
1281
- xOffsetForExportButton +
1282
- // `getBBox` for detecing left margin
1283
- inputGroup.getBBox().x +
1284
- // 2px padding to not overlap input and label
1285
- 2);
1286
- const inputGroupWidth = inputGroup.alignOptions.width || 0;
1287
- const buttonGroupX = buttonGroup.alignAttr.translateX +
1288
- buttonGroup.getBBox().x;
1289
- return (buttonGroupX + buttonGroupWidth > inputGroupX) &&
1290
- (inputGroupX + inputGroupWidth > buttonGroupX) &&
1291
- (buttonPosition.y <
1292
- (inputPosition.y +
1293
- inputGroup.getBBox().height));
1294
- }
1295
- return false;
1296
- };
1297
1304
  const moveInputsDown = () => {
1298
1305
  if (inputGroup && buttonGroup) {
1299
1306
  inputGroup.attr({
@@ -1305,47 +1312,43 @@ class RangeSelector {
1305
1312
  });
1306
1313
  }
1307
1314
  };
1308
- if (buttonGroup) {
1309
- if (dropdown === 'always') {
1310
- this.collapseButtons();
1311
- if (groupsOverlap(maxButtonWidth())) {
1312
- // Move the inputs down if there is still a collision
1313
- // after collapsing the buttons
1314
- moveInputsDown();
1315
- }
1316
- return;
1317
- }
1318
- if (dropdown === 'never') {
1319
- this.expandButtons();
1320
- }
1321
- }
1322
1315
  // Detect collision
1323
1316
  if (inputGroup && buttonGroup) {
1324
- if ((inputPosition.align === buttonPosition.align) ||
1325
- // 20 is minimal spacing between elements
1326
- groupsOverlap(this.initialButtonGroupWidth + 20)) {
1317
+ if (inputPosition.align === buttonPosition.align) {
1318
+ moveInputsDown();
1319
+ if (this.initialButtonGroupWidth >
1320
+ chart.plotWidth + xOffsetForExportButton - 20) {
1321
+ this.collapseButtons();
1322
+ }
1323
+ else {
1324
+ this.expandButtons();
1325
+ }
1326
+ }
1327
+ else if (this.initialButtonGroupWidth -
1328
+ xOffsetForExportButton +
1329
+ inputGroup.getBBox().width >
1330
+ chart.plotWidth) {
1327
1331
  if (dropdown === 'responsive') {
1328
1332
  this.collapseButtons();
1329
- if (groupsOverlap(maxButtonWidth())) {
1330
- moveInputsDown();
1331
- }
1332
1333
  }
1333
1334
  else {
1334
1335
  moveInputsDown();
1335
1336
  }
1336
1337
  }
1337
- else if (dropdown === 'responsive') {
1338
+ else {
1338
1339
  this.expandButtons();
1339
1340
  }
1340
1341
  }
1341
- else if (buttonGroup && dropdown === 'responsive') {
1342
- if (this.initialButtonGroupWidth > chart.plotWidth) {
1342
+ // Forced states
1343
+ if (buttonGroup) {
1344
+ if (dropdown === 'always') {
1343
1345
  this.collapseButtons();
1344
1346
  }
1345
- else {
1347
+ if (dropdown === 'never') {
1346
1348
  this.expandButtons();
1347
1349
  }
1348
1350
  }
1351
+ this.alignButtonGroup(xOffsetForExportButton);
1349
1352
  }
1350
1353
  /**
1351
1354
  * Collapse the buttons and show the select element.
@@ -1388,17 +1391,10 @@ class RangeSelector {
1388
1391
  * @function Highcharts.RangeSelector#showDropdown
1389
1392
  */
1390
1393
  showDropdown() {
1391
- const { buttonGroup, chart, dropdownLabel, dropdown } = this;
1394
+ const { buttonGroup, dropdownLabel, dropdown } = this;
1392
1395
  if (buttonGroup && dropdown) {
1393
- const { translateX = 0, translateY = 0 } = buttonGroup, left = chart.plotLeft + translateX, top = translateY;
1394
- dropdownLabel
1395
- .attr({ x: left, y: top })
1396
- .show();
1397
- css(dropdown, {
1398
- left: left + 'px',
1399
- top: top + 'px',
1400
- visibility: 'inherit'
1401
- });
1396
+ dropdownLabel.show();
1397
+ css(dropdown, { visibility: 'inherit' });
1402
1398
  this.hasVisibleDropdown = true;
1403
1399
  }
1404
1400
  }
@@ -440,8 +440,11 @@ const rangeSelector = {
440
440
  * The alignment of the input box. Allowed properties are `left`,
441
441
  * `center`, `right`.
442
442
  *
443
- * @sample {highstock} stock/rangeselector/input-button-position/
444
- * Alignment
443
+ * @sample {highstock} stock/rangeselector/input-button-opposite-alignment/
444
+ * Opposite alignment
445
+ *
446
+ * @sample {highstock} stock/rangeselector/input-button-same-alignment/
447
+ * Same alignment for buttons and input
445
448
  *
446
449
  * @type {Highcharts.AlignValue}
447
450
  * @since 6.0.0
@@ -481,8 +484,11 @@ const rangeSelector = {
481
484
  * The alignment of the input box. Allowed properties are `left`,
482
485
  * `center`, `right`.
483
486
  *
484
- * @sample {highstock} stock/rangeselector/input-button-position/
485
- * Alignment
487
+ * @sample {highstock} stock/rangeselector/input-button-opposite-alignment/
488
+ * Opposite alignment
489
+ *
490
+ * @sample {highstock} stock/rangeselector/input-button-same-alignment/
491
+ * Same alignment for buttons and input
486
492
  *
487
493
  * @type {Highcharts.AlignValue}
488
494
  * @since 6.0.0
@@ -60,4 +60,8 @@ import '../../Stock/Indicators/LinearRegressionAngle/LinearRegressionAngleIndica
60
60
  import '../../Stock/Indicators/ABands/ABandsIndicator.js';
61
61
  import '../../Stock/Indicators/TrendLine/TrendLineIndicator.js';
62
62
  import '../../Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js';
63
+ import MultipleLinesComposition from '../../Stock/Indicators/MultipleLinesComposition.js';
64
+ const G = Highcharts;
65
+ G.MultipleLinesComposition =
66
+ G.MultipleLinesComposition || MultipleLinesComposition;
63
67
  export default Highcharts;