highcharts 12.0.2 → 12.1.1

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 (335) 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/Defaults.js +0 -8
  5. package/es-modules/Core/Globals.js +1 -1
  6. package/es-modules/Core/Pointer.js +3 -1
  7. package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -3
  8. package/es-modules/Core/Renderer/SVG/SVGElement.js +4 -2
  9. package/es-modules/Core/Renderer/SVG/SVGLabel.js +11 -12
  10. package/es-modules/Core/Series/DataLabel.js +1 -0
  11. package/es-modules/Core/Series/Series.js +13 -15
  12. package/es-modules/Core/Templating.js +20 -16
  13. package/es-modules/Core/Time.js +21 -10
  14. package/es-modules/Core/Utilities.js +1 -1
  15. package/es-modules/Data/Converters/CSVConverter.js +1 -0
  16. package/es-modules/Data/Converters/DataConverter.js +31 -0
  17. package/es-modules/Data/Converters/GoogleSheetsConverter.js +1 -0
  18. package/es-modules/Data/Converters/HTMLTableConverter.js +1 -0
  19. package/es-modules/Data/Converters/JSONConverter.js +1 -0
  20. package/es-modules/Extensions/Boost/BoostSeries.js +13 -7
  21. package/es-modules/Extensions/DragPanes/AxisResizer.js +1 -1
  22. package/es-modules/Extensions/Exporting/Exporting.js +16 -8
  23. package/es-modules/Extensions/SeriesLabel/SeriesLabelDefaults.js +7 -2
  24. package/es-modules/Series/Bubble/BubbleSeries.js +24 -0
  25. package/es-modules/Series/Organization/OrganizationSeriesDefaults.js +3 -1
  26. package/es-modules/Series/Timeline/TimelineSeriesDefaults.js +3 -1
  27. package/es-modules/Series/Treegraph/TreegraphSeriesDefaults.js +3 -1
  28. package/es-modules/Series/Treemap/TreemapPoint.js +7 -2
  29. package/es-modules/Series/Treemap/TreemapSeries.js +154 -53
  30. package/es-modules/Series/Treemap/TreemapSeriesDefaults.js +126 -4
  31. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +1 -0
  32. package/es-modules/Stock/RangeSelector/RangeSelector.js +75 -71
  33. package/es-modules/Stock/RangeSelector/RangeSelectorDefaults.js +10 -4
  34. package/es-modules/masters/indicators/indicators-all.src.js +4 -0
  35. package/es-modules/tsconfig.tsbuildinfo +1 -1
  36. package/highcharts-3d.js +2 -2
  37. package/highcharts-3d.src.js +1 -1
  38. package/highcharts-gantt.js +5 -5
  39. package/highcharts-gantt.src.js +174 -164
  40. package/highcharts-more.js +2 -2
  41. package/highcharts-more.src.js +25 -1
  42. package/highcharts.d.ts +301 -764
  43. package/highcharts.js +3 -3
  44. package/highcharts.src.d.ts +301 -764
  45. package/highcharts.src.js +84 -84
  46. package/highmaps.js +5 -5
  47. package/highmaps.src.js +111 -87
  48. package/highstock.js +5 -5
  49. package/highstock.src.js +174 -164
  50. package/indicators/acceleration-bands.js +2 -2
  51. package/indicators/acceleration-bands.src.js +1 -1
  52. package/indicators/accumulation-distribution.js +2 -2
  53. package/indicators/accumulation-distribution.src.js +1 -1
  54. package/indicators/ao.js +2 -2
  55. package/indicators/ao.src.js +1 -1
  56. package/indicators/apo.js +2 -2
  57. package/indicators/apo.src.js +1 -1
  58. package/indicators/aroon-oscillator.js +2 -2
  59. package/indicators/aroon-oscillator.src.js +1 -1
  60. package/indicators/aroon.js +2 -2
  61. package/indicators/aroon.src.js +1 -1
  62. package/indicators/atr.js +2 -2
  63. package/indicators/atr.src.js +1 -1
  64. package/indicators/bollinger-bands.js +2 -2
  65. package/indicators/bollinger-bands.src.js +1 -1
  66. package/indicators/cci.js +2 -2
  67. package/indicators/cci.src.js +1 -1
  68. package/indicators/chaikin.js +2 -2
  69. package/indicators/chaikin.src.js +1 -1
  70. package/indicators/cmf.js +2 -2
  71. package/indicators/cmf.src.js +1 -1
  72. package/indicators/cmo.js +2 -2
  73. package/indicators/cmo.src.js +1 -1
  74. package/indicators/dema.js +2 -2
  75. package/indicators/dema.src.js +1 -1
  76. package/indicators/disparity-index.js +2 -2
  77. package/indicators/disparity-index.src.js +1 -1
  78. package/indicators/dmi.js +2 -2
  79. package/indicators/dmi.src.js +1 -1
  80. package/indicators/dpo.js +2 -2
  81. package/indicators/dpo.src.js +1 -1
  82. package/indicators/ema.js +1 -1
  83. package/indicators/ichimoku-kinko-hyo.js +2 -2
  84. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  85. package/indicators/indicators-all.js +2 -2
  86. package/indicators/indicators-all.src.js +6 -1
  87. package/indicators/indicators.js +2 -2
  88. package/indicators/indicators.src.js +1 -1
  89. package/indicators/keltner-channels.js +2 -2
  90. package/indicators/keltner-channels.src.js +1 -1
  91. package/indicators/klinger.js +2 -2
  92. package/indicators/klinger.src.js +1 -1
  93. package/indicators/macd.js +2 -2
  94. package/indicators/macd.src.js +1 -1
  95. package/indicators/mfi.js +2 -2
  96. package/indicators/mfi.src.js +1 -1
  97. package/indicators/momentum.js +2 -2
  98. package/indicators/momentum.src.js +1 -1
  99. package/indicators/natr.js +2 -2
  100. package/indicators/natr.src.js +1 -1
  101. package/indicators/obv.js +2 -2
  102. package/indicators/obv.src.js +1 -1
  103. package/indicators/pivot-points.js +2 -2
  104. package/indicators/pivot-points.src.js +1 -1
  105. package/indicators/ppo.js +2 -2
  106. package/indicators/ppo.src.js +1 -1
  107. package/indicators/price-channel.js +2 -2
  108. package/indicators/price-channel.src.js +1 -1
  109. package/indicators/price-envelopes.js +2 -2
  110. package/indicators/price-envelopes.src.js +1 -1
  111. package/indicators/psar.js +2 -2
  112. package/indicators/psar.src.js +1 -1
  113. package/indicators/regressions.js +2 -2
  114. package/indicators/regressions.src.js +1 -1
  115. package/indicators/roc.js +2 -2
  116. package/indicators/roc.src.js +1 -1
  117. package/indicators/rsi.js +2 -2
  118. package/indicators/rsi.src.js +1 -1
  119. package/indicators/slow-stochastic.js +2 -2
  120. package/indicators/slow-stochastic.src.js +1 -1
  121. package/indicators/stochastic.js +2 -2
  122. package/indicators/stochastic.src.js +1 -1
  123. package/indicators/supertrend.js +2 -2
  124. package/indicators/supertrend.src.js +1 -1
  125. package/indicators/tema.js +2 -2
  126. package/indicators/tema.src.js +1 -1
  127. package/indicators/trendline.js +2 -2
  128. package/indicators/trendline.src.js +1 -1
  129. package/indicators/trix.js +2 -2
  130. package/indicators/trix.src.js +1 -1
  131. package/indicators/volume-by-price.js +2 -2
  132. package/indicators/volume-by-price.src.js +2 -1
  133. package/indicators/vwap.js +2 -2
  134. package/indicators/vwap.src.js +1 -1
  135. package/indicators/williams-r.js +2 -2
  136. package/indicators/williams-r.src.js +1 -1
  137. package/indicators/wma.js +2 -2
  138. package/indicators/wma.src.js +1 -1
  139. package/indicators/zigzag.js +2 -2
  140. package/indicators/zigzag.src.js +1 -1
  141. package/modules/accessibility.js +2 -2
  142. package/modules/accessibility.src.js +3 -1
  143. package/modules/annotations-advanced.js +3 -3
  144. package/modules/annotations-advanced.src.js +4 -4
  145. package/modules/annotations.js +2 -2
  146. package/modules/annotations.src.js +3 -3
  147. package/modules/arc-diagram.js +2 -2
  148. package/modules/arc-diagram.src.js +1 -1
  149. package/modules/arrow-symbols.js +2 -2
  150. package/modules/arrow-symbols.src.js +1 -1
  151. package/modules/boost-canvas.js +2 -2
  152. package/modules/boost-canvas.src.js +14 -11
  153. package/modules/boost.js +2 -2
  154. package/modules/boost.src.js +14 -11
  155. package/modules/broken-axis.js +2 -2
  156. package/modules/broken-axis.src.js +1 -1
  157. package/modules/bullet.js +2 -2
  158. package/modules/bullet.src.js +1 -1
  159. package/modules/coloraxis.js +2 -2
  160. package/modules/coloraxis.src.js +1 -1
  161. package/modules/current-date-indicator.js +2 -2
  162. package/modules/current-date-indicator.src.js +1 -1
  163. package/modules/cylinder.js +2 -2
  164. package/modules/cylinder.src.js +1 -1
  165. package/modules/data-tools.js +2 -2
  166. package/modules/data-tools.src.js +36 -1
  167. package/modules/data.js +2 -2
  168. package/modules/data.src.js +1 -1
  169. package/modules/datagrouping.js +2 -2
  170. package/modules/datagrouping.src.js +1 -1
  171. package/modules/debugger.js +2 -2
  172. package/modules/debugger.src.js +1 -1
  173. package/modules/dependency-wheel.js +2 -2
  174. package/modules/dependency-wheel.src.js +1 -1
  175. package/modules/dotplot.js +2 -2
  176. package/modules/dotplot.src.js +1 -1
  177. package/modules/drag-panes.js +2 -2
  178. package/modules/drag-panes.src.js +2 -2
  179. package/modules/draggable-points.js +2 -2
  180. package/modules/draggable-points.src.js +1 -1
  181. package/modules/drilldown.js +2 -2
  182. package/modules/drilldown.src.js +1 -1
  183. package/modules/dumbbell.js +2 -2
  184. package/modules/dumbbell.src.js +1 -1
  185. package/modules/export-data.js +2 -2
  186. package/modules/export-data.src.js +1 -1
  187. package/modules/exporting.js +2 -2
  188. package/modules/exporting.src.js +17 -9
  189. package/modules/flowmap.js +2 -2
  190. package/modules/flowmap.src.js +1 -1
  191. package/modules/full-screen.js +2 -2
  192. package/modules/full-screen.src.js +1 -1
  193. package/modules/funnel.js +2 -2
  194. package/modules/funnel.src.js +1 -1
  195. package/modules/funnel3d.js +2 -2
  196. package/modules/funnel3d.src.js +1 -1
  197. package/modules/gantt.js +5 -5
  198. package/modules/gantt.src.js +89 -79
  199. package/modules/geoheatmap.js +2 -2
  200. package/modules/geoheatmap.src.js +1 -1
  201. package/modules/grid-axis.js +2 -2
  202. package/modules/grid-axis.src.js +1 -1
  203. package/modules/heatmap.js +3 -3
  204. package/modules/heatmap.src.js +2 -2
  205. package/modules/heikinashi.js +2 -2
  206. package/modules/heikinashi.src.js +1 -1
  207. package/modules/histogram-bellcurve.js +2 -2
  208. package/modules/histogram-bellcurve.src.js +1 -1
  209. package/modules/hollowcandlestick.js +2 -2
  210. package/modules/hollowcandlestick.src.js +1 -1
  211. package/modules/item-series.js +2 -2
  212. package/modules/item-series.src.js +1 -1
  213. package/modules/lollipop.js +2 -2
  214. package/modules/lollipop.src.js +1 -1
  215. package/modules/map.js +4 -4
  216. package/modules/map.src.js +26 -2
  217. package/modules/marker-clusters.js +2 -2
  218. package/modules/marker-clusters.src.js +1 -1
  219. package/modules/mouse-wheel-zoom.js +2 -2
  220. package/modules/mouse-wheel-zoom.src.js +1 -1
  221. package/modules/navigator.js +2 -2
  222. package/modules/navigator.src.js +1 -1
  223. package/modules/networkgraph.js +2 -2
  224. package/modules/networkgraph.src.js +1 -1
  225. package/modules/no-data-to-display.js +2 -2
  226. package/modules/no-data-to-display.src.js +1 -1
  227. package/modules/offline-exporting.js +2 -2
  228. package/modules/offline-exporting.src.js +18 -10
  229. package/modules/organization.js +2 -2
  230. package/modules/organization.src.js +4 -2
  231. package/modules/overlapping-datalabels.js +2 -2
  232. package/modules/overlapping-datalabels.src.js +1 -1
  233. package/modules/parallel-coordinates.js +2 -2
  234. package/modules/parallel-coordinates.src.js +1 -1
  235. package/modules/pareto.js +2 -2
  236. package/modules/pareto.src.js +1 -1
  237. package/modules/pathfinder.js +2 -2
  238. package/modules/pathfinder.src.js +1 -1
  239. package/modules/pattern-fill.js +2 -2
  240. package/modules/pattern-fill.src.js +1 -1
  241. package/modules/pictorial.js +2 -2
  242. package/modules/pictorial.src.js +1 -1
  243. package/modules/pointandfigure.js +2 -2
  244. package/modules/pointandfigure.src.js +1 -1
  245. package/modules/price-indicator.js +2 -2
  246. package/modules/price-indicator.src.js +1 -1
  247. package/modules/pyramid3d.js +2 -2
  248. package/modules/pyramid3d.src.js +1 -1
  249. package/modules/renko.js +2 -2
  250. package/modules/renko.src.js +1 -1
  251. package/modules/sankey.js +2 -2
  252. package/modules/sankey.src.js +1 -1
  253. package/modules/series-label.js +2 -2
  254. package/modules/series-label.src.js +8 -3
  255. package/modules/series-on-point.js +2 -2
  256. package/modules/series-on-point.src.js +1 -1
  257. package/modules/solid-gauge.js +2 -2
  258. package/modules/solid-gauge.src.js +1 -1
  259. package/modules/sonification.js +2 -2
  260. package/modules/sonification.src.js +1 -1
  261. package/modules/static-scale.js +2 -2
  262. package/modules/static-scale.src.js +1 -1
  263. package/modules/stock-tools.js +2 -2
  264. package/modules/stock-tools.src.js +3 -3
  265. package/modules/stock.js +6 -6
  266. package/modules/stock.src.js +89 -79
  267. package/modules/streamgraph.js +2 -2
  268. package/modules/streamgraph.src.js +1 -1
  269. package/modules/sunburst.js +2 -2
  270. package/modules/sunburst.src.js +290 -62
  271. package/modules/textpath.js +2 -2
  272. package/modules/textpath.src.js +1 -1
  273. package/modules/tiledwebmap.js +3 -3
  274. package/modules/tiledwebmap.src.js +1 -1
  275. package/modules/tilemap.js +2 -2
  276. package/modules/tilemap.src.js +1 -1
  277. package/modules/timeline.js +2 -2
  278. package/modules/timeline.src.js +4 -2
  279. package/modules/treegraph.js +2 -2
  280. package/modules/treegraph.src.js +4 -2
  281. package/modules/treegrid.js +2 -2
  282. package/modules/treegrid.src.js +1 -1
  283. package/modules/treemap.js +2 -2
  284. package/modules/treemap.src.js +288 -60
  285. package/modules/variable-pie.js +2 -2
  286. package/modules/variable-pie.src.js +1 -1
  287. package/modules/variwide.js +2 -2
  288. package/modules/variwide.src.js +1 -1
  289. package/modules/vector.js +2 -2
  290. package/modules/vector.src.js +1 -1
  291. package/modules/venn.js +2 -2
  292. package/modules/venn.src.js +1 -1
  293. package/modules/windbarb.js +2 -2
  294. package/modules/windbarb.src.js +1 -1
  295. package/modules/wordcloud.js +2 -2
  296. package/modules/wordcloud.src.js +1 -1
  297. package/modules/xrange.js +2 -2
  298. package/modules/xrange.src.js +1 -1
  299. package/options/treegraph.d.ts +559 -70
  300. package/options/treegraph.src.d.ts +559 -70
  301. package/options/treemap.d.ts +314 -160
  302. package/options/treemap.src.d.ts +314 -160
  303. package/options/vbp.d.ts +1 -1
  304. package/options/vbp.src.d.ts +1 -1
  305. package/package.json +1 -1
  306. package/standalone-navigator.js +3 -3
  307. package/standalone-navigator.src.js +85 -85
  308. package/themes/avocado.js +2 -2
  309. package/themes/avocado.src.js +1 -1
  310. package/themes/brand-dark.js +2 -2
  311. package/themes/brand-dark.src.js +1 -1
  312. package/themes/brand-light.js +2 -2
  313. package/themes/brand-light.src.js +1 -1
  314. package/themes/dark-blue.js +2 -2
  315. package/themes/dark-blue.src.js +1 -1
  316. package/themes/dark-green.js +2 -2
  317. package/themes/dark-green.src.js +1 -1
  318. package/themes/dark-unica.js +2 -2
  319. package/themes/dark-unica.src.js +1 -1
  320. package/themes/gray.js +2 -2
  321. package/themes/gray.src.js +1 -1
  322. package/themes/grid-light.js +2 -2
  323. package/themes/grid-light.src.js +1 -1
  324. package/themes/grid.js +2 -2
  325. package/themes/grid.src.js +1 -1
  326. package/themes/high-contrast-dark.js +2 -2
  327. package/themes/high-contrast-dark.src.js +1 -1
  328. package/themes/high-contrast-light.js +2 -2
  329. package/themes/high-contrast-light.src.js +1 -1
  330. package/themes/sand-signika.js +2 -2
  331. package/themes/sand-signika.src.js +1 -1
  332. package/themes/skies.js +2 -2
  333. package/themes/skies.src.js +1 -1
  334. package/themes/sunset.js +2 -2
  335. package/themes/sunset.src.js +1 -1
package/highstock.src.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v12.0.2 (2024-12-04)
2
+ * @license Highcharts JS v12.1.1 (2024-12-20)
3
3
  * @module highcharts/highcharts
4
4
  *
5
5
  * (c) 2009-2024 Torstein Honsi
@@ -74,12 +74,12 @@ var Globals;
74
74
  * Constants
75
75
  *
76
76
  * */
77
- Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '12.0.2', Globals.win = (typeof window !== 'undefined' ?
77
+ Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '12.1.1', Globals.win = (typeof window !== 'undefined' ?
78
78
  window :
79
79
  {}), // eslint-disable-line node/no-unsupported-features/es-builtins
80
80
  Globals.doc = Globals.win.document, Globals.svg = (Globals.doc &&
81
81
  Globals.doc.createElementNS &&
82
- !!Globals.doc.createElementNS(Globals.SVG_NS, 'svg').createSVGRect), Globals.userAgent = (Globals.win.navigator && Globals.win.navigator.userAgent) || '', Globals.isChrome = Globals.win.chrome, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.marginNames = [
82
+ !!Globals.doc.createElementNS(Globals.SVG_NS, 'svg').createSVGRect), Globals.pageLang = Globals.doc?.body.closest('[lang]')?.lang, Globals.userAgent = (Globals.win.navigator && Globals.win.navigator.userAgent) || '', Globals.isChrome = Globals.win.chrome, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.marginNames = [
83
83
  'plotTop',
84
84
  'marginRight',
85
85
  'marginBottom',
@@ -1275,7 +1275,7 @@ function getNestedProperty(path, parent) {
1275
1275
  }
1276
1276
  return thisProp ?? parent;
1277
1277
  }
1278
- const child = parent[pathElement];
1278
+ const child = parent[pathElement.replace(/[\\'"]/g, '')];
1279
1279
  // Filter on the child
1280
1280
  if (!defined(child) ||
1281
1281
  typeof child === 'function' ||
@@ -3500,7 +3500,7 @@ const SeriesPalettes = {
3500
3500
  * */
3501
3501
 
3502
3502
 
3503
- const { win: Time_win } = Core_Globals;
3503
+ const { pageLang, win: Time_win } = Core_Globals;
3504
3504
 
3505
3505
  const { defined: Time_defined, error: Time_error, extend: Time_extend, isNumber: Time_isNumber, isObject: Time_isObject, isString: Time_isString, merge: Time_merge, objectEach: Time_objectEach, pad: Time_pad, splat: Time_splat, timeUnits: Time_timeUnits, ucfirst: Time_ucfirst } = Core_Utilities;
3506
3506
  /* *
@@ -3527,9 +3527,17 @@ const spanishWeekdayIndex = (weekday) => ['D', 'L', 'M', 'X', 'J', 'V', 'S'].ind
3527
3527
  * `Highcharts.setOptions`, or individually for each Chart item through the
3528
3528
  * [time](https://api.highcharts.com/highcharts/time) options set.
3529
3529
  *
3530
- * The Time object is available from {@link Highcharts.Chart#time},
3531
- * which refers to `Highcharts.time` if no individual time settings are
3532
- * applied.
3530
+ * The Time object is available from {@link Highcharts.Chart#time}, which refers
3531
+ * to `Highcharts.time` unless individual time settings are applied for each
3532
+ * chart.
3533
+ *
3534
+ * When configuring time settings for individual chart instances, be aware that
3535
+ * using `Highcharts.dateFormat` or `Highcharts.time.dateFormat` within
3536
+ * formatter callbacks relies on the global time object, which applies the
3537
+ * global language and time zone settings. To ensure charts with local time
3538
+ * settings function correctly, use `chart.time.dateFormat? instead. However,
3539
+ * the recommended best practice is to use `setOptions` to define global time
3540
+ * settings unless specific configurations are needed for each chart.
3533
3541
  *
3534
3542
  * @example
3535
3543
  * // Apply time settings globally
@@ -3567,8 +3575,8 @@ const spanishWeekdayIndex = (weekday) => ['D', 'L', 'M', 'X', 'J', 'V', 'S'].ind
3567
3575
  * @class
3568
3576
  * @name Highcharts.Time
3569
3577
  *
3570
- * @param {Highcharts.TimeOptions} [options]
3571
- * Time options as defined in [chart.options.time](/highcharts/time).
3578
+ * @param {Highcharts.TimeOptions} [options] Time options as defined in
3579
+ * [chart.options.time](/highcharts/time).
3572
3580
  */
3573
3581
  class Time {
3574
3582
  /* *
@@ -3582,7 +3590,9 @@ class Time {
3582
3590
  * Properties
3583
3591
  *
3584
3592
  * */
3585
- this.options = {};
3593
+ this.options = {
3594
+ timezone: 'UTC'
3595
+ };
3586
3596
  this.variableTimezone = false;
3587
3597
  this.Date = Time_win.Date;
3588
3598
  this.update(options);
@@ -3604,12 +3614,13 @@ class Time {
3604
3614
  *
3605
3615
  */
3606
3616
  update(options = {}) {
3607
- let timezone = options.timezone ?? 'UTC';
3608
3617
  this.dTLCache = {};
3609
3618
  this.options = options = Time_merge(true, this.options, options);
3610
3619
  const { timezoneOffset, useUTC } = options;
3611
3620
  // Allow using a different Date class
3612
3621
  this.Date = options.Date || Time_win.Date || Date;
3622
+ // Assign the time zone. Handle the legacy, deprecated `useUTC` option.
3623
+ let timezone = options.timezone;
3613
3624
  if (Time_defined(useUTC)) {
3614
3625
  timezone = useUTC ? 'UTC' : void 0;
3615
3626
  }
@@ -3685,7 +3696,7 @@ class Time {
3685
3696
  /**
3686
3697
  * Shorthand to get a cached `Intl.DateTimeFormat` instance.
3687
3698
  */
3688
- dateTimeFormat(options, timestamp, locale = this.options.locale) {
3699
+ dateTimeFormat(options, timestamp, locale = this.options.locale || pageLang) {
3689
3700
  const cacheKey = JSON.stringify(options) + locale;
3690
3701
  if (Time_isString(options)) {
3691
3702
  options = this.str2dtf(options);
@@ -4052,7 +4063,7 @@ class Time {
4052
4063
  }
4053
4064
  else if (Time_isObject(format)) {
4054
4065
  const tzHours = (this.getTimezoneOffset(timestamp) || 0) /
4055
- (60000 * 60), timeZone = this.options.timezone || ('Etc/GMT' + (tzHours >= 0 ? '+' : '') + tzHours), { prefix = '', suffix = '' } = format;
4066
+ (60000 * 60), timeZone = this.timezone || ('Etc/GMT' + (tzHours >= 0 ? '+' : '') + tzHours), { prefix = '', suffix = '' } = format;
4056
4067
  format = prefix + this.dateTimeFormat(Time_extend({ timeZone }, format), timestamp) + suffix;
4057
4068
  }
4058
4069
  // Optionally sentence-case the string and return
@@ -7063,14 +7074,6 @@ const defaultOptions = {
7063
7074
  text: 'Highcharts.com'
7064
7075
  }
7065
7076
  };
7066
- /* eslint-disable spaced-comment */
7067
- /*= if (!build.classic) { =*/
7068
- // Legacy build for styled mode, set the styledMode option to true by default.
7069
- defaultOptions.chart.styledMode = true;
7070
- /*= } else { =*/
7071
- defaultOptions.chart.styledMode = false;
7072
- /*= } =*/
7073
- '';
7074
7077
  const defaultTime = new Core_Time(defaultOptions.time);
7075
7078
  /**
7076
7079
  * Get the updated default options. Until 3.0.7, merely exposing defaultOptions
@@ -7460,18 +7463,11 @@ class Color {
7460
7463
  }
7461
7464
  // Check for has alpha, because rgba colors perform worse due to
7462
7465
  // lack of support in WebKit.
7463
- const hasAlpha = (toRgba[3] !== 1 || fromRgba[3] !== 1);
7464
- return (hasAlpha ? 'rgba(' : 'rgb(') +
7465
- Math.round(toRgba[0] + (fromRgba[0] - toRgba[0]) * (1 - pos)) +
7466
- ',' +
7467
- Math.round(toRgba[1] + (fromRgba[1] - toRgba[1]) * (1 - pos)) +
7468
- ',' +
7469
- Math.round(toRgba[2] + (fromRgba[2] - toRgba[2]) * (1 - pos)) +
7470
- (hasAlpha ?
7471
- (',' +
7472
- (toRgba[3] + (fromRgba[3] - toRgba[3]) * (1 - pos))) :
7473
- '') +
7474
- ')';
7466
+ const hasAlpha = (toRgba[3] !== 1 || fromRgba[3] !== 1), channel = (to, i) => to + (fromRgba[i] - to) * (1 - pos), rgba = toRgba.slice(0, 3).map(channel).map(Math.round);
7467
+ if (hasAlpha) {
7468
+ rgba.push(channel(toRgba[3], 3));
7469
+ }
7470
+ return (hasAlpha ? 'rgba(' : 'rgb(') + rgba.join(',') + ')';
7475
7471
  }
7476
7472
  }
7477
7473
  /* *
@@ -8838,9 +8834,9 @@ AST.bypassHTMLFiltering = false;
8838
8834
 
8839
8835
  const { defaultOptions: Templating_defaultOptions, defaultTime: Templating_defaultTime } = Defaults;
8840
8836
 
8841
- const { doc: Templating_doc } = Core_Globals;
8837
+ const { pageLang: Templating_pageLang } = Core_Globals;
8842
8838
 
8843
- const { extend: Templating_extend, getNestedProperty: Templating_getNestedProperty, isArray: Templating_isArray, isNumber: Templating_isNumber, isObject: Templating_isObject, pick: Templating_pick, ucfirst: Templating_ucfirst } = Core_Utilities;
8839
+ const { extend: Templating_extend, getNestedProperty: Templating_getNestedProperty, isArray: Templating_isArray, isNumber: Templating_isNumber, isObject: Templating_isObject, isString: Templating_isString, pick: Templating_pick, ucfirst: Templating_ucfirst } = Core_Utilities;
8844
8840
  const helpers = {
8845
8841
  // Built-in helpers
8846
8842
  add: (a, b) => a + b,
@@ -8875,6 +8871,8 @@ const numberFormatCache = {};
8875
8871
  * Functions
8876
8872
  *
8877
8873
  * */
8874
+ // Internal convenience function
8875
+ const isQuotedString = (str) => /^["'].+["']$/.test(str);
8878
8876
  /**
8879
8877
  * Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970) into a
8880
8878
  * human readable date string. The format is a subset of the formats for PHP's
@@ -8952,11 +8950,11 @@ function dateFormat(format, timestamp, upperCaseFirst) {
8952
8950
  * The formatted string.
8953
8951
  */
8954
8952
  function format(str = '', ctx, chart) {
8955
- const regex = /\{([\p{L}\d:\.,;\-\/<>\[\]%_@"'’= #\(\)]+)\}/gu,
8953
+ const regex = /\{([\p{L}\d:\.,;\-\/<>\[\]%_@+"'’= #\(\)]+)\}/gu,
8956
8954
  // The sub expression regex is the same as the top expression regex,
8957
8955
  // but except parens and block helpers (#), and surrounded by parens
8958
8956
  // instead of curly brackets.
8959
- subRegex = /\(([\p{L}\d:\.,;\-\/<>\[\]%_@"'= ]+)\)/gu, matches = [], floatRegex = /f$/, decRegex = /\.(\d)/, lang = chart?.options.lang || Templating_defaultOptions.lang, time = chart && chart.time || Templating_defaultTime, numberFormatter = chart && chart.numberFormatter || numberFormat;
8957
+ subRegex = /\(([\p{L}\d:\.,;\-\/<>\[\]%_@+"'= ]+)\)/gu, matches = [], floatRegex = /f$/, decRegex = /\.(\d)/, lang = chart?.options.lang || Templating_defaultOptions.lang, time = chart && chart.time || Templating_defaultTime, numberFormatter = chart && chart.numberFormatter || numberFormat;
8960
8958
  /*
8961
8959
  * Get a literal or variable value inside a template expression. May be
8962
8960
  * extended with other types like string or null if needed, but keep it
@@ -8974,7 +8972,7 @@ function format(str = '', ctx, chart) {
8974
8972
  if ((n = Number(key)).toString() === key) {
8975
8973
  return n;
8976
8974
  }
8977
- if (/^["'].+["']$/.test(key)) {
8975
+ if (isQuotedString(key)) {
8978
8976
  return key.slice(1, -1);
8979
8977
  }
8980
8978
  // Variables and constants
@@ -9087,7 +9085,8 @@ function format(str = '', ctx, chart) {
9087
9085
  // Simple variable replacement
9088
9086
  }
9089
9087
  else {
9090
- const valueAndFormat = expression.split(':');
9088
+ const valueAndFormat = isQuotedString(expression) ?
9089
+ [expression] : expression.split(':');
9091
9090
  replacement = resolveProperty(valueAndFormat.shift() || '');
9092
9091
  // Format the replacement
9093
9092
  if (valueAndFormat.length && typeof replacement === 'number') {
@@ -9100,13 +9099,14 @@ function format(str = '', ctx, chart) {
9100
9099
  }
9101
9100
  else {
9102
9101
  replacement = time.dateFormat(segment, replacement);
9103
- // Use string literal in order to be preserved in the outer
9104
- // expression
9105
- if (hasSub) {
9106
- replacement = `"${replacement}"`;
9107
- }
9108
9102
  }
9109
9103
  }
9104
+ // Use string literal in order to be preserved in the outer
9105
+ // expression
9106
+ subRegex.lastIndex = 0;
9107
+ if (subRegex.test(match.find) && Templating_isString(replacement)) {
9108
+ replacement = `"${replacement}"`;
9109
+ }
9110
9110
  }
9111
9111
  str = str.replace(match.find, Templating_pick(replacement, ''));
9112
9112
  });
@@ -9187,16 +9187,16 @@ function numberFormat(number, decimals, decimalPoint, thousandsSep) {
9187
9187
  }
9188
9188
  const hasSeparators = thousandsSep || decimalPoint, locale = hasSeparators ?
9189
9189
  'en' :
9190
- (this?.locale ||
9191
- lang.locale ||
9192
- Templating_doc.body.closest('[lang]')?.lang), cacheKey = JSON.stringify(options) + locale, nf = numberFormatCache[cacheKey] ?? (numberFormatCache[cacheKey] = new Intl.NumberFormat(locale, options));
9190
+ (this?.locale || lang.locale || Templating_pageLang), cacheKey = JSON.stringify(options) + locale, nf = numberFormatCache[cacheKey] ?? (numberFormatCache[cacheKey] = new Intl.NumberFormat(locale, options));
9193
9191
  ret = nf.format(number);
9194
9192
  // If thousandsSep or decimalPoint are set, fall back to using English
9195
9193
  // format with string replacement for the separators.
9196
9194
  if (hasSeparators) {
9197
9195
  ret = ret
9198
- .replace(/\,/g, thousandsSep ?? ',')
9199
- .replace('.', decimalPoint ?? '.');
9196
+ // Preliminary step to avoid re-swapping (#22402)
9197
+ .replace(/([,\.])/g, '_$1')
9198
+ .replace(/_\,/g, thousandsSep ?? ',')
9199
+ .replace('_.', decimalPoint ?? '.');
9200
9200
  }
9201
9201
  if (
9202
9202
  // Remove signed zero (#20564)
@@ -9691,7 +9691,7 @@ class SVGElement {
9691
9691
  * @return {Highcharts.SVGElement} Returns the SVGElement for chaining.
9692
9692
  */
9693
9693
  align(alignOptions, alignByTranslate, alignTo, redraw = true) {
9694
- const attribs = {}, renderer = this.renderer, alignedObjects = renderer.alignedObjects, initialAlignment = Boolean(alignOptions);
9694
+ const renderer = this.renderer, alignedObjects = renderer.alignedObjects, initialAlignment = Boolean(alignOptions);
9695
9695
  // First call on instanciate
9696
9696
  if (alignOptions) {
9697
9697
  this.alignOptions = alignOptions;
@@ -9723,7 +9723,9 @@ class SVGElement {
9723
9723
  // Default: top align
9724
9724
  y = (alignToBox.y || 0) + (alignOptions.y || 0) +
9725
9725
  ((alignToBox.height || 0) - (alignOptions.height || 0)) *
9726
- SVGElement_getAlignFactor(alignOptions.verticalAlign);
9726
+ SVGElement_getAlignFactor(alignOptions.verticalAlign), attribs = {
9727
+ 'text-align': alignOptions?.align
9728
+ };
9727
9729
  attribs[alignByTranslate ? 'translateX' : 'x'] = Math.round(x);
9728
9730
  attribs[alignByTranslate ? 'translateY' : 'y'] = Math.round(y);
9729
9731
  // Animate only if already placed
@@ -11431,6 +11433,7 @@ class SVGLabel extends SVG_SVGElement {
11431
11433
  * */
11432
11434
  alignSetter(value) {
11433
11435
  const alignFactor = SVGLabel_getAlignFactor(value);
11436
+ this.textAlign = value;
11434
11437
  if (alignFactor !== this.alignFactor) {
11435
11438
  this.alignFactor = alignFactor;
11436
11439
  // Bounding box exists, means we're dynamically changing
@@ -11605,7 +11608,10 @@ class SVGLabel extends SVG_SVGElement {
11605
11608
  this.boxAttr(key, value);
11606
11609
  }
11607
11610
  'text-alignSetter'(value) {
11608
- this.textAlign = value;
11611
+ // The text-align variety is for the pre-animation getter. The code
11612
+ // should be unified to either textAlign or text-align.
11613
+ this.textAlign = this['text-align'] = value;
11614
+ this.updateTextPadding();
11609
11615
  }
11610
11616
  textSetter(text) {
11611
11617
  if (typeof text !== 'undefined') {
@@ -11675,24 +11681,19 @@ class SVGLabel extends SVG_SVGElement {
11675
11681
  * is changed.
11676
11682
  */
11677
11683
  updateTextPadding() {
11678
- const text = this.text;
11684
+ const text = this.text, textAlign = text.styles.textAlign || this.textAlign;
11679
11685
  if (!text.textPath) {
11680
11686
  this.updateBoxSize();
11681
11687
  // Determine y based on the baseline
11682
11688
  const textY = this.baseline ? 0 : this.baselineOffset, textX = (this.paddingLeft ?? this.padding) +
11683
11689
  // Compensate for alignment
11684
- ((SVGLabel_defined(this.widthSetting) && this.bBox) ?
11685
- SVGLabel_getAlignFactor(this.textAlign) *
11686
- (this.widthSetting - this.bBox.width) :
11687
- 0);
11690
+ SVGLabel_getAlignFactor(textAlign) * (this.widthSetting ?? this.bBox.width);
11688
11691
  // Update if anything changed
11689
11692
  if (textX !== text.x || textY !== text.y) {
11690
- text.attr('x', textX);
11691
- // #8159 - prevent misplaced data labels in treemap
11692
- // (useHTML: true)
11693
- if (text.hasBoxWidthChanged) {
11694
- this.bBox = text.getBBox(true);
11695
- }
11693
+ text.attr({
11694
+ align: textAlign,
11695
+ x: textX
11696
+ });
11696
11697
  if (typeof textY !== 'undefined') {
11697
11698
  text.attr('y', textY);
11698
11699
  }
@@ -12637,7 +12638,7 @@ class SVGRenderer {
12637
12638
  this.url = this.getReferenceURL();
12638
12639
  // Add description
12639
12640
  const desc = this.createElement('desc').add();
12640
- desc.element.appendChild(SVGRenderer_doc.createTextNode('Created with Highcharts 12.0.2'));
12641
+ desc.element.appendChild(SVGRenderer_doc.createTextNode('Created with Highcharts 12.1.1'));
12641
12642
  this.defs = this.createElement('defs').add();
12642
12643
  this.allowHTML = allowHTML;
12643
12644
  this.forExport = forExport;
@@ -14604,7 +14605,7 @@ class HTMLElement extends SVG_SVGElement {
14604
14605
  textWidth,
14605
14606
  this.textAlign
14606
14607
  ].join(','), parentPadding = (this.parentGroup?.padding * -1) || 0;
14607
- let baseline, hasBoxWidthChanged = false;
14608
+ let baseline;
14608
14609
  // Update textWidth. Use the memoized textPxLength if possible, to
14609
14610
  // avoid the getTextPxLength function using elem.offsetWidth.
14610
14611
  // Calling offsetWidth affects rendering time as it forces layout
@@ -14627,10 +14628,8 @@ class HTMLElement extends SVG_SVGElement {
14627
14628
  whiteSpace: whiteSpace || 'normal' // #3331
14628
14629
  });
14629
14630
  this.oldTextWidth = textWidth;
14630
- hasBoxWidthChanged = true; // #8159
14631
14631
  }
14632
14632
  }
14633
- this.hasBoxWidthChanged = hasBoxWidthChanged; // #8159
14634
14633
  // Do the calculations and DOM access only if properties changed
14635
14634
  if (currentTextTransform !== this.cTT) {
14636
14635
  baseline = renderer.fontMetrics(element).b;
@@ -27480,7 +27479,9 @@ class Pointer {
27480
27479
  hoverChart !== chart) {
27481
27480
  const relatedTargetObj = { relatedTarget: chart.container };
27482
27481
  if (e && !e?.relatedTarget) {
27483
- e = { ...relatedTargetObj, ...e };
27482
+ // #17192, Non-enumerable properties of "e" are dropped with
27483
+ // spreading (...e). Using Object.assign ensures integrity.
27484
+ Object.assign({}, e, relatedTargetObj);
27484
27485
  }
27485
27486
  hoverChart.pointer?.onContainerMouseLeave(e || relatedTargetObj);
27486
27487
  }
@@ -33086,9 +33087,14 @@ class Series {
33086
33087
  * @private
33087
33088
  * @function Highcharts.Series#searchKDTree
33088
33089
  */
33089
- searchKDTree(point, compareX, e) {
33090
+ searchKDTree(point, compareX, e, suppliedPointEvaluator, suppliedBSideCheckEvaluator) {
33090
33091
  const series = this, [kdX, kdY] = this.kdAxisArray, kdComparer = compareX ? 'distX' : 'dist', kdDimensions = (series.options.findNearestPointBy || '')
33091
- .indexOf('y') > -1 ? 2 : 1, useRadius = !!series.isBubble;
33092
+ .indexOf('y') > -1 ? 2 : 1, useRadius = !!series.isBubble, pointEvaluator = suppliedPointEvaluator || ((p1, p2, comparisonProp) => [
33093
+ (p1[comparisonProp] || 0) < (p2[comparisonProp] || 0) ?
33094
+ p1 :
33095
+ p2,
33096
+ false
33097
+ ]), bSideCheckEvaluator = suppliedBSideCheckEvaluator || ((a, b) => a < b);
33092
33098
  /**
33093
33099
  * Set the one and two dimensional distance on the point object.
33094
33100
  * @private
@@ -33103,28 +33109,21 @@ class Series {
33103
33109
  */
33104
33110
  function doSearch(search, tree, depth, dimensions) {
33105
33111
  const point = tree.point, axis = series.kdAxisArray[depth % dimensions];
33106
- let nPoint1, nPoint2, ret = point;
33112
+ let ret = point, flip = false;
33107
33113
  setDistance(search, point);
33108
33114
  // Pick side based on distance to splitting point
33109
33115
  const tdist = (search[axis] || 0) - (point[axis] || 0) +
33110
33116
  (useRadius ? (point.marker?.radius || 0) : 0), sideA = tdist < 0 ? 'left' : 'right', sideB = tdist < 0 ? 'right' : 'left';
33111
33117
  // End of tree
33112
33118
  if (tree[sideA]) {
33113
- nPoint1 = doSearch(search, tree[sideA], depth + 1, dimensions);
33114
- ret = (nPoint1[kdComparer] <
33115
- ret[kdComparer] ?
33116
- nPoint1 :
33117
- point);
33119
+ [ret, flip] = pointEvaluator(point, doSearch(search, tree[sideA], depth + 1, dimensions), kdComparer);
33118
33120
  }
33119
33121
  if (tree[sideB]) {
33122
+ const sqrtTDist = Math.sqrt(tdist * tdist), retDist = ret[kdComparer];
33120
33123
  // Compare distance to current best to splitting point to decide
33121
- // whether to check side B or not
33122
- if (Math.sqrt(tdist * tdist) < ret[kdComparer]) {
33123
- nPoint2 = doSearch(search, tree[sideB], depth + 1, dimensions);
33124
- ret = (nPoint2[kdComparer] <
33125
- ret[kdComparer] ?
33126
- nPoint2 :
33127
- ret);
33124
+ // whether to check side B or no
33125
+ if (bSideCheckEvaluator(sqrtTDist, retDist, flip)) {
33126
+ ret = pointEvaluator(ret, doSearch(search, tree[sideB], depth + 1, dimensions), kdComparer)[0];
33128
33127
  }
33129
33128
  }
33130
33129
  return ret;
@@ -42633,6 +42632,7 @@ var DataLabel;
42633
42632
  dataLabel.alignAttr.y += DataLabel_getAlignFactor(options.verticalAlign) *
42634
42633
  (unrotatedbBox.height - bBox.height);
42635
42634
  dataLabel[dataLabel.placed ? 'animate' : 'attr']({
42635
+ 'text-align': dataLabel.alignAttr['text-align'] || 'center',
42636
42636
  x: dataLabel.alignAttr.x +
42637
42637
  (bBox.width - unrotatedbBox.width) / 2,
42638
42638
  y: dataLabel.alignAttr.y +
@@ -52335,8 +52335,11 @@ const rangeSelector = {
52335
52335
  * The alignment of the input box. Allowed properties are `left`,
52336
52336
  * `center`, `right`.
52337
52337
  *
52338
- * @sample {highstock} stock/rangeselector/input-button-position/
52339
- * Alignment
52338
+ * @sample {highstock} stock/rangeselector/input-button-opposite-alignment/
52339
+ * Opposite alignment
52340
+ *
52341
+ * @sample {highstock} stock/rangeselector/input-button-same-alignment/
52342
+ * Same alignment for buttons and input
52340
52343
  *
52341
52344
  * @type {Highcharts.AlignValue}
52342
52345
  * @since 6.0.0
@@ -52376,8 +52379,11 @@ const rangeSelector = {
52376
52379
  * The alignment of the input box. Allowed properties are `left`,
52377
52380
  * `center`, `right`.
52378
52381
  *
52379
- * @sample {highstock} stock/rangeselector/input-button-position/
52380
- * Alignment
52382
+ * @sample {highstock} stock/rangeselector/input-button-opposite-alignment/
52383
+ * Opposite alignment
52384
+ *
52385
+ * @sample {highstock} stock/rangeselector/input-button-same-alignment/
52386
+ * Same alignment for buttons and input
52381
52387
  *
52382
52388
  * @type {Highcharts.AlignValue}
52383
52389
  * @since 6.0.0
@@ -52741,6 +52747,7 @@ const { addEvent: RangeSelector_addEvent, createElement: RangeSelector_createEle
52741
52747
  * @function preferredInputType
52742
52748
  */
52743
52749
  function preferredInputType(format) {
52750
+ const hasTimeKey = (char) => new RegExp(`%[[a-zA-Z]*${char}`).test(format);
52744
52751
  const ms = RangeSelector_isString(format) ?
52745
52752
  format.indexOf('%L') !== -1 :
52746
52753
  // Implemented but not typed as of 2024
@@ -52750,11 +52757,10 @@ function preferredInputType(format) {
52750
52757
  }
52751
52758
  const date = RangeSelector_isString(format) ?
52752
52759
  ['a', 'A', 'd', 'e', 'w', 'b', 'B', 'm', 'o', 'y', 'Y']
52753
- .some((char) => format.indexOf('%' + char) !== -1) :
52760
+ .some(hasTimeKey) :
52754
52761
  format.dateStyle || format.day || format.month || format.year;
52755
52762
  const time = RangeSelector_isString(format) ?
52756
- ['H', 'k', 'I', 'l', 'M', 'S']
52757
- .some((char) => format.indexOf('%' + char) !== -1) :
52763
+ ['H', 'k', 'I', 'l', 'M', 'S'].some(hasTimeKey) :
52758
52764
  format.timeStyle || format.hour || format.minute || format.second;
52759
52765
  if (date && time) {
52760
52766
  return 'datetime-local';
@@ -52801,6 +52807,16 @@ class RangeSelector {
52801
52807
  this.isDirty = false;
52802
52808
  this.buttonOptions = RangeSelector.prototype.defaultButtons;
52803
52809
  this.initialButtonGroupWidth = 0;
52810
+ this.maxButtonWidth = () => {
52811
+ let buttonWidth = 0;
52812
+ this.buttons.forEach((button) => {
52813
+ const bBox = button.getBBox();
52814
+ if (bBox.width > buttonWidth) {
52815
+ buttonWidth = bBox.width;
52816
+ }
52817
+ });
52818
+ return buttonWidth;
52819
+ };
52804
52820
  this.init(chart);
52805
52821
  }
52806
52822
  /* *
@@ -53094,9 +53110,15 @@ class RangeSelector {
53094
53110
  if (selectedIndex !== null) {
53095
53111
  buttonStates[selectedIndex] = 2;
53096
53112
  rangeSelector.setSelected(selectedIndex);
53113
+ if (this.dropdown) {
53114
+ this.dropdown.selectedIndex = selectedIndex + 1;
53115
+ }
53097
53116
  }
53098
53117
  else {
53099
53118
  rangeSelector.setSelected();
53119
+ if (this.dropdown) {
53120
+ this.dropdown.selectedIndex = -1;
53121
+ }
53100
53122
  if (dropdownLabel) {
53101
53123
  dropdownLabel.setState(0);
53102
53124
  dropdownLabel.attr({
@@ -53715,11 +53737,11 @@ class RangeSelector {
53715
53737
  const { buttonPosition, inputPosition, verticalAlign } = options;
53716
53738
  // Get the X offset required to avoid overlapping with the exporting
53717
53739
  // button. This is used both by the buttonGroup and the inputGroup.
53718
- const getXOffsetForExportButton = (group, position) => {
53740
+ const getXOffsetForExportButton = (group, position, rightAligned) => {
53719
53741
  if (navButtonOptions &&
53720
53742
  this.titleCollision(chart) &&
53721
53743
  verticalAlign === 'top' &&
53722
- position.align === 'right' && ((position.y -
53744
+ rightAligned && ((position.y -
53723
53745
  group.getBBox().height - 12) <
53724
53746
  ((navButtonOptions.y || 0) +
53725
53747
  (navButtonOptions.height || 0) +
@@ -53748,7 +53770,8 @@ class RangeSelector {
53748
53770
  }
53749
53771
  plotLeft -= chart.spacing[3];
53750
53772
  // Detect collision between button group and exporting
53751
- const xOffsetForExportButton = getXOffsetForExportButton(buttonGroup, buttonPosition);
53773
+ const xOffsetForExportButton = getXOffsetForExportButton(buttonGroup, buttonPosition, buttonPosition.align === 'right' ||
53774
+ inputPosition.align === 'right');
53752
53775
  this.alignButtonGroup(xOffsetForExportButton);
53753
53776
  if (this.buttonGroup?.translateY) {
53754
53777
  this.dropdownLabel
@@ -53760,7 +53783,8 @@ class RangeSelector {
53760
53783
  let xOffsetForExportButton = 0;
53761
53784
  if (options.inputEnabled && inputGroup) {
53762
53785
  // Detect collision between the input group and exporting button
53763
- xOffsetForExportButton = getXOffsetForExportButton(inputGroup, inputPosition);
53786
+ xOffsetForExportButton = getXOffsetForExportButton(inputGroup, inputPosition, buttonPosition.align === 'right' ||
53787
+ inputPosition.align === 'right');
53764
53788
  if (inputPosition.align === 'left') {
53765
53789
  translateX = plotLeft;
53766
53790
  }
@@ -53913,16 +53937,35 @@ class RangeSelector {
53913
53937
  * @param {number} [width]
53914
53938
  */
53915
53939
  alignButtonGroup(xOffsetForExportButton, width) {
53916
- const { chart, options, buttonGroup } = this;
53940
+ const { chart, options, buttonGroup, dropdown, dropdownLabel } = this;
53917
53941
  const { buttonPosition } = options;
53918
53942
  const plotLeft = chart.plotLeft - chart.spacing[3];
53919
53943
  let translateX = buttonPosition.x - chart.spacing[3];
53944
+ let dropdownTranslateX = chart.plotLeft;
53920
53945
  if (buttonPosition.align === 'right') {
53921
53946
  translateX += xOffsetForExportButton - plotLeft; // #13014
53947
+ if (this.hasVisibleDropdown) {
53948
+ dropdownTranslateX = chart.chartWidth +
53949
+ xOffsetForExportButton -
53950
+ this.maxButtonWidth() - 20;
53951
+ }
53922
53952
  }
53923
53953
  else if (buttonPosition.align === 'center') {
53924
53954
  translateX -= plotLeft / 2;
53955
+ if (this.hasVisibleDropdown) {
53956
+ dropdownTranslateX = chart.chartWidth / 2 -
53957
+ this.maxButtonWidth();
53958
+ }
53925
53959
  }
53960
+ if (dropdown) {
53961
+ RangeSelector_css(dropdown, {
53962
+ left: dropdownTranslateX + 'px',
53963
+ top: buttonGroup?.translateY + 'px'
53964
+ });
53965
+ }
53966
+ dropdownLabel?.attr({
53967
+ x: dropdownTranslateX
53968
+ });
53926
53969
  if (buttonGroup) {
53927
53970
  // Align button group
53928
53971
  buttonGroup.align({
@@ -53974,38 +54017,8 @@ class RangeSelector {
53974
54017
  * exporting button
53975
54018
  */
53976
54019
  handleCollision(xOffsetForExportButton) {
53977
- const { chart, buttonGroup, inputGroup } = this;
54020
+ const { chart, buttonGroup, inputGroup, initialButtonGroupWidth } = this;
53978
54021
  const { buttonPosition, dropdown, inputPosition } = this.options;
53979
- const maxButtonWidth = () => {
53980
- let buttonWidth = 0;
53981
- this.buttons.forEach((button) => {
53982
- const bBox = button.getBBox();
53983
- if (bBox.width > buttonWidth) {
53984
- buttonWidth = bBox.width;
53985
- }
53986
- });
53987
- return buttonWidth;
53988
- };
53989
- const groupsOverlap = (buttonGroupWidth) => {
53990
- if (inputGroup?.alignOptions && buttonGroup) {
53991
- const inputGroupX = (inputGroup.alignAttr.translateX +
53992
- inputGroup.alignOptions.x -
53993
- xOffsetForExportButton +
53994
- // `getBBox` for detecing left margin
53995
- inputGroup.getBBox().x +
53996
- // 2px padding to not overlap input and label
53997
- 2);
53998
- const inputGroupWidth = inputGroup.alignOptions.width || 0;
53999
- const buttonGroupX = buttonGroup.alignAttr.translateX +
54000
- buttonGroup.getBBox().x;
54001
- return (buttonGroupX + buttonGroupWidth > inputGroupX) &&
54002
- (inputGroupX + inputGroupWidth > buttonGroupX) &&
54003
- (buttonPosition.y <
54004
- (inputPosition.y +
54005
- inputGroup.getBBox().height));
54006
- }
54007
- return false;
54008
- };
54009
54022
  const moveInputsDown = () => {
54010
54023
  if (inputGroup && buttonGroup) {
54011
54024
  inputGroup.attr({
@@ -54017,47 +54030,51 @@ class RangeSelector {
54017
54030
  });
54018
54031
  }
54019
54032
  };
54020
- if (buttonGroup) {
54021
- if (dropdown === 'always') {
54022
- this.collapseButtons();
54023
- if (groupsOverlap(maxButtonWidth())) {
54024
- // Move the inputs down if there is still a collision
54025
- // after collapsing the buttons
54026
- moveInputsDown();
54027
- }
54028
- return;
54029
- }
54030
- if (dropdown === 'never') {
54031
- this.expandButtons();
54032
- }
54033
- }
54034
54033
  // Detect collision
54035
54034
  if (inputGroup && buttonGroup) {
54036
- if ((inputPosition.align === buttonPosition.align) ||
54037
- // 20 is minimal spacing between elements
54038
- groupsOverlap(this.initialButtonGroupWidth + 20)) {
54035
+ if (inputPosition.align === buttonPosition.align) {
54036
+ moveInputsDown();
54037
+ if (initialButtonGroupWidth >
54038
+ chart.plotWidth + xOffsetForExportButton - 20) {
54039
+ this.collapseButtons();
54040
+ }
54041
+ else {
54042
+ this.expandButtons();
54043
+ }
54044
+ }
54045
+ else if (initialButtonGroupWidth -
54046
+ xOffsetForExportButton +
54047
+ inputGroup.getBBox().width >
54048
+ chart.plotWidth) {
54039
54049
  if (dropdown === 'responsive') {
54040
54050
  this.collapseButtons();
54041
- if (groupsOverlap(maxButtonWidth())) {
54042
- moveInputsDown();
54043
- }
54044
54051
  }
54045
54052
  else {
54046
54053
  moveInputsDown();
54047
54054
  }
54048
54055
  }
54049
- else if (dropdown === 'responsive') {
54056
+ else {
54050
54057
  this.expandButtons();
54051
54058
  }
54052
54059
  }
54053
54060
  else if (buttonGroup && dropdown === 'responsive') {
54054
- if (this.initialButtonGroupWidth > chart.plotWidth) {
54061
+ if (initialButtonGroupWidth > chart.plotWidth) {
54055
54062
  this.collapseButtons();
54056
54063
  }
54057
54064
  else {
54058
54065
  this.expandButtons();
54059
54066
  }
54060
54067
  }
54068
+ // Forced states
54069
+ if (buttonGroup) {
54070
+ if (dropdown === 'always') {
54071
+ this.collapseButtons();
54072
+ }
54073
+ if (dropdown === 'never') {
54074
+ this.expandButtons();
54075
+ }
54076
+ }
54077
+ this.alignButtonGroup(xOffsetForExportButton);
54061
54078
  }
54062
54079
  /**
54063
54080
  * Collapse the buttons and show the select element.
@@ -54100,17 +54117,10 @@ class RangeSelector {
54100
54117
  * @function Highcharts.RangeSelector#showDropdown
54101
54118
  */
54102
54119
  showDropdown() {
54103
- const { buttonGroup, chart, dropdownLabel, dropdown } = this;
54120
+ const { buttonGroup, dropdownLabel, dropdown } = this;
54104
54121
  if (buttonGroup && dropdown) {
54105
- const { translateX = 0, translateY = 0 } = buttonGroup, left = chart.plotLeft + translateX, top = translateY;
54106
- dropdownLabel
54107
- .attr({ x: left, y: top })
54108
- .show();
54109
- RangeSelector_css(dropdown, {
54110
- left: left + 'px',
54111
- top: top + 'px',
54112
- visibility: 'inherit'
54113
- });
54122
+ dropdownLabel.show();
54123
+ RangeSelector_css(dropdown, { visibility: 'inherit' });
54114
54124
  this.hasVisibleDropdown = true;
54115
54125
  }
54116
54126
  }
@@ -57645,7 +57655,7 @@ var BrokenAxis;
57645
57655
 
57646
57656
  ;// ./code/es-modules/masters/modules/broken-axis.src.js
57647
57657
  /**
57648
- * @license Highcharts JS v12.0.2 (2024-12-04)
57658
+ * @license Highcharts JS v12.1.1 (2024-12-20)
57649
57659
  * @module highcharts/modules/broken-axis
57650
57660
  * @requires highcharts
57651
57661
  *
@@ -59137,7 +59147,7 @@ const DataGroupingComposition = {
59137
59147
 
59138
59148
  ;// ./code/es-modules/masters/modules/datagrouping.src.js
59139
59149
  /**
59140
- * @license Highstock JS v12.0.2 (2024-12-04)
59150
+ * @license Highstock JS v12.1.1 (2024-12-20)
59141
59151
  * @module highcharts/modules/datagrouping
59142
59152
  * @requires highcharts
59143
59153
  *
@@ -59459,7 +59469,7 @@ const MouseWheelZoomComposition = {
59459
59469
 
59460
59470
  ;// ./code/es-modules/masters/modules/mouse-wheel-zoom.src.js
59461
59471
  /**
59462
- * @license Highcharts JS v12.0.2 (2024-12-04)
59472
+ * @license Highcharts JS v12.1.1 (2024-12-20)
59463
59473
  * @module highcharts/modules/mouse-wheel-zoom
59464
59474
  * @requires highcharts
59465
59475
  *
@@ -59479,7 +59489,7 @@ mouse_wheel_zoom_src_G.MouseWheelZoom.compose(mouse_wheel_zoom_src_G.Chart);
59479
59489
 
59480
59490
  ;// ./code/es-modules/masters/modules/stock.src.js
59481
59491
  /**
59482
- * @license Highstock JS v12.0.2 (2024-12-04)
59492
+ * @license Highstock JS v12.1.1 (2024-12-20)
59483
59493
  * @module highcharts/modules/stock
59484
59494
  * @requires highcharts
59485
59495
  *
@@ -59527,7 +59537,7 @@ stock_src_G.StockChart.compose(stock_src_G.Chart, stock_src_G.Axis, stock_src_G.
59527
59537
 
59528
59538
  ;// ./code/es-modules/masters/highstock.src.js
59529
59539
  /**
59530
- * @license Highstock JS v12.0.2 (2024-12-04)
59540
+ * @license Highstock JS v12.1.1 (2024-12-20)
59531
59541
  * @module highcharts/highstock
59532
59542
  *
59533
59543
  * (c) 2009-2024 Torstein Honsi