highcharts 9.2.2 → 9.3.3

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 (894) hide show
  1. package/README.md +13 -6
  2. package/bower.json +1 -1
  3. package/css/annotations/popup.css +48 -8
  4. package/css/annotations/popup.scss +70 -22
  5. package/css/highcharts.css +46 -1
  6. package/css/highcharts.scss +40 -0
  7. package/css/stocktools/gui.css +1 -1
  8. package/css/themes/dark-unica.css +46 -1
  9. package/css/themes/grid-light.css +46 -1
  10. package/css/themes/sand-signika.css +46 -1
  11. package/es-modules/Accessibility/A11yI18n.js +269 -224
  12. package/es-modules/Accessibility/Accessibility.js +244 -129
  13. package/es-modules/Accessibility/AccessibilityComponent.js +78 -313
  14. package/es-modules/Accessibility/Components/AnnotationsA11y.js +19 -5
  15. package/es-modules/Accessibility/Components/ContainerComponent.js +53 -28
  16. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +178 -120
  17. package/es-modules/Accessibility/Components/LegendComponent.js +251 -129
  18. package/es-modules/Accessibility/Components/MenuComponent.js +250 -154
  19. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +172 -93
  20. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +161 -115
  21. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +138 -69
  22. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +67 -28
  23. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +48 -56
  24. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +387 -343
  25. package/es-modules/Accessibility/Components/ZoomComponent.js +156 -70
  26. package/es-modules/Accessibility/FocusBorder.js +192 -152
  27. package/es-modules/Accessibility/HighContrastMode.js +79 -66
  28. package/es-modules/Accessibility/HighContrastTheme.js +10 -0
  29. package/es-modules/Accessibility/KeyboardNavigation.js +151 -75
  30. package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
  31. package/es-modules/Accessibility/Options/DeprecatedOptions.js +21 -4
  32. package/es-modules/Accessibility/Options/LangOptions.js +4 -5
  33. package/es-modules/Accessibility/Options/Options.js +32 -17
  34. package/es-modules/Accessibility/ProxyElement.js +218 -0
  35. package/es-modules/Accessibility/ProxyProvider.js +302 -0
  36. package/es-modules/Accessibility/Utils/Announcer.js +17 -10
  37. package/es-modules/Accessibility/Utils/ChartUtilities.js +55 -45
  38. package/es-modules/Accessibility/Utils/DOMElementProvider.js +27 -15
  39. package/es-modules/Accessibility/Utils/EventProvider.js +27 -17
  40. package/es-modules/Accessibility/Utils/HTMLUtilities.js +125 -42
  41. package/es-modules/Core/Animation/Fx.js +5 -14
  42. package/es-modules/Core/Axis/Axis.js +77 -96
  43. package/es-modules/Core/Axis/Axis3D.js +10 -4
  44. package/es-modules/Core/Axis/AxisDefaults.js +35 -24
  45. package/es-modules/Core/Axis/BrokenAxis.js +17 -11
  46. package/es-modules/Core/Axis/Color/ColorAxis.js +7 -4
  47. package/es-modules/Core/Axis/Color/ColorAxisComposition.js +55 -5
  48. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
  49. package/es-modules/Core/Axis/DateTimeAxis.js +3 -14
  50. package/es-modules/Core/Axis/GridAxis.js +26 -16
  51. package/es-modules/Core/Axis/NavigatorAxis.js +0 -5
  52. package/es-modules/Core/Axis/OrdinalAxis.js +88 -92
  53. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
  54. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +0 -5
  55. package/es-modules/Core/Axis/RadialAxis.js +7 -28
  56. package/es-modules/Core/Axis/ScrollbarAxis.js +27 -12
  57. package/es-modules/Core/Axis/StackingAxis.js +2 -1
  58. package/es-modules/Core/Axis/Tick.js +2 -4
  59. package/es-modules/Core/Axis/TreeGridAxis.js +28 -19
  60. package/es-modules/Core/Axis/TreeGridTick.js +5 -3
  61. package/es-modules/Core/Axis/WaterfallAxis.js +1 -1
  62. package/es-modules/Core/Axis/ZAxis.js +1 -1
  63. package/es-modules/Core/Chart/Chart.js +44 -47
  64. package/es-modules/Core/Chart/Chart3D.js +23 -10
  65. package/es-modules/Core/Chart/ChartDefaults.js +3 -4
  66. package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
  67. package/es-modules/Core/Chart/GanttChart.js +4 -4
  68. package/es-modules/Core/Chart/MapChart.js +13 -25
  69. package/es-modules/Core/Chart/StockChart.js +13 -316
  70. package/es-modules/Core/Color/Palettes.js +22 -0
  71. package/es-modules/Core/DefaultOptions.js +22 -19
  72. package/es-modules/Core/Foundation.js +39 -31
  73. package/es-modules/Core/Geometry/CircleUtilities.js +2 -1
  74. package/es-modules/Core/Globals.js +1 -1
  75. package/es-modules/Core/HttpUtilities.js +8 -7
  76. package/es-modules/Core/Legend/Legend.js +19 -16
  77. package/es-modules/Core/Navigator.js +41 -30
  78. package/es-modules/Core/Pointer.js +52 -45
  79. package/es-modules/Core/Renderer/HTML/AST.js +29 -14
  80. package/es-modules/Core/Renderer/HTML/HTMLElement.js +27 -20
  81. package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +8 -6
  82. package/es-modules/Core/Renderer/RendererUtilities.js +2 -2
  83. package/es-modules/Core/Renderer/SVG/SVGElement.js +11 -20
  84. package/es-modules/Core/Renderer/SVG/SVGLabel.js +17 -8
  85. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +25 -29
  86. package/es-modules/Core/Renderer/SVG/SVGRenderer3D.js +12 -5
  87. package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -12
  88. package/es-modules/Core/Responsive.js +2 -3
  89. package/es-modules/Core/Scrollbar.js +14 -12
  90. package/es-modules/Core/ScrollbarDefaults.js +10 -9
  91. package/es-modules/Core/Series/DataLabel.js +19 -15
  92. package/es-modules/Core/Series/Point.js +22 -19
  93. package/es-modules/Core/Series/Series.js +197 -235
  94. package/es-modules/Core/Series/SeriesDefaults.js +8 -8
  95. package/es-modules/Core/Series/SeriesRegistry.js +1 -2
  96. package/es-modules/Core/Time.js +14 -11
  97. package/es-modules/Core/Tooltip.js +63 -53
  98. package/es-modules/Core/Utilities.js +20 -24
  99. package/es-modules/Data/DataConverter.js +483 -0
  100. package/es-modules/Data/DataPromise.js +252 -0
  101. package/es-modules/Data/DataSeriesConverter.js +207 -0
  102. package/es-modules/Data/DataTable.js +1205 -0
  103. package/es-modules/Data/Modifiers/ChainModifier.js +299 -0
  104. package/es-modules/Data/Modifiers/DataModifier.js +303 -0
  105. package/es-modules/Data/Modifiers/GroupModifier.js +144 -0
  106. package/es-modules/Data/Modifiers/InvertModifier.js +254 -0
  107. package/es-modules/Data/Modifiers/RangeModifier.js +143 -0
  108. package/es-modules/Data/Modifiers/SeriesPointsModifier.js +110 -0
  109. package/es-modules/Data/Modifiers/SortModifier.js +249 -0
  110. package/es-modules/Data/Parsers/CSVParser.js +400 -0
  111. package/es-modules/Data/Parsers/DataParser.js +101 -0
  112. package/es-modules/Data/Parsers/GoogleSheetsParser.js +223 -0
  113. package/es-modules/Data/Parsers/HTMLTableParser.js +213 -0
  114. package/es-modules/Data/Stores/CSVStore.js +317 -0
  115. package/es-modules/Data/Stores/DataStore.js +276 -0
  116. package/es-modules/Data/Stores/GoogleSheetsStore.js +169 -0
  117. package/es-modules/Data/Stores/HTMLTableStore.js +353 -0
  118. package/es-modules/Extensions/Annotations/Annotations.js +69 -18
  119. package/es-modules/Extensions/Annotations/ControlPoint.js +1 -3
  120. package/es-modules/Extensions/Annotations/Controllables/ControllableCircle.js +1 -1
  121. package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
  122. package/es-modules/Extensions/Annotations/Controllables/ControllableImage.js +1 -1
  123. package/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +3 -6
  124. package/es-modules/Extensions/Annotations/Controllables/ControllablePath.js +3 -2
  125. package/es-modules/Extensions/Annotations/Controllables/ControllableRect.js +1 -1
  126. package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +13 -4
  127. package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +0 -1
  128. package/es-modules/Extensions/Annotations/Mixins/MarkerMixin.js +5 -4
  129. package/es-modules/Extensions/Annotations/NavigationBindings.js +120 -53
  130. package/es-modules/Extensions/Annotations/Popup.js +494 -148
  131. package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
  132. package/es-modules/Extensions/Annotations/Types/CrookedLine.js +5 -3
  133. package/es-modules/Extensions/Annotations/Types/ElliottWave.js +1 -1
  134. package/es-modules/Extensions/Annotations/Types/Fibonacci.js +2 -3
  135. package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +219 -0
  136. package/es-modules/Extensions/Annotations/Types/InfinityLine.js +1 -1
  137. package/es-modules/Extensions/Annotations/Types/Measure.js +29 -19
  138. package/es-modules/Extensions/Annotations/Types/Pitchfork.js +7 -6
  139. package/es-modules/Extensions/Annotations/Types/TimeCycles.js +211 -0
  140. package/es-modules/Extensions/Annotations/Types/Tunnel.js +13 -10
  141. package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
  142. package/es-modules/Extensions/Boost/BoostOptions.js +2 -2
  143. package/es-modules/Extensions/Boost/BoostOverrides.js +6 -10
  144. package/es-modules/Extensions/Boost/BoostUtils.js +0 -6
  145. package/es-modules/Extensions/Boost/WGLRenderer.js +16 -12
  146. package/es-modules/Extensions/Boost/WGLShader.js +13 -11
  147. package/es-modules/Extensions/Boost/WGLVBuffer.js +4 -7
  148. package/es-modules/Extensions/BoostCanvas.js +1 -2
  149. package/es-modules/Extensions/CurrentDateIndication.js +2 -3
  150. package/es-modules/Extensions/Data.js +4 -48
  151. package/es-modules/Extensions/DataGrouping.js +52 -32
  152. package/es-modules/Extensions/DownloadURL.js +2 -2
  153. package/es-modules/Extensions/DragPanes.js +1 -2
  154. package/es-modules/Extensions/DraggablePoints.js +7 -8
  155. package/es-modules/Extensions/Drilldown.js +11 -7
  156. package/es-modules/Extensions/ExportData.js +6 -5
  157. package/es-modules/Extensions/Exporting/Exporting.js +33 -46
  158. package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
  159. package/es-modules/Extensions/FullScreen.js +4 -3
  160. package/es-modules/Extensions/GeoJSON.js +42 -66
  161. package/es-modules/Extensions/MarkerClusters.js +118 -98
  162. package/es-modules/Extensions/Math3D.js +4 -4
  163. package/es-modules/Extensions/NoDataToDisplay.js +1 -2
  164. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +32 -32
  165. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  166. package/es-modules/Extensions/Oldie/Oldie.js +14 -79
  167. package/es-modules/Extensions/Oldie/VMLAxis3D.js +5 -1
  168. package/es-modules/Extensions/OverlappingDataLabels.js +10 -6
  169. package/es-modules/Extensions/Pane.js +11 -12
  170. package/es-modules/Extensions/ParallelCoordinates.js +5 -3
  171. package/es-modules/Extensions/PatternFill.js +17 -11
  172. package/es-modules/Extensions/Polar.js +7 -4
  173. package/es-modules/Extensions/PriceIndication.js +2 -1
  174. package/es-modules/Extensions/RangeSelector.js +22 -59
  175. package/es-modules/Extensions/ScrollablePlotArea.js +2 -2
  176. package/es-modules/Extensions/SeriesLabel.js +1 -1
  177. package/es-modules/Extensions/Sonification/ChartSonify.js +279 -663
  178. package/es-modules/Extensions/Sonification/Earcon.js +136 -102
  179. package/es-modules/Extensions/Sonification/Instrument.js +493 -426
  180. package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
  181. package/es-modules/Extensions/Sonification/Options.js +10 -0
  182. package/es-modules/Extensions/Sonification/PointSonify.js +207 -152
  183. package/es-modules/Extensions/Sonification/SeriesSonify.js +474 -0
  184. package/es-modules/Extensions/Sonification/SignalHandler.js +122 -0
  185. package/es-modules/Extensions/Sonification/Sonification.js +27 -53
  186. package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +70 -88
  187. package/es-modules/Extensions/Sonification/Timeline.js +250 -567
  188. package/es-modules/Extensions/Sonification/TimelineEvent.js +157 -0
  189. package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
  190. package/es-modules/Extensions/Stacking.js +5 -23
  191. package/es-modules/Extensions/Themes/BrandDark.js +293 -0
  192. package/es-modules/Extensions/Themes/BrandLight.js +259 -0
  193. package/es-modules/Extensions/Themes/DarkUnica.js +4 -2
  194. package/es-modules/Extensions/Themes/Grid.js +4 -2
  195. package/es-modules/Extensions/Themes/GridLight.js +4 -2
  196. package/es-modules/Gantt/Connection.js +2 -2
  197. package/es-modules/Gantt/Pathfinder.js +6 -5
  198. package/es-modules/Gantt/PathfinderAlgorithms.js +12 -12
  199. package/es-modules/Maps/MapNavigation.js +30 -68
  200. package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
  201. package/es-modules/Maps/MapPointer.js +8 -5
  202. package/es-modules/Maps/MapSymbols.js +23 -3
  203. package/es-modules/Maps/MapView.js +450 -0
  204. package/es-modules/Maps/MapViewOptionsDefault.js +97 -0
  205. package/es-modules/Maps/Projection.js +436 -0
  206. package/es-modules/Maps/ProjectionDefinition.js +9 -0
  207. package/es-modules/Maps/Projections/EqualEarth.js +42 -0
  208. package/es-modules/Maps/Projections/LambertConformalConic.js +52 -0
  209. package/es-modules/Maps/Projections/Miller.js +16 -0
  210. package/es-modules/Maps/Projections/Orthographic.js +26 -0
  211. package/es-modules/Maps/Projections/ProjectionRegistry.js +19 -0
  212. package/es-modules/Maps/Projections/WebMercator.js +24 -0
  213. package/es-modules/Series/Area/AreaSeries.js +13 -13
  214. package/es-modules/Series/Area3DSeries.js +4 -2
  215. package/es-modules/Series/AreaRange/AreaRangeSeries.js +28 -17
  216. package/es-modules/Series/Bellcurve/BellcurveSeries.js +4 -9
  217. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
  218. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
  219. package/es-modules/Series/Bubble/BubbleLegendItem.js +5 -15
  220. package/es-modules/Series/Bubble/BubblePoint.js +5 -0
  221. package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
  222. package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -19
  223. package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
  224. package/es-modules/{Mixins/ColorMapSeries.js → Series/ColorMapMixin.js} +10 -8
  225. package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
  226. package/es-modules/Series/Column/ColumnSeries.js +19 -18
  227. package/es-modules/Series/Column3D/Column3DComposition.js +1 -2
  228. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +11 -8
  229. package/es-modules/Series/ColumnRange/ColumnRangeSeries.js +2 -1
  230. package/es-modules/Series/Cylinder/CylinderComposition.js +36 -4
  231. package/es-modules/Series/DataModifyComposition.js +539 -0
  232. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
  233. package/es-modules/Series/DependencyWheel/DependencyWheelSeries.js +1 -1
  234. package/es-modules/Series/DerivedComposition.js +137 -0
  235. package/es-modules/Series/DrawPointComposition.js +111 -0
  236. package/es-modules/Series/Dumbbell/DumbbellPoint.js +0 -1
  237. package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -6
  238. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
  239. package/es-modules/Series/Flags/FlagsSeries.js +18 -25
  240. package/es-modules/Series/Flags/FlagsSymbols.js +2 -2
  241. package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
  242. package/es-modules/Series/Funnel3D/Funnel3DComposition.js +14 -8
  243. package/es-modules/Series/Funnel3D/Funnel3DSeries.js +2 -1
  244. package/es-modules/Series/Gantt/GanttPoint.js +1 -1
  245. package/es-modules/Series/Gantt/GanttSeries.js +3 -3
  246. package/es-modules/Series/Gauge/GaugePoint.js +1 -1
  247. package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
  248. package/es-modules/Series/HLC/HLCPoint.js +55 -0
  249. package/es-modules/Series/HLC/HLCSeries.js +378 -0
  250. package/es-modules/Series/Heatmap/HeatmapPoint.js +13 -14
  251. package/es-modules/Series/Heatmap/HeatmapSeries.js +24 -12
  252. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +10 -9
  253. package/es-modules/Series/Histogram/HistogramSeries.js +7 -11
  254. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +1 -4
  255. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +28 -30
  256. package/es-modules/Series/Item/ItemSeries.js +4 -5
  257. package/es-modules/Series/Line/LineSeries.js +1 -2
  258. package/es-modules/Series/Map/MapPoint.js +27 -14
  259. package/es-modules/Series/Map/MapSeries.js +283 -322
  260. package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
  261. package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
  262. package/es-modules/Series/MapLine/MapLineSeries.js +2 -4
  263. package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
  264. package/es-modules/Series/MapPoint/MapPointSeries.js +99 -14
  265. package/es-modules/Series/Networkgraph/DraggableNodes.js +0 -4
  266. package/es-modules/Series/Networkgraph/Integrations.js +8 -22
  267. package/es-modules/Series/Networkgraph/Networkgraph.js +6 -10
  268. package/es-modules/Series/Networkgraph/QuadTree.js +1 -3
  269. package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +78 -30
  270. package/es-modules/Series/OHLC/OHLCPoint.js +2 -7
  271. package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
  272. package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
  273. package/es-modules/Series/Organization/OrganizationSeries.js +6 -5
  274. package/es-modules/Series/PackedBubble/PackedBubbleComposition.js +1 -0
  275. package/es-modules/Series/PackedBubble/PackedBubblePoint.js +1 -1
  276. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +48 -10
  277. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
  278. package/es-modules/Series/Pie/PieDataLabel.js +1 -2
  279. package/es-modules/Series/Pie/PiePoint.js +2 -2
  280. package/es-modules/Series/Pie/PieSeries.js +7 -8
  281. package/es-modules/Series/Pie3D/Pie3DComposition.js +2 -1
  282. package/es-modules/Series/Pie3D/Pie3DPoint.js +2 -1
  283. package/es-modules/Series/Pie3D/Pie3DSeries.js +1 -1
  284. package/es-modules/Series/Pyramid3D/Pyramid3DSeries.js +2 -1
  285. package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
  286. package/es-modules/Series/Sankey/SankeySeries.js +92 -22
  287. package/es-modules/Series/SolidGauge/SolidGaugeComposition.js +3 -1
  288. package/es-modules/Series/Spline/SplineSeries.js +0 -8
  289. package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
  290. package/es-modules/Series/Sunburst/SunburstSeries.js +6 -6
  291. package/es-modules/Series/Sunburst/SunburstUtilities.js +3 -2
  292. package/es-modules/Series/Tilemap/TilemapPoint.js +2 -5
  293. package/es-modules/Series/Tilemap/TilemapShapes.js +0 -7
  294. package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
  295. package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +88 -78
  296. package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
  297. package/es-modules/Series/Treemap/TreemapSeries.js +22 -25
  298. package/es-modules/Series/Variwide/VariwideSeries.js +5 -1
  299. package/es-modules/Series/Venn/VennPoint.js +16 -7
  300. package/es-modules/Series/Venn/VennSeries.js +11 -17
  301. package/es-modules/Series/Venn/VennUtils.js +551 -439
  302. package/es-modules/Series/Waterfall/WaterfallSeries.js +8 -6
  303. package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
  304. package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
  305. package/es-modules/Series/Wordcloud/WordcloudSeries.js +26 -22
  306. package/es-modules/Series/Wordcloud/WordcloudUtils.js +669 -484
  307. package/es-modules/Series/XRange/XRangePoint.js +7 -12
  308. package/es-modules/Series/XRange/XRangeSeries.js +4 -20
  309. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +15 -6
  310. package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
  311. package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
  312. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +4 -6
  313. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
  314. package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
  315. package/es-modules/Stock/Indicators/BB/BBIndicator.js +39 -11
  316. package/es-modules/Stock/Indicators/CMF/CMFIndicator.js +35 -15
  317. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
  318. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
  319. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +28 -16
  320. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +18 -11
  321. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
  322. package/es-modules/Stock/Indicators/IKH/IKHIndicator.js +6 -6
  323. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +23 -9
  324. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +16 -19
  325. package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +32 -14
  326. package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
  327. package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
  328. package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
  329. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +2 -3
  330. package/es-modules/Stock/Indicators/MultipleLinesComposition.js +294 -0
  331. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
  332. package/es-modules/Stock/Indicators/PC/PCIndicator.js +25 -13
  333. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
  334. package/es-modules/Stock/Indicators/PivotPoints/PivotPointsIndicator.js +2 -1
  335. package/es-modules/Stock/Indicators/RSI/RSIIndicator.js +2 -1
  336. package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
  337. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +32 -50
  338. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
  339. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +18 -9
  340. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
  341. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
  342. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
  343. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +26 -10
  344. package/es-modules/Stock/Indicators/VWAP/VWAPIndicator.js +19 -7
  345. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
  346. package/es-modules/Stock/StockToolsBindings.js +156 -47
  347. package/es-modules/Stock/StockToolsGui.js +442 -37
  348. package/es-modules/masters/highcharts-3d.src.js +1 -1
  349. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  350. package/es-modules/masters/highcharts-more.src.js +1 -1
  351. package/es-modules/masters/highcharts.src.js +1 -1
  352. package/es-modules/masters/highmaps.src.js +1 -1
  353. package/es-modules/masters/highstock.src.js +1 -1
  354. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  355. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  356. package/es-modules/masters/indicators/ao.src.js +1 -1
  357. package/es-modules/masters/indicators/apo.src.js +1 -1
  358. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  359. package/es-modules/masters/indicators/aroon.src.js +1 -1
  360. package/es-modules/masters/indicators/atr.src.js +1 -1
  361. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  362. package/es-modules/masters/indicators/cci.src.js +1 -1
  363. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  364. package/es-modules/masters/indicators/cmf.src.js +1 -1
  365. package/es-modules/masters/indicators/cmo.src.js +1 -1
  366. package/es-modules/masters/indicators/dema.src.js +1 -1
  367. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  368. package/es-modules/masters/indicators/dmi.src.js +1 -1
  369. package/es-modules/masters/indicators/dpo.src.js +1 -1
  370. package/es-modules/masters/indicators/ema.src.js +4 -10
  371. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  372. package/es-modules/masters/indicators/indicators-all.src.js +2 -2
  373. package/es-modules/masters/indicators/indicators.src.js +2 -1
  374. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  375. package/es-modules/masters/indicators/klinger.src.js +1 -1
  376. package/es-modules/masters/indicators/macd.src.js +1 -1
  377. package/es-modules/masters/indicators/mfi.src.js +1 -1
  378. package/es-modules/masters/indicators/momentum.src.js +1 -1
  379. package/es-modules/masters/indicators/natr.src.js +1 -1
  380. package/es-modules/masters/indicators/obv.src.js +1 -1
  381. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  382. package/es-modules/masters/indicators/ppo.src.js +1 -1
  383. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  384. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  385. package/es-modules/masters/indicators/psar.src.js +1 -1
  386. package/es-modules/masters/indicators/regressions.src.js +1 -1
  387. package/es-modules/masters/indicators/roc.src.js +1 -1
  388. package/es-modules/masters/indicators/rsi.src.js +1 -1
  389. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  390. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  391. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  392. package/es-modules/masters/indicators/tema.src.js +1 -1
  393. package/es-modules/masters/indicators/trendline.src.js +1 -1
  394. package/es-modules/masters/indicators/trix.src.js +1 -1
  395. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  396. package/es-modules/masters/indicators/vwap.src.js +1 -1
  397. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  398. package/es-modules/masters/indicators/wma.src.js +1 -1
  399. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  400. package/es-modules/masters/modules/accessibility.src.js +16 -2
  401. package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
  402. package/es-modules/masters/modules/annotations.src.js +1 -1
  403. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  404. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  405. package/es-modules/masters/modules/boost.src.js +1 -1
  406. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  407. package/es-modules/masters/modules/bullet.src.js +1 -1
  408. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  409. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  410. package/es-modules/masters/modules/cylinder.src.js +1 -1
  411. package/es-modules/masters/modules/data.src.js +6 -3
  412. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  413. package/es-modules/masters/modules/debugger.src.js +1 -1
  414. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  415. package/es-modules/masters/modules/dotplot.src.js +1 -1
  416. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  417. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  418. package/es-modules/masters/modules/drilldown.src.js +1 -1
  419. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  420. package/es-modules/masters/modules/export-data.src.js +1 -1
  421. package/es-modules/masters/modules/exporting.src.js +1 -1
  422. package/es-modules/masters/modules/full-screen.src.js +1 -1
  423. package/es-modules/masters/modules/funnel.src.js +1 -1
  424. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  425. package/es-modules/masters/modules/gantt.src.js +1 -1
  426. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  427. package/es-modules/masters/modules/heatmap.src.js +1 -2
  428. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  429. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  430. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  431. package/es-modules/masters/modules/item-series.src.js +1 -1
  432. package/es-modules/masters/modules/lollipop.src.js +1 -1
  433. package/es-modules/masters/modules/map.src.js +1 -3
  434. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  435. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  436. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  437. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  438. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  439. package/es-modules/masters/modules/oldie.src.js +1 -1
  440. package/es-modules/masters/modules/organization.src.js +1 -1
  441. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  442. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  443. package/es-modules/masters/modules/pareto.src.js +1 -1
  444. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  445. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  446. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  447. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  448. package/es-modules/masters/modules/sankey.src.js +1 -1
  449. package/es-modules/masters/modules/series-label.src.js +1 -1
  450. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  451. package/es-modules/masters/modules/sonification.src.js +33 -2
  452. package/es-modules/masters/modules/static-scale.src.js +1 -1
  453. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  454. package/es-modules/masters/modules/stock.src.js +4 -1
  455. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  456. package/es-modules/masters/modules/sunburst.src.js +1 -1
  457. package/es-modules/masters/modules/tilemap.src.js +1 -1
  458. package/es-modules/masters/modules/timeline.src.js +1 -1
  459. package/es-modules/masters/modules/treegrid.src.js +1 -1
  460. package/es-modules/masters/modules/treemap.src.js +1 -1
  461. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  462. package/es-modules/masters/modules/variwide.src.js +1 -1
  463. package/es-modules/masters/modules/vector.src.js +1 -1
  464. package/es-modules/masters/modules/venn.src.js +1 -1
  465. package/es-modules/masters/modules/windbarb.src.js +1 -1
  466. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  467. package/es-modules/masters/modules/xrange.src.js +1 -1
  468. package/es-modules/masters/themes/avocado.src.js +1 -1
  469. package/es-modules/masters/themes/brand-dark.src.js +14 -0
  470. package/es-modules/masters/themes/brand-light.src.js +14 -0
  471. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  472. package/es-modules/masters/themes/dark-green.src.js +1 -1
  473. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  474. package/es-modules/masters/themes/gray.src.js +1 -1
  475. package/es-modules/masters/themes/grid-light.src.js +1 -1
  476. package/es-modules/masters/themes/grid.src.js +1 -1
  477. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  478. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  479. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  480. package/es-modules/masters/themes/skies.src.js +1 -1
  481. package/es-modules/masters/themes/sunset.src.js +1 -1
  482. package/highcharts-3d.js +1 -1
  483. package/highcharts-3d.js.map +1 -1
  484. package/highcharts-3d.src.js +65 -35
  485. package/highcharts-gantt.js +800 -803
  486. package/highcharts-gantt.js.map +1 -1
  487. package/highcharts-gantt.src.js +1356 -1429
  488. package/highcharts-more.js +194 -193
  489. package/highcharts-more.js.map +1 -1
  490. package/highcharts-more.src.js +280 -222
  491. package/highcharts.d.ts +10208 -761
  492. package/highcharts.js +585 -588
  493. package/highcharts.js.map +1 -1
  494. package/highcharts.src.d.ts +10208 -761
  495. package/highcharts.src.js +992 -1066
  496. package/highmaps.js +727 -707
  497. package/highmaps.js.map +1 -1
  498. package/highmaps.src.js +3240 -2135
  499. package/highstock.js +788 -783
  500. package/highstock.js.map +1 -1
  501. package/highstock.src.js +2487 -1981
  502. package/indicators/acceleration-bands.d.ts +17 -1
  503. package/indicators/acceleration-bands.js +11 -9
  504. package/indicators/acceleration-bands.js.map +1 -1
  505. package/indicators/acceleration-bands.src.d.ts +17 -1
  506. package/indicators/acceleration-bands.src.js +238 -112
  507. package/indicators/accumulation-distribution.js +1 -1
  508. package/indicators/accumulation-distribution.src.js +1 -1
  509. package/indicators/ao.js +6 -6
  510. package/indicators/ao.js.map +1 -1
  511. package/indicators/ao.src.js +4 -4
  512. package/indicators/apo.js +5 -6
  513. package/indicators/apo.js.map +1 -1
  514. package/indicators/apo.src.js +16 -84
  515. package/indicators/aroon-oscillator.d.ts +17 -1
  516. package/indicators/aroon-oscillator.js +10 -9
  517. package/indicators/aroon-oscillator.js.map +1 -1
  518. package/indicators/aroon-oscillator.src.d.ts +17 -1
  519. package/indicators/aroon-oscillator.src.js +230 -177
  520. package/indicators/aroon.d.ts +17 -1
  521. package/indicators/aroon.js +11 -9
  522. package/indicators/aroon.js.map +1 -1
  523. package/indicators/aroon.src.d.ts +17 -1
  524. package/indicators/aroon.src.js +227 -112
  525. package/indicators/atr.js +1 -1
  526. package/indicators/atr.src.js +1 -1
  527. package/indicators/bollinger-bands.d.ts +17 -1
  528. package/indicators/bollinger-bands.js +12 -9
  529. package/indicators/bollinger-bands.js.map +1 -1
  530. package/indicators/bollinger-bands.src.d.ts +17 -1
  531. package/indicators/bollinger-bands.src.js +262 -117
  532. package/indicators/cci.js +1 -1
  533. package/indicators/cci.src.js +1 -1
  534. package/indicators/chaikin.js +8 -9
  535. package/indicators/chaikin.js.map +1 -1
  536. package/indicators/chaikin.src.js +8 -76
  537. package/indicators/cmf.js +1 -1
  538. package/indicators/cmf.js.map +1 -1
  539. package/indicators/cmf.src.js +36 -16
  540. package/indicators/cmo.js +1 -1
  541. package/indicators/cmo.src.js +1 -1
  542. package/indicators/dema.js +5 -6
  543. package/indicators/dema.js.map +1 -1
  544. package/indicators/dema.src.js +3 -75
  545. package/indicators/disparity-index.js +6 -7
  546. package/indicators/disparity-index.js.map +1 -1
  547. package/indicators/disparity-index.src.js +20 -74
  548. package/indicators/dmi.js +12 -11
  549. package/indicators/dmi.js.map +1 -1
  550. package/indicators/dmi.src.js +252 -121
  551. package/indicators/dpo.js +1 -1
  552. package/indicators/dpo.src.js +1 -1
  553. package/indicators/ema.js +1 -13
  554. package/indicators/ema.js.map +1 -1
  555. package/indicators/ema.src.js +7 -188
  556. package/indicators/ichimoku-kinko-hyo.js +1 -1
  557. package/indicators/ichimoku-kinko-hyo.js.map +1 -1
  558. package/indicators/ichimoku-kinko-hyo.src.js +7 -7
  559. package/indicators/indicators-all.d.ts +17 -1
  560. package/indicators/indicators-all.js +198 -203
  561. package/indicators/indicators-all.js.map +1 -1
  562. package/indicators/indicators-all.src.d.ts +17 -1
  563. package/indicators/indicators-all.src.js +892 -777
  564. package/indicators/indicators.js +12 -12
  565. package/indicators/indicators.js.map +1 -1
  566. package/indicators/indicators.src.js +213 -144
  567. package/indicators/keltner-channels.d.ts +17 -1
  568. package/indicators/keltner-channels.js +11 -10
  569. package/indicators/keltner-channels.js.map +1 -1
  570. package/indicators/keltner-channels.src.d.ts +17 -1
  571. package/indicators/keltner-channels.src.js +246 -118
  572. package/indicators/klinger.js +14 -13
  573. package/indicators/klinger.js.map +1 -1
  574. package/indicators/klinger.src.js +239 -187
  575. package/indicators/macd.js +2 -2
  576. package/indicators/macd.js.map +1 -1
  577. package/indicators/macd.src.js +3 -4
  578. package/indicators/mfi.js +1 -1
  579. package/indicators/mfi.src.js +1 -1
  580. package/indicators/momentum.js +1 -1
  581. package/indicators/momentum.src.js +1 -1
  582. package/indicators/natr.js +3 -3
  583. package/indicators/natr.js.map +1 -1
  584. package/indicators/natr.src.js +2 -4
  585. package/indicators/obv.js +1 -1
  586. package/indicators/obv.src.js +1 -1
  587. package/indicators/pivot-points.js +1 -1
  588. package/indicators/pivot-points.js.map +1 -1
  589. package/indicators/pivot-points.src.js +3 -2
  590. package/indicators/ppo.js +5 -6
  591. package/indicators/ppo.js.map +1 -1
  592. package/indicators/ppo.src.js +3 -75
  593. package/indicators/price-channel.d.ts +17 -1
  594. package/indicators/price-channel.js +11 -9
  595. package/indicators/price-channel.js.map +1 -1
  596. package/indicators/price-channel.src.d.ts +17 -1
  597. package/indicators/price-channel.src.js +288 -168
  598. package/indicators/price-envelopes.js +1 -1
  599. package/indicators/price-envelopes.src.js +1 -1
  600. package/indicators/psar.js +1 -1
  601. package/indicators/psar.src.js +1 -1
  602. package/indicators/regressions.js +1 -1
  603. package/indicators/regressions.js.map +1 -1
  604. package/indicators/regressions.src.js +39 -21
  605. package/indicators/roc.js +1 -1
  606. package/indicators/roc.src.js +1 -1
  607. package/indicators/rsi.js +1 -1
  608. package/indicators/rsi.js.map +1 -1
  609. package/indicators/rsi.src.js +3 -2
  610. package/indicators/slow-stochastic.js +5 -6
  611. package/indicators/slow-stochastic.js.map +1 -1
  612. package/indicators/slow-stochastic.src.js +2 -72
  613. package/indicators/stochastic.d.ts +17 -1
  614. package/indicators/stochastic.js +12 -10
  615. package/indicators/stochastic.js.map +1 -1
  616. package/indicators/stochastic.src.d.ts +17 -1
  617. package/indicators/stochastic.src.js +282 -165
  618. package/indicators/supertrend.js +10 -10
  619. package/indicators/supertrend.js.map +1 -1
  620. package/indicators/supertrend.src.js +6 -7
  621. package/indicators/tema.js +6 -7
  622. package/indicators/tema.js.map +1 -1
  623. package/indicators/tema.src.js +28 -75
  624. package/indicators/trendline.js +1 -1
  625. package/indicators/trendline.src.js +1 -1
  626. package/indicators/trix.js +4 -5
  627. package/indicators/trix.js.map +1 -1
  628. package/indicators/trix.src.js +8 -76
  629. package/indicators/volume-by-price.js +16 -16
  630. package/indicators/volume-by-price.js.map +1 -1
  631. package/indicators/volume-by-price.src.js +27 -10
  632. package/indicators/vwap.js +1 -1
  633. package/indicators/vwap.js.map +1 -1
  634. package/indicators/vwap.src.js +20 -8
  635. package/indicators/williams-r.js +5 -6
  636. package/indicators/williams-r.js.map +1 -1
  637. package/indicators/williams-r.src.js +41 -51
  638. package/indicators/wma.js +1 -1
  639. package/indicators/wma.src.js +1 -1
  640. package/indicators/zigzag.js +1 -1
  641. package/indicators/zigzag.src.js +1 -1
  642. package/modules/accessibility.d.ts +0 -30
  643. package/modules/accessibility.js +241 -216
  644. package/modules/accessibility.js.map +1 -1
  645. package/modules/accessibility.src.d.ts +0 -30
  646. package/modules/accessibility.src.js +7818 -6398
  647. package/modules/annotations-advanced.d.ts +30 -0
  648. package/modules/annotations-advanced.js +192 -165
  649. package/modules/annotations-advanced.js.map +1 -1
  650. package/modules/annotations-advanced.src.d.ts +30 -0
  651. package/modules/annotations-advanced.src.js +1716 -416
  652. package/modules/annotations.js +125 -110
  653. package/modules/annotations.js.map +1 -1
  654. package/modules/annotations.src.js +1059 -304
  655. package/modules/arrow-symbols.js +1 -1
  656. package/modules/arrow-symbols.src.js +1 -1
  657. package/modules/boost-canvas.js +15 -15
  658. package/modules/boost-canvas.js.map +1 -1
  659. package/modules/boost-canvas.src.js +3 -3
  660. package/modules/boost.js +79 -79
  661. package/modules/boost.js.map +1 -1
  662. package/modules/boost.src.js +42 -51
  663. package/modules/broken-axis.js +1 -1
  664. package/modules/broken-axis.js.map +1 -1
  665. package/modules/broken-axis.src.js +18 -12
  666. package/modules/bullet.js +1 -1
  667. package/modules/bullet.src.js +1 -1
  668. package/modules/coloraxis.js +24 -24
  669. package/modules/coloraxis.js.map +1 -1
  670. package/modules/coloraxis.src.js +77 -103
  671. package/modules/current-date-indicator.js +4 -4
  672. package/modules/current-date-indicator.js.map +1 -1
  673. package/modules/current-date-indicator.src.js +4 -4
  674. package/modules/cylinder.js +1 -1
  675. package/modules/cylinder.js.map +1 -1
  676. package/modules/cylinder.src.js +37 -5
  677. package/modules/data.d.ts +6 -6
  678. package/modules/data.js +31 -31
  679. package/modules/data.js.map +1 -1
  680. package/modules/data.src.d.ts +6 -6
  681. package/modules/data.src.js +18 -58
  682. package/modules/datagrouping.js +20 -20
  683. package/modules/datagrouping.js.map +1 -1
  684. package/modules/datagrouping.src.js +54 -33
  685. package/modules/debugger.js +1 -1
  686. package/modules/debugger.src.js +1 -1
  687. package/modules/dependency-wheel.js +11 -11
  688. package/modules/dependency-wheel.js.map +1 -1
  689. package/modules/dependency-wheel.src.js +5 -8
  690. package/modules/dotplot.js +1 -1
  691. package/modules/dotplot.src.js +1 -1
  692. package/modules/drag-panes.js +8 -8
  693. package/modules/drag-panes.js.map +1 -1
  694. package/modules/drag-panes.src.js +3 -3
  695. package/modules/draggable-points.js +1 -1
  696. package/modules/draggable-points.js.map +1 -1
  697. package/modules/draggable-points.src.js +8 -9
  698. package/modules/drilldown.js +24 -24
  699. package/modules/drilldown.js.map +1 -1
  700. package/modules/drilldown.src.js +13 -8
  701. package/modules/dumbbell.js +17 -17
  702. package/modules/dumbbell.js.map +1 -1
  703. package/modules/dumbbell.src.js +4 -8
  704. package/modules/export-data.js +19 -19
  705. package/modules/export-data.js.map +1 -1
  706. package/modules/export-data.src.js +9 -8
  707. package/modules/exporting.js +39 -38
  708. package/modules/exporting.js.map +1 -1
  709. package/modules/exporting.src.js +132 -113
  710. package/modules/full-screen.js +1 -1
  711. package/modules/full-screen.js.map +1 -1
  712. package/modules/full-screen.src.js +5 -4
  713. package/modules/funnel.js +12 -12
  714. package/modules/funnel.js.map +1 -1
  715. package/modules/funnel.src.js +9 -6
  716. package/modules/funnel3d.js +1 -1
  717. package/modules/funnel3d.js.map +1 -1
  718. package/modules/funnel3d.src.js +17 -10
  719. package/modules/gantt.js +217 -218
  720. package/modules/gantt.js.map +1 -1
  721. package/modules/gantt.src.js +364 -363
  722. package/modules/grid-axis.js +1 -1
  723. package/modules/grid-axis.js.map +1 -1
  724. package/modules/grid-axis.src.js +27 -19
  725. package/modules/heatmap.js +39 -39
  726. package/modules/heatmap.js.map +1 -1
  727. package/modules/heatmap.src.js +132 -141
  728. package/modules/heikinashi.js +1 -1
  729. package/modules/heikinashi.js.map +1 -1
  730. package/modules/heikinashi.src.js +12 -10
  731. package/modules/histogram-bellcurve.js +13 -13
  732. package/modules/histogram-bellcurve.js.map +1 -1
  733. package/modules/histogram-bellcurve.src.js +97 -91
  734. package/modules/hollowcandlestick.js +9 -9
  735. package/modules/hollowcandlestick.js.map +1 -1
  736. package/modules/hollowcandlestick.src.js +31 -35
  737. package/modules/item-series.js +6 -6
  738. package/modules/item-series.js.map +1 -1
  739. package/modules/item-series.src.js +6 -6
  740. package/modules/lollipop.js +1 -1
  741. package/modules/lollipop.src.js +1 -1
  742. package/modules/map.d.ts +138 -14
  743. package/modules/map.js +144 -122
  744. package/modules/map.js.map +1 -1
  745. package/modules/map.src.d.ts +138 -14
  746. package/modules/map.src.js +2253 -1074
  747. package/modules/marker-clusters.js +36 -36
  748. package/modules/marker-clusters.js.map +1 -1
  749. package/modules/marker-clusters.src.js +176 -143
  750. package/modules/networkgraph.d.ts +12 -1
  751. package/modules/networkgraph.js +49 -49
  752. package/modules/networkgraph.js.map +1 -1
  753. package/modules/networkgraph.src.d.ts +12 -1
  754. package/modules/networkgraph.src.js +103 -78
  755. package/modules/no-data-to-display.js +5 -5
  756. package/modules/no-data-to-display.js.map +1 -1
  757. package/modules/no-data-to-display.src.js +3 -3
  758. package/modules/offline-exporting.js +18 -18
  759. package/modules/offline-exporting.js.map +1 -1
  760. package/modules/offline-exporting.src.js +38 -43
  761. package/modules/oldie-polyfills.js +1 -1
  762. package/modules/oldie-polyfills.src.js +1 -1
  763. package/modules/oldie.js +26 -26
  764. package/modules/oldie.js.map +1 -1
  765. package/modules/oldie.src.js +21 -81
  766. package/modules/organization.js +13 -13
  767. package/modules/organization.js.map +1 -1
  768. package/modules/organization.src.js +8 -6
  769. package/modules/overlapping-datalabels.js +1 -1
  770. package/modules/overlapping-datalabels.src.js +1 -1
  771. package/modules/parallel-coordinates.js +1 -1
  772. package/modules/parallel-coordinates.js.map +1 -1
  773. package/modules/parallel-coordinates.src.js +6 -4
  774. package/modules/pareto.js +7 -7
  775. package/modules/pareto.js.map +1 -1
  776. package/modules/pareto.src.js +89 -78
  777. package/modules/pathfinder.js +1 -1
  778. package/modules/pathfinder.js.map +1 -1
  779. package/modules/pathfinder.src.js +21 -20
  780. package/modules/pattern-fill.js +1 -1
  781. package/modules/pattern-fill.js.map +1 -1
  782. package/modules/pattern-fill.src.js +18 -12
  783. package/modules/price-indicator.js +1 -1
  784. package/modules/price-indicator.js.map +1 -1
  785. package/modules/price-indicator.src.js +3 -2
  786. package/modules/pyramid3d.js +1 -1
  787. package/modules/pyramid3d.js.map +1 -1
  788. package/modules/pyramid3d.src.js +3 -2
  789. package/modules/sankey.d.ts +12 -1
  790. package/modules/sankey.js +29 -29
  791. package/modules/sankey.js.map +1 -1
  792. package/modules/sankey.src.d.ts +12 -1
  793. package/modules/sankey.src.js +307 -181
  794. package/modules/series-label.js +1 -1
  795. package/modules/series-label.js.map +1 -1
  796. package/modules/series-label.src.js +2 -2
  797. package/modules/solid-gauge.js +1 -1
  798. package/modules/solid-gauge.js.map +1 -1
  799. package/modules/solid-gauge.src.js +17 -2
  800. package/modules/sonification.js +59 -55
  801. package/modules/sonification.js.map +1 -1
  802. package/modules/sonification.src.js +3093 -2594
  803. package/modules/static-scale.js +1 -1
  804. package/modules/static-scale.src.js +1 -1
  805. package/modules/stock-tools.js +178 -163
  806. package/modules/stock-tools.js.map +1 -1
  807. package/modules/stock-tools.src.js +1136 -229
  808. package/modules/stock.d.ts +39 -6
  809. package/modules/stock.js +204 -196
  810. package/modules/stock.js.map +1 -1
  811. package/modules/stock.src.d.ts +39 -6
  812. package/modules/stock.src.js +1820 -1240
  813. package/modules/streamgraph.js +1 -1
  814. package/modules/streamgraph.src.js +1 -1
  815. package/modules/sunburst.js +60 -60
  816. package/modules/sunburst.js.map +1 -1
  817. package/modules/sunburst.src.js +281 -248
  818. package/modules/tilemap.js +17 -17
  819. package/modules/tilemap.js.map +1 -1
  820. package/modules/tilemap.src.js +3 -13
  821. package/modules/timeline.js +18 -18
  822. package/modules/timeline.js.map +1 -1
  823. package/modules/timeline.src.js +5 -5
  824. package/modules/treegrid.js +56 -57
  825. package/modules/treegrid.js.map +1 -1
  826. package/modules/treegrid.src.js +201 -169
  827. package/modules/treemap.js +41 -41
  828. package/modules/treemap.js.map +1 -1
  829. package/modules/treemap.src.js +266 -232
  830. package/modules/variable-pie.js +1 -1
  831. package/modules/variable-pie.src.js +1 -1
  832. package/modules/variwide.js +1 -1
  833. package/modules/variwide.js.map +1 -1
  834. package/modules/variwide.src.js +7 -3
  835. package/modules/vector.js +1 -1
  836. package/modules/vector.src.js +1 -1
  837. package/modules/venn.js +31 -31
  838. package/modules/venn.js.map +1 -1
  839. package/modules/venn.src.js +740 -731
  840. package/modules/windbarb.js +15 -15
  841. package/modules/windbarb.js.map +1 -1
  842. package/modules/windbarb.src.js +90 -62
  843. package/modules/wordcloud.js +23 -24
  844. package/modules/wordcloud.js.map +1 -1
  845. package/modules/wordcloud.src.js +898 -954
  846. package/modules/xrange.js +2 -2
  847. package/modules/xrange.js.map +1 -1
  848. package/modules/xrange.src.js +12 -33
  849. package/package.json +1 -1
  850. package/themes/avocado.js +1 -1
  851. package/themes/avocado.src.js +1 -1
  852. package/themes/brand-dark.js +15 -0
  853. package/themes/brand-dark.js.map +1 -0
  854. package/themes/brand-dark.src.js +328 -0
  855. package/themes/brand-light.js +15 -0
  856. package/themes/brand-light.js.map +1 -0
  857. package/themes/brand-light.src.js +294 -0
  858. package/themes/dark-blue.js +1 -1
  859. package/themes/dark-blue.src.js +1 -1
  860. package/themes/dark-green.js +1 -1
  861. package/themes/dark-green.src.js +1 -1
  862. package/themes/dark-unica.js +1 -1
  863. package/themes/dark-unica.js.map +1 -1
  864. package/themes/dark-unica.src.js +5 -3
  865. package/themes/gray.js +1 -1
  866. package/themes/gray.src.js +1 -1
  867. package/themes/grid-light.js +1 -1
  868. package/themes/grid-light.js.map +1 -1
  869. package/themes/grid-light.src.js +5 -3
  870. package/themes/grid.js +1 -1
  871. package/themes/grid.js.map +1 -1
  872. package/themes/grid.src.js +5 -3
  873. package/themes/high-contrast-dark.js +1 -1
  874. package/themes/high-contrast-dark.src.js +1 -1
  875. package/themes/high-contrast-light.js +1 -1
  876. package/themes/high-contrast-light.src.js +1 -1
  877. package/themes/sand-signika.js +1 -1
  878. package/themes/sand-signika.src.js +1 -1
  879. package/themes/skies.js +1 -1
  880. package/themes/skies.src.js +1 -1
  881. package/themes/sunset.js +1 -1
  882. package/themes/sunset.src.js +1 -1
  883. package/es-modules/Core/Axis/MapAxis.js +0 -157
  884. package/es-modules/Core/Color/Palette.js +0 -82
  885. package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
  886. package/es-modules/Mixins/ColorSeries.js +0 -77
  887. package/es-modules/Mixins/DerivedSeries.js +0 -118
  888. package/es-modules/Mixins/DrawPoint.js +0 -81
  889. package/es-modules/Mixins/IndicatorRequired.js +0 -56
  890. package/es-modules/Mixins/MultipleLines.js +0 -181
  891. package/es-modules/Mixins/Navigation.js +0 -54
  892. package/es-modules/Mixins/NelderMead.js +0 -132
  893. package/es-modules/Mixins/Polygon.js +0 -259
  894. package/es-modules/Mixins/ReduceArray.js +0 -54
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highstock JS v9.2.2 (2021-08-24)
2
+ * @license Highstock JS v9.3.3 (2022-02-01)
3
3
  *
4
4
  * Highcharts Stock as a plugin for Highcharts
5
5
  *
@@ -250,12 +250,12 @@
250
250
  while (i--) {
251
251
  translated = translatedArr[i];
252
252
  distance = Math.abs(lastTranslated - translated);
253
- // #4175 - when axis is reversed, the distance, is negative
254
- // but tickPixelIntervalOption positive, so we need to
255
- // compare the same values
253
+ // #4175 - when axis is reversed, the distance, is negative but
254
+ // tickPixelIntervalOption positive, so we need to compare the
255
+ // same values
256
256
  // Remove ticks that are closer than 0.6 times the pixel
257
- // interval from the one to the right, but not if it is
258
- // close to the median distance (#748).
257
+ // interval from the one to the right, but not if it is close to
258
+ // the median distance (#748).
259
259
  if (lastTranslated &&
260
260
  distance < tickPixelIntervalOption * 0.8 &&
261
261
  (medianDistance === null || distance < medianDistance * 0.8)) {
@@ -287,11 +287,8 @@
287
287
  *
288
288
  * @private
289
289
  * @function Highcharts.Axis#index2val
290
- *
291
290
  * @param {number} index
292
- * The index value of searched point
293
- *
294
- * @return {number}
291
+ * The index value of searched point
295
292
  */
296
293
  function index2val(index) {
297
294
  var axis = this,
@@ -328,11 +325,8 @@
328
325
  *
329
326
  * @private
330
327
  * @function Highcharts.Axis#lin2val
331
- *
332
328
  * @param {number} val
333
- * The linear abstracted value.
334
- *
335
- * @return {number}
329
+ * The linear abstracted value.
336
330
  */
337
331
  function lin2val(val) {
338
332
  var axis = this,
@@ -345,37 +339,37 @@
345
339
  return val;
346
340
  }
347
341
  // Convert back from modivied value to pixels. // #15970
348
- var pixelVal = (val - localMin) * localA + axis.minPixelPadding,
342
+ var pixelVal = (val - localMin) * localA +
343
+ axis.minPixelPadding,
349
344
  isInside = pixelVal > 0 && pixelVal < axis.left + axis.len;
350
- // If the value is not inside the plot area,
351
- // use the extended positions.
345
+ // If the value is not inside the plot area, use the extended positions.
352
346
  // (array contains also points that are outside of the plotArea).
353
347
  if (!isInside) {
354
348
  // When iterating for the first time,
355
349
  // get the extended ordinal positional and assign them.
356
350
  if (!ordinal.extendedOrdinalPositions) {
357
- ordinal.extendedOrdinalPositions = ordinal.getExtendedPositions();
351
+ ordinal.extendedOrdinalPositions = (ordinal.getExtendedPositions());
358
352
  }
359
353
  positions = ordinal.extendedOrdinalPositions;
360
354
  }
361
- // In some cases (especially in early stages of the chart creation)
362
- // the getExtendedPositions might return undefined.
355
+ // In some cases (especially in early stages of the chart creation) the
356
+ // getExtendedPositions might return undefined.
363
357
  if (positions && positions.length) {
364
358
  var index = ordinal.getIndexOfPoint(pixelVal,
365
359
  positions),
366
360
  mantissa = correctFloat(index % 1);
367
- // Check if the index is inside position array.
368
- // If true, read/approximate value for that exact index.
369
- if (index >= 0 && index < positions.length) {
361
+ // Check if the index is inside position array. If true,
362
+ // read/approximate value for that exact index.
363
+ if (index >= 0 && index < positions.length - 1) {
370
364
  var leftNeighbour = positions[Math.floor(index)],
371
365
  rightNeighbour = positions[Math.ceil(index)],
372
366
  distance = rightNeighbour - leftNeighbour;
373
367
  return positions[Math.floor(index)] + mantissa * distance;
374
368
  }
375
- // For cases when the index is not in the extended ordinal
376
- // position array, like when the value we are looking
377
- // for exceed the available data,
378
- // approximate that value based on the calculated slope.
369
+ // For cases when the index is not in the extended ordinal position
370
+ // array, like when the value we are looking for exceed the
371
+ // available data, approximate that value based on the calculated
372
+ // slope.
379
373
  var positionsLength = positions.length,
380
374
  firstPositionsValue = positions[0],
381
375
  lastPositionsValue = positions[positionsLength - 1],
@@ -388,8 +382,8 @@
388
382
  return val;
389
383
  }
390
384
  /**
391
- * Internal function to calculate the precise index
392
- * in ordinalPositions array.
385
+ * Internal function to calculate the precise index in ordinalPositions
386
+ * array.
393
387
  * @private
394
388
  */
395
389
  function getIndexInArray(ordinalPositions, val) {
@@ -460,9 +454,8 @@
460
454
  }
461
455
  }
462
456
  /**
463
- * @private
464
- *
465
457
  * Extending the Chart.pan method for ordinal axes
458
+ * @private
466
459
  */
467
460
  function onChartPan(e) {
468
461
  var chart = this,
@@ -488,7 +481,11 @@
488
481
  // how many ordinal units did we move?
489
482
  movedUnits = (mouseDownX - chartX) / pointPixelWidth,
490
483
  // get index of all the chart's points
491
- extendedAxis = { ordinal: { positions: xAxis.ordinal.getExtendedPositions() } },
484
+ extendedAxis = {
485
+ ordinal: {
486
+ positions: xAxis.ordinal.getExtendedPositions()
487
+ }
488
+ },
492
489
  index2val_1 = xAxis.index2val,
493
490
  val2lin_1 = xAxis.val2lin;
494
491
  var trimmedRange = void 0,
@@ -508,37 +505,41 @@
508
505
  }
509
506
  if (movedUnits < 0) {
510
507
  searchAxisLeft = extendedAxis;
511
- searchAxisRight = xAxis.ordinal.positions ? xAxis : extendedAxis;
508
+ searchAxisRight = xAxis.ordinal.positions ?
509
+ xAxis : extendedAxis;
512
510
  }
513
511
  else {
514
- searchAxisLeft = xAxis.ordinal.positions ? xAxis : extendedAxis;
512
+ searchAxisLeft = xAxis.ordinal.positions ?
513
+ xAxis : extendedAxis;
515
514
  searchAxisRight = extendedAxis;
516
515
  }
517
- // In grouped data series, the last ordinal position
518
- // represents the grouped data, which is to the left of the
519
- // real data max. If we don't compensate for this, we will
520
- // be allowed to pan grouped data series passed the right of
521
- // the plot area.
516
+ // In grouped data series, the last ordinal position represents
517
+ // the grouped data, which is to the left of the real data max.
518
+ // If we don't compensate for this, we will be allowed to pan
519
+ // grouped data series passed the right of the plot area.
522
520
  ordinalPositions = searchAxisRight.ordinal.positions;
523
521
  if (dataMax >
524
522
  ordinalPositions[ordinalPositions.length - 1]) {
525
523
  ordinalPositions.push(dataMax);
526
524
  }
527
- // Get the new min and max values by getting the ordinal
528
- // index for the current extreme, then add the moved units
529
- // and translate back to values. This happens on the
530
- // extended ordinal positions if the new position is out of
531
- // range, else it happens on the current x axis which is
532
- // smaller and faster.
525
+ // Get the new min and max values by getting the ordinal index
526
+ // for the current extreme, then add the moved units and
527
+ // translate back to values. This happens on the extended
528
+ // ordinal positions if the new position is out of range, else
529
+ // it happens on the current x axis which is smaller and faster.
533
530
  chart.fixedRange = max - min;
534
- trimmedRange = xAxis.navigatorAxis.toFixedRange(null, null, index2val_1.apply(searchAxisLeft, [
535
- val2lin_1.apply(searchAxisLeft, [min, true]) + movedUnits
531
+ trimmedRange = xAxis.navigatorAxis
532
+ .toFixedRange(void 0, void 0, index2val_1.apply(searchAxisLeft, [
533
+ val2lin_1.apply(searchAxisLeft, [min, true]) +
534
+ movedUnits
536
535
  ]), index2val_1.apply(searchAxisRight, [
537
- val2lin_1.apply(searchAxisRight, [max, true]) + movedUnits
536
+ val2lin_1.apply(searchAxisRight, [max, true]) +
537
+ movedUnits
538
538
  ]));
539
539
  // Apply it if it is within the available data range
540
540
  if (trimmedRange.min >= Math.min(extremes.dataMin, min) &&
541
- trimmedRange.max <= Math.max(dataMax, max) + overscroll) {
541
+ trimmedRange.max <= Math.max(dataMax, max) +
542
+ overscroll) {
542
543
  xAxis.setExtremes(trimmedRange.min, trimmedRange.max, true, false, { trigger: 'pan' });
543
544
  }
544
545
  chart.mouseDownX = chartX; // set new reference for next run
@@ -578,14 +579,10 @@
578
579
  *
579
580
  * @private
580
581
  * @function Highcharts.Axis#val2lin
581
- *
582
582
  * @param {number} val
583
583
  * The axis value.
584
- *
585
584
  * @param {boolean} [toIndex]
586
585
  * Whether to return the index in the ordinalPositions or the new value.
587
- *
588
- * @return {number}
589
586
  */
590
587
  function val2lin(val, toIndex) {
591
588
  var axis = this,
@@ -632,7 +629,8 @@
632
629
  val <=
633
630
  extendedOrdinalPositions[length_2 - 1]) {
634
631
  // Return Value
635
- ordinalIndex = getIndexInArray(extendedOrdinalPositions, val) - originalPositionsReference;
632
+ ordinalIndex = getIndexInArray(extendedOrdinalPositions, val) -
633
+ originalPositionsReference;
636
634
  }
637
635
  else {
638
636
  // Since ordinal.slope is the average distance between 2
@@ -706,7 +704,6 @@
706
704
  maxIndex,
707
705
  slope,
708
706
  i,
709
- hasBoostedSeries,
710
707
  ordinalPositions = [],
711
708
  overscrollPointsRange = Number.MAX_VALUE,
712
709
  useOrdinal = false;
@@ -715,7 +712,9 @@
715
712
  axis.series.forEach(function (series, i) {
716
713
  uniqueOrdinalPositions = [];
717
714
  if ((!ignoreHiddenSeries || series.visible !== false) &&
718
- (series.takeOrdinalPosition !== false || hasBreaks)) {
715
+ (series
716
+ .takeOrdinalPosition !== false ||
717
+ hasBreaks)) {
719
718
  // concatenate the processed X data into the existing
720
719
  // positions, or the empty array
721
720
  ordinalPositions = ordinalPositions.concat(series.processedXData);
@@ -731,25 +730,21 @@
731
730
  if (len) {
732
731
  i = 0;
733
732
  while (i < len - 1) {
734
- if (ordinalPositions[i] !== ordinalPositions[i + 1]) {
733
+ if (ordinalPositions[i] !==
734
+ ordinalPositions[i + 1]) {
735
735
  uniqueOrdinalPositions.push(ordinalPositions[i + 1]);
736
736
  }
737
737
  i++;
738
738
  }
739
739
  // Check first item:
740
- if (uniqueOrdinalPositions[0] !== ordinalPositions[0]) {
740
+ if (uniqueOrdinalPositions[0] !==
741
+ ordinalPositions[0]) {
741
742
  uniqueOrdinalPositions.unshift(ordinalPositions[0]);
742
743
  }
743
744
  ordinalPositions = uniqueOrdinalPositions;
744
745
  }
745
746
  }
746
- if (series.isSeriesBoosting) {
747
- hasBoostedSeries = true;
748
- }
749
747
  });
750
- if (hasBoostedSeries) {
751
- ordinalPositions.length = 0;
752
- }
753
748
  // cache the length
754
749
  len = ordinalPositions.length;
755
750
  // Check if we really need the overhead of mapping axis data
@@ -759,7 +754,8 @@
759
754
  dist = ordinalPositions[1] - ordinalPositions[0];
760
755
  i = len - 1;
761
756
  while (i-- && !useOrdinal) {
762
- if (ordinalPositions[i + 1] - ordinalPositions[i] !== dist) {
757
+ if (ordinalPositions[i + 1] - ordinalPositions[i] !==
758
+ dist) {
763
759
  useOrdinal = true;
764
760
  }
765
761
  }
@@ -768,8 +764,8 @@
768
764
  // spaced.
769
765
  if (!axis.options.keepOrdinalPadding &&
770
766
  (ordinalPositions[0] - min > dist ||
771
- max - ordinalPositions[ordinalPositions.length - 1] >
772
- dist)) {
767
+ (max -
768
+ ordinalPositions[ordinalPositions.length - 1]) > dist)) {
773
769
  useOrdinal = true;
774
770
  }
775
771
  }
@@ -947,11 +943,10 @@
947
943
  fakeAxis.series.push(fakeSeries);
948
944
  series.processData.apply(fakeSeries);
949
945
  });
950
- // Apply grouping if needed.
951
- axis.applyGrouping.call(fakeAxis);
952
- // Force to use the ordinal when points are evenly spaced
953
- // (e.g. weeks), #3825.
954
- if (fakeSeries.closestPointRange !== fakeSeries.basePointRange &&
946
+ // Force to use the ordinal when points are evenly spaced (e.g.
947
+ // weeks), #3825.
948
+ if ((fakeSeries.closestPointRange !==
949
+ fakeSeries.basePointRange) &&
955
950
  fakeSeries.currentDataGrouping) {
956
951
  fakeAxis.forceOrdinal = true;
957
952
  }
@@ -999,8 +994,8 @@
999
994
  if (!groupIntervalFactor) {
1000
995
  // Register all the distances in an array
1001
996
  for (i = 0; i < len - 1; i++) {
1002
- distances[i] =
1003
- processedXData[i + 1] - processedXData[i];
997
+ distances[i] = (processedXData[i + 1] -
998
+ processedXData[i]);
1004
999
  }
1005
1000
  // Sort them and find the median
1006
1001
  distances.sort(function (a, b) {
@@ -1022,15 +1017,12 @@
1022
1017
  *
1023
1018
  * @private
1024
1019
  * @param {number} val
1025
- * The pixel value of a point.
1020
+ * The pixel value of a point.
1026
1021
  *
1027
1022
  * @param {Array<number>} [ordinallArray]
1028
- * An array of all points available on the axis
1029
- * for the given data set.
1030
- * Either ordinalPositions if the value is inside the plotArea
1031
- * or extendedOrdinalPositions if not.
1032
- *
1033
- * @return {number}
1023
+ * An array of all points available on the axis for the given data set.
1024
+ * Either ordinalPositions if the value is inside the plotArea or
1025
+ * extendedOrdinalPositions if not.
1034
1026
  */
1035
1027
  Additions.prototype.getIndexOfPoint = function (val, ordinalArray) {
1036
1028
  var ordinal = this,
@@ -1043,17 +1035,19 @@
1043
1035
  // When more series assign to axis, find the smallest one, #15987.
1044
1036
  if (axis.series.length > 1) {
1045
1037
  axis.series.forEach(function (series) {
1046
- if (defined(series.points[0]) &&
1038
+ if (series.points &&
1039
+ defined(series.points[0]) &&
1047
1040
  defined(series.points[0].plotX) &&
1048
1041
  series.points[0].plotX < firstPointX) {
1049
1042
  firstPointX = series.points[0].plotX;
1050
1043
  }
1051
1044
  });
1052
1045
  }
1053
- // Distance in pixels between two points
1054
- // on the ordinal axis in the current zoom.
1055
- var ordinalPointPixelInterval = axis.translationSlope *
1056
- (ordinal.slope || axis.closestPointRange || ordinal.overscrollPointsRange),
1046
+ // Distance in pixels between two points on the ordinal axis in the
1047
+ // current zoom.
1048
+ var ordinalPointPixelInterval = axis.translationSlope * (ordinal.slope ||
1049
+ axis.closestPointRange ||
1050
+ ordinal.overscrollPointsRange),
1057
1051
  // toValue for the first point.
1058
1052
  shiftIndex = (val - firstPointX) / ordinalPointPixelInterval;
1059
1053
  return Additions.findIndexOf(ordinalArray, firstPointVal) + shiftIndex;
@@ -1089,19 +1083,20 @@
1089
1083
  * @private
1090
1084
  */
1091
1085
  Additions.prototype.postProcessTickInterval = function (tickInterval) {
1092
- // Problem: https://jsfiddle.net/highcharts/FQm4E/1/
1093
- // This is a case where this algorithm doesn't work optimally. In
1094
- // this case, the tick labels are spread out per week, but all the
1095
- // gaps reside within weeks. So we have a situation where the labels
1096
- // are courser than the ordinal gaps, and thus the tick interval
1097
- // should not be altered.
1086
+ // Problem: https://jsfiddle.net/highcharts/FQm4E/1/. This is a case
1087
+ // where this algorithm doesn't work optimally. In this case, the
1088
+ // tick labels are spread out per week, but all the gaps reside
1089
+ // within weeks. So we have a situation where the labels are courser
1090
+ // than the ordinal gaps, and thus the tick interval should not be
1091
+ // altered.
1098
1092
  var ordinal = this,
1099
1093
  axis = ordinal.axis,
1100
1094
  ordinalSlope = ordinal.slope;
1101
1095
  var ret;
1102
1096
  if (ordinalSlope) {
1103
1097
  if (!axis.options.breaks) {
1104
- ret = tickInterval / (ordinalSlope / axis.closestPointRange);
1098
+ ret = (tickInterval /
1099
+ (ordinalSlope / axis.closestPointRange));
1105
1100
  }
1106
1101
  else {
1107
1102
  ret = axis.closestPointRange || tickInterval; // #7275
@@ -1124,33 +1119,33 @@
1124
1119
 
1125
1120
  return OrdinalAxis;
1126
1121
  });
1127
- _registerModule(_modules, 'Core/Axis/BrokenAxis.js', [_modules['Extensions/Stacking.js'], _modules['Core/Utilities.js']], function (StackItem, U) {
1122
+ _registerModule(_modules, 'Series/DataModifyComposition.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Series/Point.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (Axis, Point, Series, U) {
1128
1123
  /* *
1129
1124
  *
1130
- * (c) 2009-2021 Torstein Honsi
1125
+ * (c) 2010-2021 Torstein Honsi
1131
1126
  *
1132
1127
  * License: www.highcharts.com/license
1133
1128
  *
1134
1129
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1135
1130
  *
1136
1131
  * */
1132
+ var pointTooltipFormatter = Point.prototype.tooltipFormatter;
1137
1133
  var addEvent = U.addEvent,
1138
- find = U.find,
1139
- fireEvent = U.fireEvent,
1134
+ arrayMax = U.arrayMax,
1135
+ arrayMin = U.arrayMin,
1136
+ correctFloat = U.correctFloat,
1137
+ defined = U.defined,
1140
1138
  isArray = U.isArray,
1141
1139
  isNumber = U.isNumber,
1140
+ isString = U.isString,
1142
1141
  pick = U.pick;
1143
1142
  /* *
1144
1143
  *
1145
1144
  * Composition
1146
1145
  *
1147
1146
  * */
1148
- /**
1149
- * Axis with support of broken data rows.
1150
- * @private
1151
- */
1152
- var BrokenAxis;
1153
- (function (BrokenAxis) {
1147
+ var DataModifyComposition;
1148
+ (function (DataModifyComposition) {
1154
1149
  /* *
1155
1150
  *
1156
1151
  * Declarations
@@ -1169,331 +1164,882 @@
1169
1164
  * */
1170
1165
  /* eslint-disable valid-jsdoc */
1171
1166
  /**
1172
- * Adds support for broken axes.
1167
+ * Extends the series, axis and point classes with
1168
+ * compare and cumulative support.
1169
+ *
1173
1170
  * @private
1171
+ *
1172
+ * @param SeriesClass
1173
+ * Series class to use.
1174
+ *
1175
+ * @param AxisClass
1176
+ * Axis class to extend.
1177
+ *
1178
+ * @param PointClass
1179
+ * Point class to use.
1174
1180
  */
1175
- function compose(AxisClass, SeriesClass) {
1176
- if (composedClasses.indexOf(AxisClass) === -1) {
1177
- composedClasses.push(AxisClass);
1178
- AxisClass.keepProps.push('brokenAxis');
1179
- addEvent(AxisClass, 'init', onAxisInit);
1180
- addEvent(AxisClass, 'afterInit', onAxisAfterInit);
1181
- addEvent(AxisClass, 'afterSetTickPositions', onAxisAfterSetTickPositions);
1182
- addEvent(AxisClass, 'afterSetOptions', onAxisAfterSetOptions);
1183
- }
1181
+ function compose(SeriesClass, AxisClass, PointClass) {
1184
1182
  if (composedClasses.indexOf(SeriesClass) === -1) {
1185
1183
  composedClasses.push(SeriesClass);
1186
1184
  var seriesProto = SeriesClass.prototype;
1187
- seriesProto.drawBreaks = seriesDrawBreaks;
1188
- seriesProto.gappedPath = seriesGappedPath;
1189
- addEvent(SeriesClass, 'afterGeneratePoints', onSeriesAfterGeneratePoints);
1190
- addEvent(SeriesClass, 'afterRender', onSeriesAfterRender);
1185
+ seriesProto.setCompare = seriesSetCompare;
1186
+ seriesProto.setCumulative = seriesSetCumulative;
1187
+ addEvent(SeriesClass, 'afterInit', afterInit);
1188
+ addEvent(SeriesClass, 'afterGetExtremes', afterGetExtremes);
1189
+ addEvent(SeriesClass, 'afterProcessData', afterProcessData);
1191
1190
  }
1192
- return AxisClass;
1191
+ if (composedClasses.indexOf(AxisClass) === -1) {
1192
+ composedClasses.push(AxisClass);
1193
+ var axisProto = AxisClass.prototype;
1194
+ axisProto.setCompare = axisSetCompare;
1195
+ axisProto.setModifier = setModifier;
1196
+ axisProto.setCumulative = axisSetCumulative;
1197
+ }
1198
+ if (composedClasses.indexOf(PointClass) === -1) {
1199
+ composedClasses.push(PointClass);
1200
+ var pointProto = PointClass.prototype;
1201
+ pointProto.tooltipFormatter = tooltipFormatter;
1202
+ }
1203
+ return SeriesClass;
1193
1204
  }
1194
- BrokenAxis.compose = compose;
1205
+ DataModifyComposition.compose = compose;
1206
+ /* ********************************************************************** *
1207
+ * Start shared compare and cumulative logic *
1208
+ * ********************************************************************** */
1195
1209
  /**
1210
+ * Shared code for the axis.setCompare() and the axis.setCumulative()
1211
+ * methods. Inits the 'compare' or the 'cumulative' mode.
1196
1212
  * @private
1197
1213
  */
1198
- function onAxisAfterInit() {
1199
- if (typeof this.brokenAxis !== 'undefined') {
1200
- this.brokenAxis.setBreaks(this.options.breaks, false);
1214
+ function setModifier(mode, modeState, redraw) {
1215
+ if (!this.isXAxis) {
1216
+ this.series.forEach(function (series) {
1217
+ if (mode === 'compare' &&
1218
+ typeof modeState !== 'boolean') {
1219
+ series.setCompare(modeState, false);
1220
+ }
1221
+ else if (mode === 'cumulative' &&
1222
+ !isString(modeState)) {
1223
+ series.setCumulative(modeState, false);
1224
+ }
1225
+ });
1226
+ if (pick(redraw, true)) {
1227
+ this.chart.redraw();
1228
+ }
1201
1229
  }
1202
1230
  }
1203
1231
  /**
1204
- * Force Axis to be not-ordinal when breaks are defined.
1205
- * @private
1232
+ * Extend the tooltip formatter by adding support for the point.change
1233
+ * variable as well as the changeDecimals option.
1234
+ *
1235
+ * @ignore
1236
+ * @function Highcharts.Point#tooltipFormatter
1237
+ *
1238
+ * @param {string} pointFormat
1206
1239
  */
1207
- function onAxisAfterSetOptions() {
1208
- var axis = this;
1209
- if (axis.brokenAxis && axis.brokenAxis.hasBreaks) {
1210
- axis.options.ordinal = false;
1240
+ function tooltipFormatter(pointFormat) {
1241
+ var point = this, numberFormatter = point.series.chart.numberFormatter, replace = function (value) {
1242
+ pointFormat = pointFormat.replace('{point.' + value + '}', (point[value] > 0 && value === 'change' ? '+' : '') +
1243
+ numberFormatter(point[value], pick(point.series.tooltipOptions.changeDecimals, 2)));
1244
+ };
1245
+ if (defined(point.change)) {
1246
+ replace('change');
1211
1247
  }
1248
+ if (defined(point.cumulativeSum)) {
1249
+ replace('cumulativeSum');
1250
+ }
1251
+ return pointTooltipFormatter.apply(this, [pointFormat]);
1212
1252
  }
1213
1253
  /**
1214
- * @private
1215
- */
1216
- function onAxisAfterSetTickPositions() {
1217
- var axis = this,
1218
- brokenAxis = axis.brokenAxis;
1219
- if (brokenAxis &&
1220
- brokenAxis.hasBreaks) {
1221
- var tickPositions = axis.tickPositions,
1222
- info = axis.tickPositions.info,
1223
- newPositions = [];
1224
- for (var i = 0; i < tickPositions.length; i++) {
1225
- if (!brokenAxis.isInAnyBreak(tickPositions[i])) {
1226
- newPositions.push(tickPositions[i]);
1227
- }
1254
+ * Extend series.init by adding a methods to modify the y values used
1255
+ * for plotting on the y axis. For compare mode, this method is called both
1256
+ * from the axis when finding dataMin and dataMax,
1257
+ * and from the series.translate method.
1258
+ *
1259
+ * @ignore
1260
+ * @function Highcharts.Series#init
1261
+ */
1262
+ function afterInit() {
1263
+ var compare = this.options.compare;
1264
+ var dataModify;
1265
+ if (compare === 'percent' ||
1266
+ compare === 'value' ||
1267
+ this.options.cumulative) {
1268
+ dataModify = new Additions(this);
1269
+ if (compare === 'percent' || compare === 'value') {
1270
+ // Set comparison mode
1271
+ dataModify.initCompare(compare);
1272
+ }
1273
+ else {
1274
+ // Set Cumulative Sum mode
1275
+ dataModify.initCumulative();
1228
1276
  }
1229
- axis.tickPositions = newPositions;
1230
- axis.tickPositions.info = info;
1231
1277
  }
1278
+ this.dataModify = dataModify;
1232
1279
  }
1233
1280
  /**
1281
+ * Adjust the extremes (compare and cumulative modify the data).
1234
1282
  * @private
1235
1283
  */
1236
- function onAxisInit() {
1237
- var axis = this;
1238
- if (!axis.brokenAxis) {
1239
- axis.brokenAxis = new Additions(axis);
1284
+ function afterGetExtremes(e) {
1285
+ var dataExtremes = e.dataExtremes,
1286
+ activeYData = dataExtremes.activeYData;
1287
+ if (this.dataModify && dataExtremes) {
1288
+ var extremes = void 0;
1289
+ if (this.options.compare) {
1290
+ extremes = [
1291
+ this.dataModify.modifyValue(dataExtremes.dataMin),
1292
+ this.dataModify.modifyValue(dataExtremes.dataMax)
1293
+ ];
1294
+ }
1295
+ else if (this.options.cumulative &&
1296
+ isArray(activeYData) &&
1297
+ // If only one y visible, sum doesn't change
1298
+ // so no need to change extremes
1299
+ activeYData.length >= 2) {
1300
+ extremes = Additions.getCumulativeExtremes(activeYData);
1301
+ }
1302
+ if (extremes) {
1303
+ dataExtremes.dataMin = arrayMin(extremes);
1304
+ dataExtremes.dataMax = arrayMax(extremes);
1305
+ }
1306
+ }
1307
+ }
1308
+ /* ********************************************************************** *
1309
+ * End shared compare and cumulative logic *
1310
+ * ********************************************************************** */
1311
+ /* ********************************************************************** *
1312
+ * Start value compare logic *
1313
+ * ********************************************************************** */
1314
+ /**
1315
+ * Highcharts Stock only. Set the
1316
+ * [compare](https://api.highcharts.com/highstock/plotOptions.series.compare)
1317
+ * mode of the series after render time.
1318
+ * In most cases it is more useful running
1319
+ * {@link Axis#setCompare} on the X axis to update all its series.
1320
+ *
1321
+ * @function Highcharts.Series#setCompare
1322
+ *
1323
+ * @param {string|null} [compare]
1324
+ * Can be one of `undefined` (default), `null`, `"percent"`
1325
+ * or `"value"`.
1326
+ *
1327
+ * @param {boolean} [redraw=true]
1328
+ * Whether to redraw the chart or to wait for a later call to
1329
+ * {@link Chart#redraw}.
1330
+ */
1331
+ function seriesSetCompare(compare, redraw) {
1332
+ // Survive to export, #5485 (and for options generally)
1333
+ this.options.compare = this.userOptions.compare = compare;
1334
+ // Fire series.init() that will set or delete series.dataModify
1335
+ this.update({}, pick(redraw, true));
1336
+ if (this.dataModify && (compare === 'value' || compare === 'percent')) {
1337
+ this.dataModify.initCompare(compare);
1338
+ }
1339
+ else {
1340
+ // When disabling, clear the points
1341
+ this.points.forEach(function (point) {
1342
+ delete point.change;
1343
+ });
1240
1344
  }
1241
1345
  }
1242
1346
  /**
1243
- * @private
1244
- */
1245
- function onSeriesAfterGeneratePoints() {
1246
- var _a = this,
1247
- isDirty = _a.isDirty,
1248
- connectNulls = _a.options.connectNulls,
1249
- points = _a.points,
1250
- xAxis = _a.xAxis,
1251
- yAxis = _a.yAxis;
1252
- // Set, or reset visibility of the points. Axis.setBreaks marks
1253
- // the series as isDirty
1254
- if (isDirty) {
1255
- var i = points.length;
1256
- while (i--) {
1257
- var point = points[i];
1258
- // Respect nulls inside the break (#4275)
1259
- var nullGap = point.y === null && connectNulls === false;
1260
- var isPointInBreak = (!nullGap && ((xAxis &&
1261
- xAxis.brokenAxis &&
1262
- xAxis.brokenAxis.isInAnyBreak(point.x,
1263
- true)) || (yAxis &&
1264
- yAxis.brokenAxis &&
1265
- yAxis.brokenAxis.isInAnyBreak(point.y,
1266
- true))));
1267
- // Set point.visible if in any break.
1268
- // If not in break, reset visible to original value.
1269
- point.visible = isPointInBreak ?
1270
- false :
1271
- point.options.visible !== false;
1347
+ * Extend series.processData by finding the first y value in the plot area,
1348
+ * used for comparing the following values
1349
+ *
1350
+ * @ignore
1351
+ * @function Highcharts.Series#processData
1352
+ */
1353
+ function afterProcessData() {
1354
+ var series = this;
1355
+ if (series.xAxis && // not pies
1356
+ series.processedYData &&
1357
+ series.dataModify) {
1358
+ var processedXData = series.processedXData,
1359
+ processedYData = series.processedYData,
1360
+ length_1 = processedYData.length,
1361
+ compareStart = series.options.compareStart === true ? 0 : 1;
1362
+ var keyIndex = -1,
1363
+ i = void 0;
1364
+ // For series with more than one value (range, OHLC etc), compare
1365
+ // against close or the pointValKey (#4922, #3112, #9854)
1366
+ if (series.pointArrayMap) {
1367
+ keyIndex = series.pointArrayMap.indexOf(series.options.pointValKey || series.pointValKey || 'y');
1368
+ }
1369
+ // find the first value for comparison
1370
+ for (i = 0; i < length_1 - compareStart; i++) {
1371
+ var compareValue = processedYData[i] && keyIndex > -1 ?
1372
+ processedYData[i][keyIndex] : processedYData[i];
1373
+ if (isNumber(compareValue) &&
1374
+ compareValue !== 0 &&
1375
+ processedXData[i + compareStart] >= (series.xAxis.min || 0)) {
1376
+ series.dataModify.compareValue = compareValue;
1377
+ break;
1378
+ }
1272
1379
  }
1273
1380
  }
1274
1381
  }
1275
1382
  /**
1276
- * @private
1383
+ * Highcharts Stock only. Set the compare mode on all series
1384
+ * belonging to a Y axis.
1385
+ *
1386
+ * @see [plotOptions.series.compare](https://api.highcharts.com/highstock/plotOptions.series.compare)
1387
+ *
1388
+ * @sample stock/members/axis-setcompare/
1389
+ * Set compare
1390
+ *
1391
+ * @function Highcharts.Axis#setCompare
1392
+ *
1393
+ * @param {string|null} [compare]
1394
+ * The compare mode. Can be one of `undefined` (default), `null`,
1395
+ * `"value"` or `"percent"`.
1396
+ *
1397
+ * @param {boolean} [redraw=true]
1398
+ * Whether to redraw the chart or to wait for a later call to
1399
+ * {@link Chart#redraw}.
1277
1400
  */
1278
- function onSeriesAfterRender() {
1279
- this.drawBreaks(this.xAxis, ['x']);
1280
- this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
1401
+ function axisSetCompare(compare, redraw) {
1402
+ this.setModifier('compare', compare, redraw);
1281
1403
  }
1282
- /**
1283
- * @private
1284
- */
1285
- function seriesDrawBreaks(axis, keys) {
1286
- var series = this,
1287
- points = series.points;
1288
- var breaks,
1289
- threshold,
1290
- eventName,
1291
- y;
1292
- if (axis && // #5950
1293
- axis.brokenAxis &&
1294
- axis.brokenAxis.hasBreaks) {
1295
- var brokenAxis_1 = axis.brokenAxis;
1296
- keys.forEach(function (key) {
1297
- breaks = brokenAxis_1 && brokenAxis_1.breakArray || [];
1298
- threshold = axis.isXAxis ?
1299
- axis.min :
1300
- pick(series.options.threshold, axis.min);
1301
- points.forEach(function (point) {
1302
- y = pick(point['stack' + key.toUpperCase()], point[key]);
1303
- breaks.forEach(function (brk) {
1304
- if (isNumber(threshold) && isNumber(y)) {
1305
- eventName = false;
1306
- if ((threshold < brk.from && y > brk.to) ||
1307
- (threshold > brk.from && y < brk.from)) {
1308
- eventName = 'pointBreak';
1309
- }
1310
- else if ((threshold < brk.from && y > brk.from && y < brk.to) ||
1311
- (threshold > brk.from && y > brk.to && y < brk.from)) {
1312
- eventName = 'pointInBreak';
1313
- }
1314
- if (eventName) {
1315
- fireEvent(axis, eventName, { point: point, brk: brk });
1316
- }
1317
- }
1318
- });
1319
- });
1404
+ /* ********************************************************************** *
1405
+ * End value compare logic *
1406
+ * ********************************************************************** */
1407
+ /* ********************************************************************** *
1408
+ * Start Cumulative Sum logic, author: Rafal Sebestjanski *
1409
+ * ********************************************************************** */
1410
+ /**
1411
+ * Highcharts Stock only. Set the
1412
+ * [cumulative](https://api.highcharts.com/highstock/plotOptions.series.cumulative)
1413
+ * mode of the series after render time.
1414
+ * In most cases it is more useful running
1415
+ * {@link Axis#setCumulative} on the Y axis to update all its series.
1416
+ *
1417
+ * @function Highcharts.Series#setCumulative
1418
+ *
1419
+ * @param {boolean} [cumulative=false]
1420
+ * Either enable or disable Cumulative Sum mode.
1421
+ * Can be one of `false` (default) or `true`.
1422
+ *
1423
+ * @param {boolean} [redraw=true]
1424
+ * Whether to redraw the chart or to wait for a later call to
1425
+ * {@link Chart#redraw}.
1426
+ */
1427
+ function seriesSetCumulative(cumulative, redraw) {
1428
+ // Set default value to false
1429
+ cumulative = pick(cumulative, false);
1430
+ // Survive to export, #5485 (and for options generally)
1431
+ this.options.cumulative = this.userOptions.cumulative = cumulative;
1432
+ // Fire series.init() that will set or delete series.dataModify
1433
+ this.update({}, pick(redraw, true));
1434
+ // If should, turn on the Cumulative Sum mode
1435
+ if (this.dataModify) {
1436
+ this.dataModify.initCumulative();
1437
+ }
1438
+ else {
1439
+ // When disabling, clear the points
1440
+ this.points.forEach(function (point) {
1441
+ delete point.cumulativeSum;
1320
1442
  });
1321
1443
  }
1322
1444
  }
1323
1445
  /**
1324
- * Extend getGraphPath by identifying gaps in the data so that we
1325
- * can draw a gap in the line or area. This was moved from ordinal
1326
- * axis module to broken axis module as of #5045.
1446
+ * Highcharts Stock only. Set the cumulative mode on all series
1447
+ * belonging to a Y axis.
1327
1448
  *
1328
- * @private
1329
- * @function Highcharts.Series#gappedPath
1449
+ * @see [plotOptions.series.cumulative](https://api.highcharts.com/highstock/plotOptions.series.cumulative)
1330
1450
  *
1331
- * @return {Highcharts.SVGPathArray}
1332
- * Gapped path
1451
+ * @sample stock/members/axis-setcumulative/
1452
+ * Set cumulative
1453
+ *
1454
+ * @function Highcharts.Axis#setCumulative
1455
+ *
1456
+ * @param {boolean} [cumulative]
1457
+ * Whether to disable or enable the cumulative mode.
1458
+ * Can be one of `undefined` (default, treated as `false`),
1459
+ * `false` or `true`.
1460
+ *
1461
+ * @param {boolean} [redraw=true]
1462
+ * Whether to redraw the chart or to wait for a later call to
1463
+ * {@link Chart#redraw}.
1333
1464
  */
1334
- function seriesGappedPath() {
1335
- var currentDataGrouping = this.currentDataGrouping,
1336
- groupingSize = currentDataGrouping && currentDataGrouping.gapSize,
1337
- points = this.points.slice(),
1338
- yAxis = this.yAxis;
1339
- var gapSize = this.options.gapSize,
1340
- i = points.length - 1,
1341
- stack;
1465
+ function axisSetCumulative(cumulative, redraw) {
1466
+ this.setModifier('cumulative', cumulative, redraw);
1467
+ }
1468
+ /* *
1469
+ *
1470
+ * Classes
1471
+ *
1472
+ * */
1473
+ /**
1474
+ * @private
1475
+ */
1476
+ var Additions = /** @class */ (function () {
1477
+ /* *
1478
+ *
1479
+ * Constructors
1480
+ *
1481
+ * */
1482
+ /**
1483
+ * @private
1484
+ */
1485
+ function Additions(series) {
1486
+ this.series = series;
1487
+ }
1488
+ /* *
1489
+ *
1490
+ * Functions
1491
+ *
1492
+ * */
1342
1493
  /**
1343
- * Defines when to display a gap in the graph, together with the
1344
- * [gapUnit](plotOptions.series.gapUnit) option.
1494
+ * @private
1495
+ */
1496
+ Additions.prototype.modifyValue = function () {
1497
+ return 0;
1498
+ };
1499
+ /**
1500
+ * @ignore
1501
+ * @function Highcharts.Series#getCumulativeExtremes
1345
1502
  *
1346
- * In case when `dataGrouping` is enabled, points can be grouped
1347
- * into a larger time span. This can make the grouped points to
1348
- * have a greater distance than the absolute value of `gapSize`
1349
- * property, which will result in disappearing graph completely.
1350
- * To prevent this situation the mentioned distance between
1351
- * grouped points is used instead of previously defined
1352
- * `gapSize`.
1503
+ * @param {Array} [activeYData]
1504
+ * An array cointaining all the points' y values
1505
+ * in a visible range.
1506
+ */
1507
+ Additions.getCumulativeExtremes = function (activeYData) {
1508
+ var cumulativeDataMin = Infinity,
1509
+ cumulativeDataMax = -Infinity;
1510
+ activeYData.reduce(function (prev, cur) {
1511
+ var sum = prev + cur;
1512
+ cumulativeDataMin = Math.min(cumulativeDataMin, sum, prev);
1513
+ cumulativeDataMax = Math.max(cumulativeDataMax, sum, prev);
1514
+ return sum;
1515
+ });
1516
+ return [cumulativeDataMin, cumulativeDataMax];
1517
+ };
1518
+ /**
1519
+ * @ignore
1520
+ * @function Highcharts.Series#initCompare
1353
1521
  *
1354
- * In practice, this option is most often used to visualize gaps
1355
- * in time series. In a stock chart, intraday data is available
1356
- * for daytime hours, while gaps will appear in nights and
1357
- * weekends.
1358
- *
1359
- * @see [gapUnit](plotOptions.series.gapUnit)
1360
- * @see [xAxis.breaks](#xAxis.breaks)
1361
- *
1362
- * @sample {highstock} stock/plotoptions/series-gapsize/
1363
- * Setting the gap size to 2 introduces gaps for weekends in
1364
- * daily datasets.
1365
- *
1366
- * @type {number}
1367
- * @default 0
1368
- * @product highstock
1369
- * @requires modules/broken-axis
1370
- * @apioption plotOptions.series.gapSize
1522
+ * @param {string} [compare]
1523
+ * Can be one of `"percent"` or `"value"`.
1371
1524
  */
1525
+ Additions.prototype.initCompare = function (compare) {
1526
+ // Set the modifyValue method
1527
+ this.modifyValue = function (value, index) {
1528
+ if (value === null) {
1529
+ value = 0;
1530
+ }
1531
+ var compareValue = this.compareValue;
1532
+ if (typeof value !== 'undefined' &&
1533
+ typeof compareValue !== 'undefined') { // #2601, #5814
1534
+ // Get the modified value
1535
+ if (compare === 'value') {
1536
+ value -= compareValue;
1537
+ // Compare percent
1538
+ }
1539
+ else {
1540
+ var compareBase = this.series.options.compareBase;
1541
+ value = 100 * (value / compareValue) -
1542
+ (compareBase === 100 ? 0 : 100);
1543
+ }
1544
+ // record for tooltip etc.
1545
+ if (typeof index !== 'undefined') {
1546
+ var point = this.series.points[index];
1547
+ if (point) {
1548
+ point.change = value;
1549
+ }
1550
+ }
1551
+ return value;
1552
+ }
1553
+ return 0;
1554
+ };
1555
+ };
1372
1556
  /**
1373
- * Together with [gapSize](plotOptions.series.gapSize), this
1374
- * option defines where to draw gaps in the graph.
1375
- *
1376
- * When the `gapUnit` is `"relative"` (default), a gap size of 5
1377
- * means that if the distance between two points is greater than
1378
- * 5 times that of the two closest points, the graph will be
1379
- * broken.
1380
- *
1381
- * When the `gapUnit` is `"value"`, the gap is based on absolute
1382
- * axis values, which on a datetime axis is milliseconds. This
1383
- * also applies to the navigator series that inherits gap
1384
- * options from the base series.
1385
- *
1386
- * @see [gapSize](plotOptions.series.gapSize)
1387
- *
1388
- * @type {string}
1389
- * @default relative
1390
- * @since 5.0.13
1391
- * @product highstock
1392
- * @validvalue ["relative", "value"]
1393
- * @requires modules/broken-axis
1394
- * @apioption plotOptions.series.gapUnit
1557
+ * @ignore
1558
+ * @function Highcharts.Series#initCumulative
1395
1559
  */
1396
- if (gapSize && i > 0) { // #5008
1397
- // Gap unit is relative
1398
- if (this.options.gapUnit !== 'value') {
1399
- gapSize *= this.basePointRange;
1400
- }
1401
- // Setting a new gapSize in case dataGrouping is enabled
1402
- // (#7686)
1403
- if (groupingSize &&
1404
- groupingSize > gapSize &&
1405
- // Except when DG is forced (e.g. from other series)
1406
- // and has lower granularity than actual points (#11351)
1407
- groupingSize >= this.basePointRange) {
1408
- gapSize = groupingSize;
1409
- }
1410
- // extension for ordinal breaks
1411
- var current = void 0,
1412
- next = void 0;
1413
- while (i--) {
1414
- // Reassign next if it is not visible
1415
- if (!(next && next.visible !== false)) {
1416
- next = points[i + 1];
1417
- }
1418
- current = points[i];
1419
- // Skip iteration if one of the points is not visible
1420
- if (next.visible === false || current.visible === false) {
1421
- continue;
1422
- }
1423
- if (next.x - current.x > gapSize) {
1424
- var xRange = (current.x + next.x) / 2;
1425
- points.splice(// insert after this one
1426
- i + 1, 0, {
1427
- isNull: true,
1428
- x: xRange
1429
- });
1430
- // For stacked chart generate empty stack items,
1431
- // #6546
1432
- if (yAxis.stacking && this.options.stacking) {
1433
- stack = yAxis.stacking.stacks[this.stackKey][xRange] =
1434
- new StackItem(yAxis, yAxis.options
1435
- .stackLabels, false, xRange, this.stack);
1436
- stack.total = 0;
1560
+ Additions.prototype.initCumulative = function () {
1561
+ // Set the modifyValue method
1562
+ this.modifyValue = function (value, index) {
1563
+ if (value === null) {
1564
+ value = 0;
1565
+ }
1566
+ if (value !== void 0 && index !== void 0) {
1567
+ var prevPoint = index > 0 ?
1568
+ this.series.points[index - 1] : null;
1569
+ // Get the modified value
1570
+ if (prevPoint && prevPoint.cumulativeSum) {
1571
+ value = correctFloat(prevPoint.cumulativeSum + value);
1572
+ }
1573
+ // Record for tooltip etc.
1574
+ var point = this.series.points[index];
1575
+ if (point) {
1576
+ point.cumulativeSum = value;
1437
1577
  }
1578
+ return value;
1438
1579
  }
1439
- // Assign current to next for the upcoming iteration
1440
- next = current;
1441
- }
1442
- }
1443
- // Call base method
1444
- return this.getGraphPath(points);
1445
- }
1580
+ return 0;
1581
+ };
1582
+ };
1583
+ return Additions;
1584
+ }());
1585
+ DataModifyComposition.Additions = Additions;
1586
+ })(DataModifyComposition || (DataModifyComposition = {}));
1587
+ /* *
1588
+ *
1589
+ * Default Export
1590
+ *
1591
+ * */
1592
+ /* *
1593
+ *
1594
+ * API Options
1595
+ *
1596
+ * */
1597
+ /**
1598
+ * Compare the values of the series against the first non-null, non-
1599
+ * zero value in the visible range. The y axis will show percentage
1600
+ * or absolute change depending on whether `compare` is set to `"percent"`
1601
+ * or `"value"`. When this is applied to multiple series, it allows
1602
+ * comparing the development of the series against each other. Adds
1603
+ * a `change` field to every point object.
1604
+ *
1605
+ * @see [compareBase](#plotOptions.series.compareBase)
1606
+ * @see [Axis.setCompare()](/class-reference/Highcharts.Axis#setCompare)
1607
+ * @see [Series.setCompare()](/class-reference/Highcharts.Series#setCompare)
1608
+ *
1609
+ * @sample {highstock} stock/plotoptions/series-compare-percent/
1610
+ * Percent
1611
+ * @sample {highstock} stock/plotoptions/series-compare-value/
1612
+ * Value
1613
+ *
1614
+ * @type {string}
1615
+ * @since 1.0.1
1616
+ * @product highstock
1617
+ * @apioption plotOptions.series.compare
1618
+ */
1619
+ /**
1620
+ * Defines if comparison should start from the first point within the visible
1621
+ * range or should start from the first point **before** the range.
1622
+ *
1623
+ * In other words, this flag determines if first point within the visible range
1624
+ * will have 0% (`compareStart=true`) or should have been already calculated
1625
+ * according to the previous point (`compareStart=false`).
1626
+ *
1627
+ * @sample {highstock} stock/plotoptions/series-comparestart/
1628
+ * Calculate compare within visible range
1629
+ *
1630
+ * @type {boolean}
1631
+ * @default false
1632
+ * @since 6.0.0
1633
+ * @product highstock
1634
+ * @apioption plotOptions.series.compareStart
1635
+ */
1636
+ /**
1637
+ * When [compare](#plotOptions.series.compare) is `percent`, this option
1638
+ * dictates whether to use 0 or 100 as the base of comparison.
1639
+ *
1640
+ * @sample {highstock} stock/plotoptions/series-comparebase/
1641
+ * Compare base is 100
1642
+ *
1643
+ * @type {number}
1644
+ * @default 0
1645
+ * @since 5.0.6
1646
+ * @product highstock
1647
+ * @validvalue [0, 100]
1648
+ * @apioption plotOptions.series.compareBase
1649
+ */
1650
+ /**
1651
+ * Cumulative Sum feature replaces points' values with the following formula:
1652
+ * `sum of all previous points' values + current point's value`.
1653
+ * Works only for points in a visible range.
1654
+ * Adds the `cumulativeSum` field to each point object that can be accessed
1655
+ * e.g. in the [tooltip.pointFormat](https://api.highcharts.com/highstock/tooltip.pointFormat).
1656
+ *
1657
+ * @see [Axis.setCumulative()](/class-reference/Highcharts.Axis#setCumulative)
1658
+ * @see [Series.setCumulative()](/class-reference/Highcharts.Series#setCumulative)
1659
+ *
1660
+ * @sample {highstock} stock/plotoptions/series-cumulative-sum/
1661
+ * Cumulative Sum
1662
+ *
1663
+ * @type {boolean}
1664
+ * @default false
1665
+ * @since 9.3.0
1666
+ * @product highstock
1667
+ * @apioption plotOptions.series.cumulative
1668
+ */
1669
+ ''; // keeps doclets above in transpiled file
1670
+
1671
+ return DataModifyComposition;
1672
+ });
1673
+ _registerModule(_modules, 'Core/Axis/BrokenAxis.js', [_modules['Extensions/Stacking.js'], _modules['Core/Utilities.js']], function (StackItem, U) {
1674
+ /* *
1675
+ *
1676
+ * (c) 2009-2021 Torstein Honsi
1677
+ *
1678
+ * License: www.highcharts.com/license
1679
+ *
1680
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1681
+ *
1682
+ * */
1683
+ var addEvent = U.addEvent,
1684
+ find = U.find,
1685
+ fireEvent = U.fireEvent,
1686
+ isArray = U.isArray,
1687
+ isNumber = U.isNumber,
1688
+ pick = U.pick;
1689
+ /* *
1690
+ *
1691
+ * Composition
1692
+ *
1693
+ * */
1694
+ /**
1695
+ * Axis with support of broken data rows.
1696
+ * @private
1697
+ */
1698
+ var BrokenAxis;
1699
+ (function (BrokenAxis) {
1446
1700
  /* *
1447
1701
  *
1448
- * Class
1702
+ * Declarations
1703
+ *
1704
+ * */
1705
+ /* *
1706
+ *
1707
+ * Constants
1708
+ *
1709
+ * */
1710
+ var composedClasses = [];
1711
+ /* *
1712
+ *
1713
+ * Functions
1449
1714
  *
1450
1715
  * */
1716
+ /* eslint-disable valid-jsdoc */
1451
1717
  /**
1452
- * Provides support for broken axes.
1718
+ * Adds support for broken axes.
1453
1719
  * @private
1454
- * @class
1455
1720
  */
1456
- var Additions = /** @class */ (function () {
1457
- /* *
1458
- *
1459
- * Constructors
1460
- *
1461
- * */
1462
- function Additions(axis) {
1463
- this.hasBreaks = false;
1464
- this.axis = axis;
1721
+ function compose(AxisClass, SeriesClass) {
1722
+ if (composedClasses.indexOf(AxisClass) === -1) {
1723
+ composedClasses.push(AxisClass);
1724
+ AxisClass.keepProps.push('brokenAxis');
1725
+ addEvent(AxisClass, 'init', onAxisInit);
1726
+ addEvent(AxisClass, 'afterInit', onAxisAfterInit);
1727
+ addEvent(AxisClass, 'afterSetTickPositions', onAxisAfterSetTickPositions);
1728
+ addEvent(AxisClass, 'afterSetOptions', onAxisAfterSetOptions);
1465
1729
  }
1466
- /* *
1467
- *
1468
- * Static Functions
1469
- *
1470
- * */
1471
- /**
1472
- * @private
1473
- */
1474
- Additions.isInBreak = function (brk, val) {
1475
- var repeat = brk.repeat || Infinity,
1476
- from = brk.from,
1477
- length = brk.to - brk.from,
1478
- test = (val >= from ?
1479
- (val - from) % repeat :
1480
- repeat - ((from - val) % repeat));
1481
- var ret;
1482
- if (!brk.inclusive) {
1483
- ret = test < length && test !== 0;
1484
- }
1485
- else {
1486
- ret = test <= length;
1487
- }
1488
- return ret;
1489
- };
1490
- /**
1491
- * @private
1492
- */
1493
- Additions.lin2Val = function (val) {
1494
- var axis = this;
1495
- var brokenAxis = axis.brokenAxis;
1496
- var breakArray = brokenAxis && brokenAxis.breakArray;
1730
+ if (composedClasses.indexOf(SeriesClass) === -1) {
1731
+ composedClasses.push(SeriesClass);
1732
+ var seriesProto = SeriesClass.prototype;
1733
+ seriesProto.drawBreaks = seriesDrawBreaks;
1734
+ seriesProto.gappedPath = seriesGappedPath;
1735
+ addEvent(SeriesClass, 'afterGeneratePoints', onSeriesAfterGeneratePoints);
1736
+ addEvent(SeriesClass, 'afterRender', onSeriesAfterRender);
1737
+ }
1738
+ return AxisClass;
1739
+ }
1740
+ BrokenAxis.compose = compose;
1741
+ /**
1742
+ * @private
1743
+ */
1744
+ function onAxisAfterInit() {
1745
+ if (typeof this.brokenAxis !== 'undefined') {
1746
+ this.brokenAxis.setBreaks(this.options.breaks, false);
1747
+ }
1748
+ }
1749
+ /**
1750
+ * Force Axis to be not-ordinal when breaks are defined.
1751
+ * @private
1752
+ */
1753
+ function onAxisAfterSetOptions() {
1754
+ var axis = this;
1755
+ if (axis.brokenAxis && axis.brokenAxis.hasBreaks) {
1756
+ axis.options.ordinal = false;
1757
+ }
1758
+ }
1759
+ /**
1760
+ * @private
1761
+ */
1762
+ function onAxisAfterSetTickPositions() {
1763
+ var axis = this,
1764
+ brokenAxis = axis.brokenAxis;
1765
+ if (brokenAxis &&
1766
+ brokenAxis.hasBreaks) {
1767
+ var tickPositions = axis.tickPositions,
1768
+ info = axis.tickPositions.info,
1769
+ newPositions = [];
1770
+ for (var i = 0; i < tickPositions.length; i++) {
1771
+ if (!brokenAxis.isInAnyBreak(tickPositions[i])) {
1772
+ newPositions.push(tickPositions[i]);
1773
+ }
1774
+ }
1775
+ axis.tickPositions = newPositions;
1776
+ axis.tickPositions.info = info;
1777
+ }
1778
+ }
1779
+ /**
1780
+ * @private
1781
+ */
1782
+ function onAxisInit() {
1783
+ var axis = this;
1784
+ if (!axis.brokenAxis) {
1785
+ axis.brokenAxis = new Additions(axis);
1786
+ }
1787
+ }
1788
+ /**
1789
+ * @private
1790
+ */
1791
+ function onSeriesAfterGeneratePoints() {
1792
+ var _a = this,
1793
+ isDirty = _a.isDirty,
1794
+ connectNulls = _a.options.connectNulls,
1795
+ points = _a.points,
1796
+ xAxis = _a.xAxis,
1797
+ yAxis = _a.yAxis;
1798
+ // Set, or reset visibility of the points. Axis.setBreaks marks
1799
+ // the series as isDirty
1800
+ if (isDirty) {
1801
+ var i = points.length;
1802
+ while (i--) {
1803
+ var point = points[i];
1804
+ // Respect nulls inside the break (#4275)
1805
+ var nullGap = point.y === null && connectNulls === false;
1806
+ var isPointInBreak = (!nullGap && ((xAxis &&
1807
+ xAxis.brokenAxis &&
1808
+ xAxis.brokenAxis.isInAnyBreak(point.x,
1809
+ true)) || (yAxis &&
1810
+ yAxis.brokenAxis &&
1811
+ yAxis.brokenAxis.isInAnyBreak(point.y,
1812
+ true))));
1813
+ // Set point.visible if in any break.
1814
+ // If not in break, reset visible to original value.
1815
+ point.visible = isPointInBreak ?
1816
+ false :
1817
+ point.options.visible !== false;
1818
+ }
1819
+ }
1820
+ }
1821
+ /**
1822
+ * @private
1823
+ */
1824
+ function onSeriesAfterRender() {
1825
+ this.drawBreaks(this.xAxis, ['x']);
1826
+ this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
1827
+ }
1828
+ /**
1829
+ * @private
1830
+ */
1831
+ function seriesDrawBreaks(axis, keys) {
1832
+ var series = this,
1833
+ points = series.points;
1834
+ var breaks,
1835
+ threshold,
1836
+ eventName,
1837
+ y;
1838
+ if (axis && // #5950
1839
+ axis.brokenAxis &&
1840
+ axis.brokenAxis.hasBreaks) {
1841
+ var brokenAxis_1 = axis.brokenAxis;
1842
+ keys.forEach(function (key) {
1843
+ breaks = brokenAxis_1 && brokenAxis_1.breakArray || [];
1844
+ threshold = axis.isXAxis ?
1845
+ axis.min :
1846
+ pick(series.options.threshold, axis.min);
1847
+ points.forEach(function (point) {
1848
+ y = pick(point['stack' + key.toUpperCase()], point[key]);
1849
+ breaks.forEach(function (brk) {
1850
+ if (isNumber(threshold) && isNumber(y)) {
1851
+ eventName = false;
1852
+ if ((threshold < brk.from && y > brk.to) ||
1853
+ (threshold > brk.from && y < brk.from)) {
1854
+ eventName = 'pointBreak';
1855
+ }
1856
+ else if ((threshold < brk.from &&
1857
+ y > brk.from &&
1858
+ y < brk.to) || (threshold > brk.from &&
1859
+ y > brk.to &&
1860
+ y < brk.from)) {
1861
+ eventName = 'pointInBreak';
1862
+ }
1863
+ if (eventName) {
1864
+ fireEvent(axis, eventName, { point: point, brk: brk });
1865
+ }
1866
+ }
1867
+ });
1868
+ });
1869
+ });
1870
+ }
1871
+ }
1872
+ /**
1873
+ * Extend getGraphPath by identifying gaps in the data so that we
1874
+ * can draw a gap in the line or area. This was moved from ordinal
1875
+ * axis module to broken axis module as of #5045.
1876
+ *
1877
+ * @private
1878
+ * @function Highcharts.Series#gappedPath
1879
+ *
1880
+ * @return {Highcharts.SVGPathArray}
1881
+ * Gapped path
1882
+ */
1883
+ function seriesGappedPath() {
1884
+ var currentDataGrouping = this.currentDataGrouping,
1885
+ groupingSize = currentDataGrouping && currentDataGrouping.gapSize,
1886
+ points = this.points.slice(),
1887
+ yAxis = this.yAxis;
1888
+ var gapSize = this.options.gapSize,
1889
+ i = points.length - 1,
1890
+ stack;
1891
+ /**
1892
+ * Defines when to display a gap in the graph, together with the
1893
+ * [gapUnit](plotOptions.series.gapUnit) option.
1894
+ *
1895
+ * In case when `dataGrouping` is enabled, points can be grouped
1896
+ * into a larger time span. This can make the grouped points to
1897
+ * have a greater distance than the absolute value of `gapSize`
1898
+ * property, which will result in disappearing graph completely.
1899
+ * To prevent this situation the mentioned distance between
1900
+ * grouped points is used instead of previously defined
1901
+ * `gapSize`.
1902
+ *
1903
+ * In practice, this option is most often used to visualize gaps
1904
+ * in time series. In a stock chart, intraday data is available
1905
+ * for daytime hours, while gaps will appear in nights and
1906
+ * weekends.
1907
+ *
1908
+ * @see [gapUnit](plotOptions.series.gapUnit)
1909
+ * @see [xAxis.breaks](#xAxis.breaks)
1910
+ *
1911
+ * @sample {highstock} stock/plotoptions/series-gapsize/
1912
+ * Setting the gap size to 2 introduces gaps for weekends in
1913
+ * daily datasets.
1914
+ *
1915
+ * @type {number}
1916
+ * @default 0
1917
+ * @product highstock
1918
+ * @requires modules/broken-axis
1919
+ * @apioption plotOptions.series.gapSize
1920
+ */
1921
+ /**
1922
+ * Together with [gapSize](plotOptions.series.gapSize), this
1923
+ * option defines where to draw gaps in the graph.
1924
+ *
1925
+ * When the `gapUnit` is `"relative"` (default), a gap size of 5
1926
+ * means that if the distance between two points is greater than
1927
+ * 5 times that of the two closest points, the graph will be
1928
+ * broken.
1929
+ *
1930
+ * When the `gapUnit` is `"value"`, the gap is based on absolute
1931
+ * axis values, which on a datetime axis is milliseconds. This
1932
+ * also applies to the navigator series that inherits gap
1933
+ * options from the base series.
1934
+ *
1935
+ * @see [gapSize](plotOptions.series.gapSize)
1936
+ *
1937
+ * @type {string}
1938
+ * @default relative
1939
+ * @since 5.0.13
1940
+ * @product highstock
1941
+ * @validvalue ["relative", "value"]
1942
+ * @requires modules/broken-axis
1943
+ * @apioption plotOptions.series.gapUnit
1944
+ */
1945
+ if (gapSize && i > 0) { // #5008
1946
+ // Gap unit is relative
1947
+ if (this.options.gapUnit !== 'value') {
1948
+ gapSize *= this.basePointRange;
1949
+ }
1950
+ // Setting a new gapSize in case dataGrouping is enabled
1951
+ // (#7686)
1952
+ if (groupingSize &&
1953
+ groupingSize > gapSize &&
1954
+ // Except when DG is forced (e.g. from other series)
1955
+ // and has lower granularity than actual points (#11351)
1956
+ groupingSize >= this.basePointRange) {
1957
+ gapSize = groupingSize;
1958
+ }
1959
+ // extension for ordinal breaks
1960
+ var current = void 0,
1961
+ next = void 0;
1962
+ while (i--) {
1963
+ // Reassign next if it is not visible
1964
+ if (!(next && next.visible !== false)) {
1965
+ next = points[i + 1];
1966
+ }
1967
+ current = points[i];
1968
+ // Skip iteration if one of the points is not visible
1969
+ if (next.visible === false || current.visible === false) {
1970
+ continue;
1971
+ }
1972
+ if (next.x - current.x > gapSize) {
1973
+ var xRange = (current.x + next.x) / 2;
1974
+ points.splice(// insert after this one
1975
+ i + 1, 0, {
1976
+ isNull: true,
1977
+ x: xRange
1978
+ });
1979
+ // For stacked chart generate empty stack items, #6546
1980
+ if (yAxis.stacking && this.options.stacking) {
1981
+ stack = yAxis.stacking.stacks[this.stackKey][xRange] = new StackItem(yAxis, yAxis.options.stackLabels, false, xRange, this.stack);
1982
+ stack.total = 0;
1983
+ }
1984
+ }
1985
+ // Assign current to next for the upcoming iteration
1986
+ next = current;
1987
+ }
1988
+ }
1989
+ // Call base method
1990
+ return this.getGraphPath(points);
1991
+ }
1992
+ /* *
1993
+ *
1994
+ * Class
1995
+ *
1996
+ * */
1997
+ /**
1998
+ * Provides support for broken axes.
1999
+ * @private
2000
+ * @class
2001
+ */
2002
+ var Additions = /** @class */ (function () {
2003
+ /* *
2004
+ *
2005
+ * Constructors
2006
+ *
2007
+ * */
2008
+ function Additions(axis) {
2009
+ this.hasBreaks = false;
2010
+ this.axis = axis;
2011
+ }
2012
+ /* *
2013
+ *
2014
+ * Static Functions
2015
+ *
2016
+ * */
2017
+ /**
2018
+ * @private
2019
+ */
2020
+ Additions.isInBreak = function (brk, val) {
2021
+ var repeat = brk.repeat || Infinity,
2022
+ from = brk.from,
2023
+ length = brk.to - brk.from,
2024
+ test = (val >= from ?
2025
+ (val - from) % repeat :
2026
+ repeat - ((from - val) % repeat));
2027
+ var ret;
2028
+ if (!brk.inclusive) {
2029
+ ret = test < length && test !== 0;
2030
+ }
2031
+ else {
2032
+ ret = test <= length;
2033
+ }
2034
+ return ret;
2035
+ };
2036
+ /**
2037
+ * @private
2038
+ */
2039
+ Additions.lin2Val = function (val) {
2040
+ var axis = this;
2041
+ var brokenAxis = axis.brokenAxis;
2042
+ var breakArray = brokenAxis && brokenAxis.breakArray;
1497
2043
  if (!breakArray || !isNumber(val)) {
1498
2044
  return val;
1499
2045
  }
@@ -1669,10 +2215,12 @@
1669
2215
  repeat_1 = brk.repeat || Infinity;
1670
2216
  if (isNumber(min_1) && isNumber(max_1)) {
1671
2217
  if (Additions.isInBreak(brk, min_1)) {
1672
- min_1 += (brk.to % repeat_1) - (min_1 % repeat_1);
2218
+ min_1 += ((brk.to % repeat_1) -
2219
+ (min_1 % repeat_1));
1673
2220
  }
1674
2221
  if (Additions.isInBreak(brk, max_1)) {
1675
- max_1 -= (max_1 % repeat_1) - (brk.from % repeat_1);
2222
+ max_1 -= ((max_1 % repeat_1) -
2223
+ (brk.from % repeat_1));
1676
2224
  }
1677
2225
  }
1678
2226
  });
@@ -1720,13 +2268,17 @@
1720
2268
  to: brk.value,
1721
2269
  len: brk.value - start_1 - (brk.size || 0)
1722
2270
  });
1723
- length_1 += brk.value - start_1 - (brk.size || 0);
2271
+ length_1 += (brk.value -
2272
+ start_1 -
2273
+ (brk.size || 0));
1724
2274
  }
1725
2275
  });
1726
2276
  brokenAxis.breakArray = breakArray_1;
1727
2277
  // Used with staticScale, and below the actual axis
1728
2278
  // length, when breaks are substracted.
1729
- if (isNumber(min_1) && isNumber(max_1) && isNumber(axis.min)) {
2279
+ if (isNumber(min_1) &&
2280
+ isNumber(max_1) &&
2281
+ isNumber(axis.min)) {
1730
2282
  brokenAxis.unitLength = max_1 - min_1 - length_1 +
1731
2283
  pointRangePadding;
1732
2284
  fireEvent(axis, 'afterBreaks');
@@ -1894,8 +2446,18 @@
1894
2446
  arr[arr.length - 1] :
1895
2447
  (arr.hasNulls ? null : void 0);
1896
2448
  },
1897
- // ohlc and range are special cases where a multidimensional array is
1898
- // input and an array is output
2449
+ // HLC, OHLC and range are special cases where a multidimensional array is
2450
+ // input and an array is output.
2451
+ hlc: function (high, low, close) {
2452
+ high = approximations.high(high);
2453
+ low = approximations.low(low);
2454
+ close = approximations.close(close);
2455
+ if (isNumber(high) ||
2456
+ isNumber(low) ||
2457
+ isNumber(close)) {
2458
+ return [high, low, close];
2459
+ }
2460
+ },
1899
2461
  ohlc: function (open, high, low, close) {
1900
2462
  open = approximations.open(open);
1901
2463
  high = approximations.high(high);
@@ -1907,7 +2469,6 @@
1907
2469
  isNumber(close)) {
1908
2470
  return [open, high, low, close];
1909
2471
  }
1910
- // else, return is undefined
1911
2472
  },
1912
2473
  range: function (low, high) {
1913
2474
  low = approximations.low(low);
@@ -1921,7 +2482,7 @@
1921
2482
  // else, return is undefined
1922
2483
  }
1923
2484
  };
1924
- var applyGrouping = function () {
2485
+ var applyGrouping = function (hasExtemesChanged) {
1925
2486
  var series = this,
1926
2487
  chart = series.chart,
1927
2488
  options = series.options,
@@ -1940,9 +2501,9 @@
1940
2501
  if (groupingEnabled && !series.requireSorting) {
1941
2502
  series.requireSorting = revertRequireSorting = true;
1942
2503
  }
1943
- // Skip if processData returns false or if grouping is disabled (in that
1944
- // order)
1945
- skip = skipDataGrouping(series) || !groupingEnabled;
2504
+ // Skip if skipDataGrouping method returns false or if grouping is disabled
2505
+ // (in that order).
2506
+ skip = skipDataGrouping(series, hasExtemesChanged) === false || !groupingEnabled;
1946
2507
  // Revert original requireSorting value if changed
1947
2508
  if (revertRequireSorting) {
1948
2509
  series.requireSorting = false;
@@ -2000,13 +2561,17 @@
2000
2561
  groupedXData = groupedData.groupedXData,
2001
2562
  groupedYData = groupedData.groupedYData,
2002
2563
  gapSize = 0;
2003
- // The smoothed option is deprecated, instead,
2004
- // there is a fallback to the new anchoring mechanism. #12455.
2005
- if (dataGroupingOptions && dataGroupingOptions.smoothed && groupedXData.length) {
2564
+ // The smoothed option is deprecated, instead, there is a fallback
2565
+ // to the new anchoring mechanism. #12455.
2566
+ if (dataGroupingOptions &&
2567
+ dataGroupingOptions.smoothed &&
2568
+ groupedXData.length) {
2006
2569
  dataGroupingOptions.firstAnchor = 'firstPoint';
2007
2570
  dataGroupingOptions.anchor = 'middle';
2008
2571
  dataGroupingOptions.lastAnchor = 'lastPoint';
2009
- error(32, false, chart, { 'dataGrouping.smoothed': 'use dataGrouping.anchor' });
2572
+ error(32, false, chart, {
2573
+ 'dataGrouping.smoothed': 'use dataGrouping.anchor'
2574
+ });
2010
2575
  }
2011
2576
  anchorPoints(series, groupedXData, xMax);
2012
2577
  // Record what data grouping values were used
@@ -2053,13 +2618,13 @@
2053
2618
  (currentDataGrouping && currentDataGrouping.totalRange);
2054
2619
  }
2055
2620
  };
2056
- var skipDataGrouping = function (series) {
2057
- if (series.isCartesian &&
2621
+ var skipDataGrouping = function (series,
2622
+ force) {
2623
+ return !(series.isCartesian &&
2058
2624
  !series.isDirty &&
2059
2625
  !series.xAxis.isDirty &&
2060
- !series.yAxis.isDirty) {
2061
- return false;
2062
- }
2626
+ !series.yAxis.isDirty &&
2627
+ !force);
2063
2628
  };
2064
2629
  var groupData = function (xData,
2065
2630
  yData,
@@ -2083,7 +2648,8 @@
2083
2648
  pointArrayMap = series.pointArrayMap,
2084
2649
  pointArrayMapLength = pointArrayMap && pointArrayMap.length,
2085
2650
  extendedPointArrayMap = ['x'].concat(pointArrayMap || ['y']),
2086
- groupAll = this.options.dataGrouping && this.options.dataGrouping.groupAll,
2651
+ groupAll = (this.options.dataGrouping &&
2652
+ this.options.dataGrouping.groupAll),
2087
2653
  pos = 0,
2088
2654
  start = 0,
2089
2655
  valuesLen,
@@ -2213,7 +2779,7 @@
2213
2779
  xMax) {
2214
2780
  var options = series.options,
2215
2781
  dataGroupingOptions = options.dataGrouping,
2216
- totalRange = series.currentDataGrouping && series.currentDataGrouping.gapSize;
2782
+ totalRange = (series.currentDataGrouping && series.currentDataGrouping.gapSize);
2217
2783
  var i;
2218
2784
  // DataGrouping x-coordinates.
2219
2785
  if (dataGroupingOptions && series.xData && totalRange && series.groupMap) {
@@ -2225,9 +2791,9 @@
2225
2791
  anchor);
2226
2792
  // Anchor points that are not extremes.
2227
2793
  if (anchor && anchor !== 'start') {
2228
- var shiftInterval = totalRange *
2794
+ var shiftInterval = (totalRange *
2229
2795
  { middle: 0.5,
2230
- end: 1 }[anchor];
2796
+ end: 1 }[anchor]);
2231
2797
  i = groupedXData.length - 1;
2232
2798
  while (i-- && i > 0) {
2233
2799
  groupedXData[i] += shiftInterval;
@@ -2373,7 +2939,10 @@
2373
2939
  ohlc: {
2374
2940
  groupPixelWidth: 5
2375
2941
  },
2376
- // Move to HeikinAshiSeries.ts aftre refactoring data grouping.
2942
+ hlc: {
2943
+ groupPixelWidth: 5
2944
+ // Move to HeikinAshiSeries.ts aftre refactoring data grouping.
2945
+ },
2377
2946
  heikinashi: {
2378
2947
  groupPixelWidth: 10
2379
2948
  }
@@ -2416,6 +2985,9 @@
2416
2985
  if (this.is('ohlc')) {
2417
2986
  return 'ohlc';
2418
2987
  }
2988
+ if (this.is('hlc')) {
2989
+ return 'hlc';
2990
+ }
2419
2991
  if (this.is('column')) {
2420
2992
  return 'sum';
2421
2993
  }
@@ -2481,19 +3053,20 @@
2481
3053
  *
2482
3054
  * @function Highcharts.Axis#applyGrouping
2483
3055
  */
2484
- Axis.prototype.applyGrouping = function () {
3056
+ Axis.prototype.applyGrouping = function (e) {
2485
3057
  var axis = this,
2486
3058
  series = axis.series;
2487
3059
  series.forEach(function (series) {
2488
3060
  // Reset the groupPixelWidth, then calculate if needed.
2489
3061
  series.groupPixelWidth = void 0; // #2110
2490
- series.groupPixelWidth = axis.getGroupPixelWidth && axis.getGroupPixelWidth();
3062
+ series.groupPixelWidth = (axis.getGroupPixelWidth &&
3063
+ axis.getGroupPixelWidth());
2491
3064
  if (series.groupPixelWidth) {
2492
3065
  series.hasProcessed = true; // #2692
2493
3066
  }
2494
3067
  // Fire independing on series.groupPixelWidth to always set a proper
2495
3068
  // dataGrouping state, (#16238)
2496
- series.applyGrouping();
3069
+ series.applyGrouping(!!e.hasExtemesChanged);
2497
3070
  });
2498
3071
  };
2499
3072
  // Get the data grouping pixel width based on the greatest defined individual
@@ -2526,8 +3099,8 @@
2526
3099
  // Execute grouping if the amount of points is greater than the
2527
3100
  // limit defined in groupPixelWidth
2528
3101
  if (series[i].groupPixelWidth ||
2529
- dataLength >
2530
- (this.chart.plotSizeX / groupPixelWidth) ||
3102
+ (dataLength >
3103
+ (this.chart.plotSizeX / groupPixelWidth)) ||
2531
3104
  (dataLength && dgOptions.forced)) {
2532
3105
  doGrouping = true;
2533
3106
  }
@@ -2668,10 +3241,10 @@
2668
3241
  type = this.type,
2669
3242
  plotOptions = this.chart.options.plotOptions,
2670
3243
  defaultOptions = D.defaultOptions.plotOptions[type].dataGrouping,
2671
- // External series, for example technical indicators should also
2672
- // inherit commonOptions which are not available outside this module
2673
- baseOptions = this.useCommonDataGrouping && commonOptions;
2674
- if (specificOptions[type] || baseOptions) { // #1284
3244
+ // External series, for example technical indicators should also inherit
3245
+ // commonOptions which are not available outside this module
3246
+ baseOptions = (this.useCommonDataGrouping && commonOptions);
3247
+ if (plotOptions && (specificOptions[type] || baseOptions)) { // #1284
2675
3248
  if (!defaultOptions) {
2676
3249
  defaultOptions = merge(commonOptions, specificOptions[type]);
2677
3250
  }
@@ -2765,7 +3338,7 @@
2765
3338
  * from the raw data.
2766
3339
  *
2767
3340
  * Defaults to `average` for line-type series, `sum` for columns, `range`
2768
- * for range series and `ohlc` for OHLC and candlestick.
3341
+ * for range series, `hlc` for HLC, and `ohlc` for OHLC and candlestick.
2769
3342
  *
2770
3343
  * @sample {highstock} stock/plotoptions/series-datagrouping-approximation
2771
3344
  * Approximation callback with custom data
@@ -2804,7 +3377,7 @@
2804
3377
  * to two weeks, the second and third item of the week array are used,
2805
3378
  * and applied to the start and end date of the time span.
2806
3379
  *
2807
- * @type {object}
3380
+ * @type {Object}
2808
3381
  * @apioption plotOptions.series.dataGrouping.dateTimeLabelFormats
2809
3382
  */
2810
3383
  /**
@@ -2881,113 +3454,567 @@
2881
3454
  * @sample {highstock} stock/plotoptions/series-datagrouping-groupall/
2882
3455
  * Two series with the same data but different groupAll setting
2883
3456
  *
2884
- * @type {boolean}
2885
- * @default false
2886
- * @since 6.1.0
2887
- * @apioption plotOptions.series.dataGrouping.groupAll
2888
- */
2889
- /**
2890
- * Specifies how the last grouped point is positioned on the xAxis.
2891
- * If firstAnchor and/or lastAnchor are defined, then those options take
2892
- * precedence over anchor for the first and/or last grouped points.
2893
- * Available options:
3457
+ * @type {boolean}
3458
+ * @default false
3459
+ * @since 6.1.0
3460
+ * @apioption plotOptions.series.dataGrouping.groupAll
3461
+ */
3462
+ /**
3463
+ * Specifies how the last grouped point is positioned on the xAxis.
3464
+ * If firstAnchor and/or lastAnchor are defined, then those options take
3465
+ * precedence over anchor for the first and/or last grouped points.
3466
+ * Available options:
3467
+ *
3468
+ * -`start` places the point at the beginning of the group
3469
+ * (e.g. range 00:00:00 - 23:59:59 -> 00:00:00)
3470
+ *
3471
+ * -`middle` places the point in the middle of the group
3472
+ * (e.g. range 00:00:00 - 23:59:59 -> 12:00:00)
3473
+ *
3474
+ * -`end` places the point at the end of the group
3475
+ * (e.g. range 00:00:00 - 23:59:59 -> 23:59:59)
3476
+ *
3477
+ * -`firstPoint` the first point in the group
3478
+ * (e.g. points at 00:13, 00:35, 00:59 -> 00:13)
3479
+ *
3480
+ * -`lastPoint` the last point in the group
3481
+ * (e.g. points at 00:13, 00:35, 00:59 -> 00:59)
3482
+ *
3483
+ * @sample {highstock} stock/plotoptions/series-datagrouping-first-anchor
3484
+ * Applying first and last anchor.
3485
+ *
3486
+ * @sample {highstock} stock/plotoptions/series-datagrouping-last-anchor
3487
+ * Applying the last anchor in the chart with live data.
3488
+ *
3489
+ * @see [dataGrouping.anchor](#plotOptions.series.dataGrouping.anchor)
3490
+ *
3491
+ * @type {Highcharts.DataGroupingAnchorExtremes}
3492
+ * @since 9.1.0
3493
+ * @default start
3494
+ * @apioption plotOptions.series.dataGrouping.lastAnchor
3495
+ */
3496
+ /**
3497
+ * Normally, a group is indexed by the start of that group, so for example
3498
+ * when 30 daily values are grouped into one month, that month's x value
3499
+ * will be the 1st of the month. This apparently shifts the data to
3500
+ * the left. When the smoothed option is true, this is compensated for.
3501
+ * The data is shifted to the middle of the group, and min and max
3502
+ * values are preserved. Internally, this is used in the Navigator series.
3503
+ *
3504
+ * @type {boolean}
3505
+ * @default false
3506
+ * @deprecated
3507
+ * @apioption plotOptions.series.dataGrouping.smoothed
3508
+ */
3509
+ /**
3510
+ * An array determining what time intervals the data is allowed to be
3511
+ * grouped to. Each array item is an array where the first value is
3512
+ * the time unit and the second value another array of allowed multiples.
3513
+ *
3514
+ * Defaults to:
3515
+ * ```js
3516
+ * units: [[
3517
+ * 'millisecond', // unit name
3518
+ * [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
3519
+ * ], [
3520
+ * 'second',
3521
+ * [1, 2, 5, 10, 15, 30]
3522
+ * ], [
3523
+ * 'minute',
3524
+ * [1, 2, 5, 10, 15, 30]
3525
+ * ], [
3526
+ * 'hour',
3527
+ * [1, 2, 3, 4, 6, 8, 12]
3528
+ * ], [
3529
+ * 'day',
3530
+ * [1]
3531
+ * ], [
3532
+ * 'week',
3533
+ * [1]
3534
+ * ], [
3535
+ * 'month',
3536
+ * [1, 3, 6]
3537
+ * ], [
3538
+ * 'year',
3539
+ * null
3540
+ * ]]
3541
+ * ```
3542
+ *
3543
+ * @type {Array<Array<string,(Array<number>|null)>>}
3544
+ * @apioption plotOptions.series.dataGrouping.units
3545
+ */
3546
+ /**
3547
+ * The approximate pixel width of each group. If for example a series
3548
+ * with 30 points is displayed over a 600 pixel wide plot area, no grouping
3549
+ * is performed. If however the series contains so many points that
3550
+ * the spacing is less than the groupPixelWidth, Highcharts will try
3551
+ * to group it into appropriate groups so that each is more or less
3552
+ * two pixels wide. Defaults to `10`.
3553
+ *
3554
+ * @sample {highstock} stock/plotoptions/series-datagrouping-grouppixelwidth/
3555
+ * Two series with the same data density but different groupPixelWidth
3556
+ *
3557
+ * @type {number}
3558
+ * @default 10
3559
+ * @apioption plotOptions.column.dataGrouping.groupPixelWidth
3560
+ */
3561
+ ''; // required by JSDoc parsing
3562
+
3563
+ return dataGrouping;
3564
+ });
3565
+ _registerModule(_modules, 'Series/HLC/HLCPoint.js', [_modules['Core/Series/SeriesRegistry.js']], function (SeriesRegistry) {
3566
+ /* *
3567
+ *
3568
+ * (c) 2010-2021 Pawel Lysy
3569
+ *
3570
+ * License: www.highcharts.com/license
3571
+ *
3572
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
3573
+ *
3574
+ * */
3575
+ var __extends = (this && this.__extends) || (function () {
3576
+ var extendStatics = function (d,
3577
+ b) {
3578
+ extendStatics = Object.setPrototypeOf ||
3579
+ ({ __proto__: [] } instanceof Array && function (d,
3580
+ b) { d.__proto__ = b; }) ||
3581
+ function (d,
3582
+ b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3583
+ return extendStatics(d, b);
3584
+ };
3585
+ return function (d, b) {
3586
+ extendStatics(d, b);
3587
+ function __() { this.constructor = d; }
3588
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3589
+ };
3590
+ })();
3591
+ var ColumnSeries = SeriesRegistry.seriesTypes.column;
3592
+ /* *
3593
+ *
3594
+ * Class
3595
+ *
3596
+ * */
3597
+ var HLCPoint = /** @class */ (function (_super) {
3598
+ __extends(HLCPoint, _super);
3599
+ function HLCPoint() {
3600
+ /* *
3601
+ *
3602
+ * Properties
3603
+ *
3604
+ * */
3605
+ var _this = _super !== null && _super.apply(this,
3606
+ arguments) || this;
3607
+ _this.close = void 0;
3608
+ _this.high = void 0;
3609
+ _this.low = void 0;
3610
+ _this.options = void 0;
3611
+ _this.plotClose = void 0;
3612
+ _this.series = void 0;
3613
+ return _this;
3614
+ }
3615
+ return HLCPoint;
3616
+ }(ColumnSeries.prototype.pointClass));
3617
+ /* *
3618
+ *
3619
+ * Default Export
2894
3620
  *
2895
- * -`start` places the point at the beginning of the group
2896
- * (e.g. range 00:00:00 - 23:59:59 -> 00:00:00)
3621
+ * */
3622
+
3623
+ return HLCPoint;
3624
+ });
3625
+ _registerModule(_modules, 'Series/HLC/HLCSeries.js', [_modules['Series/HLC/HLCPoint.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (HLCPoint, SeriesRegistry, U) {
3626
+ /* *
2897
3627
  *
2898
- * -`middle` places the point in the middle of the group
2899
- * (e.g. range 00:00:00 - 23:59:59 -> 12:00:00)
3628
+ * (c) 2010-2021 Pawel Lysy
2900
3629
  *
2901
- * -`end` places the point at the end of the group
2902
- * (e.g. range 00:00:00 - 23:59:59 -> 23:59:59)
3630
+ * License: www.highcharts.com/license
2903
3631
  *
2904
- * -`firstPoint` the first point in the group
2905
- * (e.g. points at 00:13, 00:35, 00:59 -> 00:13)
3632
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2906
3633
  *
2907
- * -`lastPoint` the last point in the group
2908
- * (e.g. points at 00:13, 00:35, 00:59 -> 00:59)
3634
+ * */
3635
+ var __extends = (this && this.__extends) || (function () {
3636
+ var extendStatics = function (d,
3637
+ b) {
3638
+ extendStatics = Object.setPrototypeOf ||
3639
+ ({ __proto__: [] } instanceof Array && function (d,
3640
+ b) { d.__proto__ = b; }) ||
3641
+ function (d,
3642
+ b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3643
+ return extendStatics(d, b);
3644
+ };
3645
+ return function (d, b) {
3646
+ extendStatics(d, b);
3647
+ function __() { this.constructor = d; }
3648
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3649
+ };
3650
+ })();
3651
+ var ColumnSeries = SeriesRegistry.seriesTypes.column;
3652
+ var extend = U.extend,
3653
+ merge = U.merge;
3654
+ /* *
2909
3655
  *
2910
- * @sample {highstock} stock/plotoptions/series-datagrouping-first-anchor
2911
- * Applying first and last anchor.
3656
+ * Class
2912
3657
  *
2913
- * @sample {highstock} stock/plotoptions/series-datagrouping-last-anchor
2914
- * Applying the last anchor in the chart with live data.
3658
+ * */
3659
+ /**
3660
+ * The hlc series type.
2915
3661
  *
2916
- * @see [dataGrouping.anchor](#plotOptions.series.dataGrouping.anchor)
3662
+ * @private
3663
+ * @class
3664
+ * @name Highcharts.seriesTypes.hlc
2917
3665
  *
2918
- * @type {Highcharts.DataGroupingAnchorExtremes}
2919
- * @since 9.1.0
2920
- * @default start
2921
- * @apioption plotOptions.series.dataGrouping.lastAnchor
3666
+ * @augments Highcharts.Series
2922
3667
  */
2923
- /**
2924
- * Normally, a group is indexed by the start of that group, so for example
2925
- * when 30 daily values are grouped into one month, that month's x value
2926
- * will be the 1st of the month. This apparently shifts the data to
2927
- * the left. When the smoothed option is true, this is compensated for.
2928
- * The data is shifted to the middle of the group, and min and max
2929
- * values are preserved. Internally, this is used in the Navigator series.
3668
+ var HLCSeries = /** @class */ (function (_super) {
3669
+ __extends(HLCSeries, _super);
3670
+ function HLCSeries() {
3671
+ /* *
3672
+ *
3673
+ * Static Properties
3674
+ *
3675
+ * */
3676
+ var _this = _super !== null && _super.apply(this,
3677
+ arguments) || this;
3678
+ /* *
3679
+ *
3680
+ * Properties
3681
+ *
3682
+ * */
3683
+ _this.data = void 0;
3684
+ _this.options = void 0;
3685
+ _this.points = void 0;
3686
+ _this.yData = void 0;
3687
+ return _this;
3688
+ /* eslint-enable valid-jsdoc */
3689
+ }
3690
+ /* *
3691
+ *
3692
+ * Functions
3693
+ *
3694
+ * */
3695
+ /* eslint-disable valid-jsdoc */
3696
+ /**
3697
+ * Extend the path if close is not between high and low.
3698
+ *
3699
+ * @param {SVGPath} path the path array of the point
3700
+ * @param {number} halfStrokeWidth
3701
+ * @param {number} value value of the point to which the stem should be extended
3702
+ */
3703
+ HLCSeries.prototype.extendStem = function (path, halfStrokeWidth, value) {
3704
+ var start = path[0];
3705
+ var end = path[1];
3706
+ // We don't need to worry about crisp - close value
3707
+ // is already crisped and halfStrokeWidth should remove it.
3708
+ if (typeof start[2] === 'number') {
3709
+ start[2] = Math.max(value + halfStrokeWidth, start[2]);
3710
+ }
3711
+ if (typeof end[2] === 'number') {
3712
+ end[2] = Math.min(value - halfStrokeWidth, end[2]);
3713
+ }
3714
+ };
3715
+ /**
3716
+ * Function to create SVGPath of the point based on the
3717
+ * plot positions of this point.
3718
+ * @private
3719
+ */
3720
+ HLCSeries.prototype.getPointPath = function (point, graphic) {
3721
+ // crisp vector coordinates
3722
+ var strokeWidth = graphic.strokeWidth(),
3723
+ series = point.series,
3724
+ crispCorr = (strokeWidth % 2) / 2,
3725
+ // #2596:
3726
+ crispX = Math.round(point.plotX) - crispCorr,
3727
+ halfWidth = Math.round(point.shapeArgs.width / 2);
3728
+ var path,
3729
+ plotClose = point.plotClose;
3730
+ // the vertical stem
3731
+ path = [
3732
+ ['M', crispX, Math.round(point.yBottom)],
3733
+ ['L', crispX, Math.round(point.plotHigh)]
3734
+ ];
3735
+ // close
3736
+ if (point.close !== null) {
3737
+ plotClose = Math.round(point.plotClose) + crispCorr;
3738
+ path.push(['M', crispX, plotClose], ['L', crispX + halfWidth, plotClose]);
3739
+ series.extendStem(path, strokeWidth / 2, plotClose);
3740
+ }
3741
+ return path;
3742
+ };
3743
+ /**
3744
+ * Draw single point
3745
+ * @private
3746
+ */
3747
+ HLCSeries.prototype.drawSinglePoint = function (point) {
3748
+ var series = point.series,
3749
+ chart = series.chart;
3750
+ var path,
3751
+ graphic = point.graphic,
3752
+ isNew = !graphic;
3753
+ if (typeof point.plotY !== 'undefined') {
3754
+ // Create and/or update the graphic
3755
+ if (!graphic) {
3756
+ point.graphic = graphic = chart.renderer.path()
3757
+ .add(series.group);
3758
+ }
3759
+ if (!chart.styledMode) {
3760
+ graphic.attr(series.pointAttribs(point, (point.selected && 'select'))); // #3897
3761
+ }
3762
+ // crisp vector coordinates
3763
+ path = series.getPointPath(point, graphic);
3764
+ graphic[isNew ? 'attr' : 'animate']({ d: path })
3765
+ .addClass(point.getClassName(), true);
3766
+ }
3767
+ };
3768
+ /**
3769
+ * Draw the data points
3770
+ * @private
3771
+ */
3772
+ HLCSeries.prototype.drawPoints = function () {
3773
+ this.points.forEach(this.drawSinglePoint);
3774
+ };
3775
+ /**
3776
+ * @private
3777
+ * @function Highcharts.seriesTypes.hlc#init
3778
+ */
3779
+ HLCSeries.prototype.init = function () {
3780
+ _super.prototype.init.apply(this, arguments);
3781
+ this.options.stacking = void 0; // #8817
3782
+ };
3783
+ /**
3784
+ * Postprocess mapping between options and SVG attributes
3785
+ * @private
3786
+ */
3787
+ HLCSeries.prototype.pointAttribs = function (point, state) {
3788
+ var attribs = _super.prototype.pointAttribs.call(this,
3789
+ point,
3790
+ state);
3791
+ delete attribs.fill;
3792
+ return attribs;
3793
+ };
3794
+ HLCSeries.prototype.toYData = function (point) {
3795
+ // return a plain array for speedy calculation
3796
+ return [point.high, point.low, point.close];
3797
+ };
3798
+ /**
3799
+ * Translate data points from raw values x and y to plotX and plotY
3800
+ *
3801
+ * @private
3802
+ * @function Highcharts.seriesTypes.hlc#translate
3803
+ */
3804
+ HLCSeries.prototype.translate = function () {
3805
+ var series = this,
3806
+ yAxis = series.yAxis,
3807
+ names = (this.pointArrayMap && this.pointArrayMap.slice()) || [],
3808
+ translated = names.map(function (name) {
3809
+ return "plot" + (name.charAt(0).toUpperCase() + name.slice(1));
3810
+ });
3811
+ translated.push('yBottom');
3812
+ names.push('low');
3813
+ _super.prototype.translate.apply(series);
3814
+ // Do the translation
3815
+ series.points.forEach(function (point) {
3816
+ names.forEach(function (name, i) {
3817
+ var value = point[name];
3818
+ if (value !== null) {
3819
+ if (series.dataModify) {
3820
+ value = series.dataModify.modifyValue(value);
3821
+ }
3822
+ point[translated[i]] =
3823
+ yAxis.toPixels(value, true);
3824
+ }
3825
+ });
3826
+ // Align the tooltip to the high value to avoid covering the
3827
+ // point
3828
+ point.tooltipPos[1] =
3829
+ point.plotHigh + yAxis.pos - series.chart.plotTop;
3830
+ });
3831
+ };
3832
+ /**
3833
+ * An HLC chart is a style of financial chart used to describe price
3834
+ * movements over time. It displays high, low and close values per
3835
+ * data point.
3836
+ *
3837
+ * @sample stock/demo/hlc/
3838
+ * HLC chart
3839
+ *
3840
+ * @extends plotOptions.column
3841
+ * @excluding borderColor, borderRadius, borderWidth, crisp, stacking,
3842
+ * stack
3843
+ * @product highstock
3844
+ * @optionparent plotOptions.hlc
3845
+ */
3846
+ HLCSeries.defaultOptions = merge(ColumnSeries.defaultOptions, {
3847
+ /**
3848
+ * The approximate pixel width of each group. If for example a series
3849
+ * with 30 points is displayed over a 600 pixel wide plot area, no
3850
+ * grouping is performed. If however the series contains so many points
3851
+ * that the spacing is less than the groupPixelWidth, Highcharts will
3852
+ * try to group it into appropriate groups so that each is more or less
3853
+ * two pixels wide. Defaults to `5`.
3854
+ *
3855
+ * @type {number}
3856
+ * @default 5
3857
+ * @product highstock
3858
+ * @apioption plotOptions.hlc.dataGrouping.groupPixelWidth
3859
+ */
3860
+ /**
3861
+ * @type {Highcharts.DataGroupingApproximationValue|Function}
3862
+ * @default hlc
3863
+ * @product highstock
3864
+ * @apioption plotOptions.hlc.dataGrouping.approximation
3865
+ */
3866
+ /**
3867
+ * @default close
3868
+ * @apioption plotOptions.hlc.colorKey
3869
+ */
3870
+ /**
3871
+ * The pixel width of the line/border. Defaults to `1`.
3872
+ *
3873
+ * @sample {highstock} stock/plotoptions/hlc-linewidth/
3874
+ * A greater line width
3875
+ *
3876
+ * @type {number}
3877
+ * @default 1
3878
+ * @product highstock
3879
+ *
3880
+ * @public
3881
+ */
3882
+ lineWidth: 1,
3883
+ tooltip: {
3884
+ pointFormat: '<span style="color:{point.color}">\u25CF</span> ' +
3885
+ '<b> {series.name}</b><br/>' +
3886
+ 'High: {point.high}<br/>' +
3887
+ 'Low: {point.low}<br/>' +
3888
+ 'Close: {point.close}<br/>'
3889
+ },
3890
+ threshold: null,
3891
+ states: {
3892
+ /**
3893
+ * @extends plotOptions.column.states.hover
3894
+ * @product highstock
3895
+ */
3896
+ hover: {
3897
+ /**
3898
+ * The pixel width of the line representing the HLC point.
3899
+ *
3900
+ * @type {number}
3901
+ * @default 3
3902
+ * @product highstock
3903
+ */
3904
+ lineWidth: 3
3905
+ }
3906
+ },
3907
+ /**
3908
+ * Determines which one of `high`, `low`, `close` values should
3909
+ * be represented as `point.y`, which is later used to set dataLabel
3910
+ * position and [compare](#plotOptions.series.compare).
3911
+ *
3912
+ * @sample {highstock} stock/plotoptions/hlc-pointvalkey/
3913
+ * Possible values
3914
+ *
3915
+ * @type {string}
3916
+ * @default close
3917
+ * @validvalue ["high", "low", "close"]
3918
+ * @product highstock
3919
+ * @apioption plotOptions.hlc.pointValKey
3920
+ */
3921
+ /**
3922
+ * @default close
3923
+ * @apioption plotOptions.hlc.colorKey
3924
+ */
3925
+ stickyTracking: true
3926
+ });
3927
+ return HLCSeries;
3928
+ }(ColumnSeries));
3929
+ extend(HLCSeries.prototype, {
3930
+ animate: null,
3931
+ directTouch: false,
3932
+ pointArrayMap: ['high', 'low', 'close'],
3933
+ pointAttrToOptions: {
3934
+ stroke: 'color',
3935
+ 'stroke-width': 'lineWidth'
3936
+ },
3937
+ pointValKey: 'close'
3938
+ });
3939
+ HLCSeries.prototype.pointClass = HLCPoint;
3940
+ SeriesRegistry.registerSeriesType('hlc', HLCSeries);
3941
+ /* *
3942
+ *
3943
+ * Default Export
3944
+ *
3945
+ * */
3946
+ /* *
3947
+ *
3948
+ * API Options
2930
3949
  *
2931
- * @type {boolean}
2932
- * @default false
2933
- * @deprecated
2934
- * @apioption plotOptions.series.dataGrouping.smoothed
3950
+ * */
3951
+ /**
3952
+ * A `hlc` series. If the [type](#series.hlc.type) option is not
3953
+ * specified, it is inherited from [chart.type](#chart.type).
3954
+ *
3955
+ * @extends series,plotOptions.hlc
3956
+ * @excluding dataParser, dataURL
3957
+ * @product highstock
3958
+ * @apioption series.hlc
2935
3959
  */
2936
3960
  /**
2937
- * An array determining what time intervals the data is allowed to be
2938
- * grouped to. Each array item is an array where the first value is
2939
- * the time unit and the second value another array of allowed multiples.
3961
+ * An array of data points for the series. For the `hlc` series type,
3962
+ * points can be given in the following ways:
2940
3963
  *
2941
- * Defaults to:
2942
- * ```js
2943
- * units: [[
2944
- * 'millisecond', // unit name
2945
- * [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
2946
- * ], [
2947
- * 'second',
2948
- * [1, 2, 5, 10, 15, 30]
2949
- * ], [
2950
- * 'minute',
2951
- * [1, 2, 5, 10, 15, 30]
2952
- * ], [
2953
- * 'hour',
2954
- * [1, 2, 3, 4, 6, 8, 12]
2955
- * ], [
2956
- * 'day',
2957
- * [1]
2958
- * ], [
2959
- * 'week',
2960
- * [1]
2961
- * ], [
2962
- * 'month',
2963
- * [1, 3, 6]
2964
- * ], [
2965
- * 'year',
2966
- * null
2967
- * ]]
2968
- * ```
3964
+ * 1. An array of arrays with 4 or 3 values. In this case, the values correspond
3965
+ * to `x,high,low,close`. If the first value is a string, it is applied
3966
+ * as the name of the point, and the `x` value is inferred. The `x` value can
3967
+ * also be omitted, in which case the inner arrays should be of length of 3\.
3968
+ * Then the `x` value is automatically calculated, either starting at 0 and
3969
+ * incremented by 1, or from `pointStart` and `pointInterval` given in the
3970
+ * series options.
3971
+ * ```js
3972
+ * data: [
3973
+ * [0, 5, 6, 7],
3974
+ * [1, 4, 8, 2],
3975
+ * [2, 3, 4, 10]
3976
+ * ]
3977
+ * ```
2969
3978
  *
2970
- * @type {Array<Array<string,(Array<number>|null)>>}
2971
- * @apioption plotOptions.series.dataGrouping.units
3979
+ * 2. An array of objects with named values. The following snippet shows only a
3980
+ * few settings, see the complete options set below. If the total number of
3981
+ * data points exceeds the series'
3982
+ * [turboThreshold](#series.hlc.turboThreshold), this option is not
3983
+ * available.
3984
+ * ```js
3985
+ * data: [{
3986
+ * x: 1,
3987
+ * high: 4,
3988
+ * low: 5,
3989
+ * close: 2,
3990
+ * name: "Point2",
3991
+ * color: "#00FF00"
3992
+ * }, {
3993
+ * x: 1,
3994
+ * high: 3,
3995
+ * low: 6,
3996
+ * close: 7,
3997
+ * name: "Point1",
3998
+ * color: "#FF00FF"
3999
+ * }]
4000
+ * ```
4001
+ *
4002
+ * @type {Array<Array<(number|string),number,number>|Array<(number|string),number,number,number>|*>}
4003
+ * @extends series.arearange.data
4004
+ * @excluding y, marker
4005
+ * @product highstock
4006
+ * @apioption series.hlc.data
2972
4007
  */
2973
4008
  /**
2974
- * The approximate pixel width of each group. If for example a series
2975
- * with 30 points is displayed over a 600 pixel wide plot area, no grouping
2976
- * is performed. If however the series contains so many points that
2977
- * the spacing is less than the groupPixelWidth, Highcharts will try
2978
- * to group it into appropriate groups so that each is more or less
2979
- * two pixels wide. Defaults to `10`.
2980
- *
2981
- * @sample {highstock} stock/plotoptions/series-datagrouping-grouppixelwidth/
2982
- * Two series with the same data density but different groupPixelWidth
4009
+ * The closing value of each data point.
2983
4010
  *
2984
4011
  * @type {number}
2985
- * @default 10
2986
- * @apioption plotOptions.column.dataGrouping.groupPixelWidth
4012
+ * @product highstock
4013
+ * @apioption series.hlc.data.close
2987
4014
  */
2988
- ''; // required by JSDoc parsing
4015
+ ''; // adds doclets above to transpilat
2989
4016
 
2990
- return dataGrouping;
4017
+ return HLCSeries;
2991
4018
  });
2992
4019
  _registerModule(_modules, 'Series/OHLC/OHLCPoint.js', [_modules['Core/Series/SeriesRegistry.js']], function (SeriesRegistry) {
2993
4020
  /* *
@@ -3015,7 +4042,7 @@
3015
4042
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3016
4043
  };
3017
4044
  })();
3018
- var ColumnSeries = SeriesRegistry.seriesTypes.column;
4045
+ var HLCSeries = SeriesRegistry.seriesTypes.hlc;
3019
4046
  /* *
3020
4047
  *
3021
4048
  * Class
@@ -3031,12 +4058,8 @@
3031
4058
  * */
3032
4059
  var _this = _super !== null && _super.apply(this,
3033
4060
  arguments) || this;
3034
- _this.close = void 0;
3035
- _this.high = void 0;
3036
- _this.low = void 0;
3037
4061
  _this.open = void 0;
3038
4062
  _this.options = void 0;
3039
- _this.plotClose = void 0;
3040
4063
  _this.plotOpen = void 0;
3041
4064
  _this.series = void 0;
3042
4065
  return _this;
@@ -3052,7 +4075,6 @@
3052
4075
  * Extend the parent method by adding up or down to the class name.
3053
4076
  * @private
3054
4077
  * @function Highcharts.seriesTypes.ohlc#getClassName
3055
- * @return {string}
3056
4078
  */
3057
4079
  OHLCPoint.prototype.getClassName = function () {
3058
4080
  return _super.prototype.getClassName.call(this) +
@@ -3106,7 +4128,7 @@
3106
4128
  return this;
3107
4129
  };
3108
4130
  return OHLCPoint;
3109
- }(ColumnSeries.prototype.pointClass));
4131
+ }(HLCSeries.prototype.pointClass));
3110
4132
  /* *
3111
4133
  *
3112
4134
  * Default Export
@@ -3141,14 +4163,11 @@
3141
4163
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3142
4164
  };
3143
4165
  })();
3144
- var ColumnSeries = SeriesRegistry.seriesTypes.column;
3145
- var extend = U.extend,
4166
+ var Series = SeriesRegistry.series,
4167
+ HLCSeries = SeriesRegistry.seriesTypes.hlc;
4168
+ var addEvent = U.addEvent,
4169
+ extend = U.extend,
3146
4170
  merge = U.merge;
3147
- /* *
3148
- *
3149
- * Class
3150
- *
3151
- * */
3152
4171
  /**
3153
4172
  * The ohlc series type.
3154
4173
  *
@@ -3176,97 +4195,31 @@
3176
4195
  _this.data = void 0;
3177
4196
  _this.options = void 0;
3178
4197
  _this.points = void 0;
3179
- _this.yData = void 0;
3180
4198
  return _this;
3181
- /* eslint-enable valid-jsdoc */
3182
4199
  }
3183
4200
  /* *
3184
4201
  *
3185
4202
  * Functions
3186
4203
  *
3187
4204
  * */
3188
- /* eslint-disable valid-jsdoc */
3189
- /**
3190
- * Draw the data points
3191
- * @private
3192
- */
3193
- OHLCSeries.prototype.drawPoints = function () {
3194
- var series = this,
3195
- points = series.points,
3196
- chart = series.chart,
3197
- /**
3198
- * Extend vertical stem to open and close values.
3199
- */
3200
- extendStem = function (path,
3201
- halfStrokeWidth,
3202
- openOrClose) {
3203
- var start = path[0];
3204
- var end = path[1];
3205
- // We don't need to worry about crisp - openOrClose value
3206
- // is already crisped and halfStrokeWidth should remove it.
3207
- if (typeof start[2] === 'number') {
3208
- start[2] = Math.max(openOrClose + halfStrokeWidth, start[2]);
3209
- }
3210
- if (typeof end[2] === 'number') {
3211
- end[2] = Math.min(openOrClose - halfStrokeWidth, end[2]);
3212
- }
3213
- };
3214
- points.forEach(function (point) {
3215
- var plotOpen,
3216
- plotClose,
3217
- crispCorr,
3218
- halfWidth,
3219
- path,
3220
- graphic = point.graphic,
3221
- crispX,
3222
- isNew = !graphic,
3223
- strokeWidth;
3224
- if (typeof point.plotY !== 'undefined') {
3225
- // Create and/or update the graphic
3226
- if (!graphic) {
3227
- point.graphic = graphic = chart.renderer.path()
3228
- .add(series.group);
3229
- }
3230
- if (!chart.styledMode) {
3231
- graphic.attr(series.pointAttribs(point, (point.selected && 'select'))); // #3897
3232
- }
3233
- // crisp vector coordinates
3234
- strokeWidth = graphic.strokeWidth();
3235
- crispCorr = (strokeWidth % 2) / 2;
3236
- // #2596:
3237
- crispX = Math.round(point.plotX) - crispCorr;
3238
- halfWidth = Math.round(point.shapeArgs.width / 2);
3239
- // the vertical stem
3240
- path = [
3241
- ['M', crispX, Math.round(point.yBottom)],
3242
- ['L', crispX, Math.round(point.plotHigh)]
3243
- ];
3244
- // open
3245
- if (point.open !== null) {
3246
- plotOpen = Math.round(point.plotOpen) + crispCorr;
3247
- path.push(['M', crispX, plotOpen], ['L', crispX - halfWidth, plotOpen]);
3248
- extendStem(path, strokeWidth / 2, plotOpen);
3249
- }
3250
- // close
3251
- if (point.close !== null) {
3252
- plotClose = Math.round(point.plotClose) + crispCorr;
3253
- path.push(['M', crispX, plotClose], ['L', crispX + halfWidth, plotClose]);
3254
- extendStem(path, strokeWidth / 2, plotClose);
3255
- }
3256
- graphic[isNew ? 'attr' : 'animate']({ d: path })
3257
- .addClass(point.getClassName(), true);
3258
- }
3259
- });
3260
- };
3261
- /**
3262
- * @private
3263
- * @function Highcarts.seriesTypes.ohlc#init
3264
- * @return {void}
3265
- */
3266
- OHLCSeries.prototype.init = function () {
3267
- _super.prototype.init.apply(this, arguments);
3268
- this.options.stacking = void 0; // #8817
4205
+ OHLCSeries.prototype.getPointPath = function (point, graphic) {
4206
+ var path = _super.prototype.getPointPath.call(this,
4207
+ point,
4208
+ graphic),
4209
+ strokeWidth = graphic.strokeWidth(),
4210
+ crispCorr = (strokeWidth % 2) / 2,
4211
+ crispX = Math.round(point.plotX) - crispCorr,
4212
+ halfWidth = Math.round(point.shapeArgs.width / 2);
4213
+ var plotOpen = point.plotOpen;
4214
+ // crisp vector coordinates
4215
+ if (point.open !== null) {
4216
+ plotOpen = Math.round(point.plotOpen) + crispCorr;
4217
+ path.push(['M', crispX, plotOpen], ['L', crispX - halfWidth, plotOpen]);
4218
+ _super.prototype.extendStem.call(this, path, strokeWidth / 2, plotOpen);
4219
+ }
4220
+ return path;
3269
4221
  };
4222
+ /* eslint-disable valid-jsdoc */
3270
4223
  /**
3271
4224
  * Postprocess mapping between options and SVG attributes
3272
4225
  * @private
@@ -3288,43 +4241,6 @@
3288
4241
  // return a plain array for speedy calculation
3289
4242
  return [point.open, point.high, point.low, point.close];
3290
4243
  };
3291
- /**
3292
- * Translate data points from raw values x and y to plotX and plotY
3293
- *
3294
- * @private
3295
- * @function Highcharts.seriesTypes.ohlc#translate
3296
- * @return {void}
3297
- */
3298
- OHLCSeries.prototype.translate = function () {
3299
- var series = this,
3300
- yAxis = series.yAxis,
3301
- hasModifyValue = !!series.modifyValue,
3302
- translated = [
3303
- 'plotOpen',
3304
- 'plotHigh',
3305
- 'plotLow',
3306
- 'plotClose',
3307
- 'yBottom'
3308
- ]; // translate OHLC for
3309
- _super.prototype.translate.apply(series);
3310
- // Do the translation
3311
- series.points.forEach(function (point) {
3312
- [point.open, point.high, point.low, point.close, point.low]
3313
- .forEach(function (value, i) {
3314
- if (value !== null) {
3315
- if (hasModifyValue) {
3316
- value = series.modifyValue(value);
3317
- }
3318
- point[translated[i]] =
3319
- yAxis.toPixels(value, true);
3320
- }
3321
- });
3322
- // Align the tooltip to the high value to avoid covering the
3323
- // point
3324
- point.tooltipPos[1] =
3325
- point.plotHigh + yAxis.pos - series.chart.plotTop;
3326
- });
3327
- };
3328
4244
  /**
3329
4245
  * An OHLC chart is a style of financial chart used to describe price
3330
4246
  * movements over time. It displays open, high, low and close values per
@@ -3333,39 +4249,28 @@
3333
4249
  * @sample stock/demo/ohlc/
3334
4250
  * OHLC chart
3335
4251
  *
3336
- * @extends plotOptions.column
3337
- * @excluding borderColor, borderRadius, borderWidth, crisp, stacking,
3338
- * stack
4252
+ * @extends plotOptions.hlc
3339
4253
  * @product highstock
3340
4254
  * @optionparent plotOptions.ohlc
3341
4255
  */
3342
- OHLCSeries.defaultOptions = merge(ColumnSeries.defaultOptions, {
4256
+ /**
4257
+ * The parameter allows setting line series type and use OHLC indicators.
4258
+ * Data in OHLC format is required.
4259
+ *
4260
+ * @sample {highstock} stock/indicators/use-ohlc-data
4261
+ * Use OHLC data format to plot line chart
4262
+ *
4263
+ * @type {boolean}
4264
+ * @product highstock
4265
+ * @apioption plotOptions.line.useOhlcData
4266
+ */
4267
+ OHLCSeries.defaultOptions = merge(HLCSeries.defaultOptions, {
3343
4268
  /**
3344
- * The approximate pixel width of each group. If for example a series
3345
- * with 30 points is displayed over a 600 pixel wide plot area, no
3346
- * grouping is performed. If however the series contains so many points
3347
- * that the spacing is less than the groupPixelWidth, Highcharts will
3348
- * try to group it into appropriate groups so that each is more or less
3349
- * two pixels wide. Defaults to `5`.
3350
- *
3351
- * @type {number}
3352
- * @default 5
4269
+ * @type {Highcharts.DataGroupingApproximationValue|Function}
4270
+ * @default ohlc
3353
4271
  * @product highstock
3354
- * @apioption plotOptions.ohlc.dataGrouping.groupPixelWidth
3355
- */
3356
- /**
3357
- * The pixel width of the line/border. Defaults to `1`.
3358
- *
3359
- * @sample {highstock} stock/plotoptions/ohlc-linewidth/
3360
- * A greater line width
3361
- *
3362
- * @type {number}
3363
- * @default 1
3364
- * @product highstock
3365
- *
3366
- * @private
4272
+ * @apioption plotOptions.ohlc.dataGrouping.approximation
3367
4273
  */
3368
- lineWidth: 1,
3369
4274
  tooltip: {
3370
4275
  pointFormat: '<span style="color:{point.color}">\u25CF</span> ' +
3371
4276
  '<b> {series.name}</b><br/>' +
@@ -3373,42 +4278,17 @@
3373
4278
  'High: {point.high}<br/>' +
3374
4279
  'Low: {point.low}<br/>' +
3375
4280
  'Close: {point.close}<br/>'
3376
- },
3377
- threshold: null,
3378
- states: {
3379
- /**
3380
- * @extends plotOptions.column.states.hover
3381
- * @product highstock
3382
- */
3383
- hover: {
3384
- /**
3385
- * The pixel width of the line representing the OHLC point.
3386
- *
3387
- * @type {number}
3388
- * @default 3
3389
- * @product highstock
3390
- */
3391
- lineWidth: 3
3392
- }
3393
- },
4281
+ }
3394
4282
  /**
3395
- * Determines which one of `open`, `high`, `low`, `close` values should
4283
+ * Determines which one of `open`, `high`, `low`, `close` values should
3396
4284
  * be represented as `point.y`, which is later used to set dataLabel
3397
4285
  * position and [compare](#plotOptions.series.compare).
3398
4286
  *
3399
- * @sample {highstock} stock/plotoptions/ohlc-pointvalkey/
3400
- * Possible values
3401
- *
3402
- * @type {string}
3403
4287
  * @default close
3404
4288
  * @validvalue ["open", "high", "low", "close"]
3405
4289
  * @product highstock
3406
4290
  * @apioption plotOptions.ohlc.pointValKey
3407
4291
  */
3408
- /**
3409
- * @default close
3410
- * @apioption plotOptions.ohlc.colorKey
3411
- */
3412
4292
  /**
3413
4293
  * Line color for up points.
3414
4294
  *
@@ -3416,19 +4296,11 @@
3416
4296
  * @product highstock
3417
4297
  * @apioption plotOptions.ohlc.upColor
3418
4298
  */
3419
- stickyTracking: true
3420
4299
  });
3421
4300
  return OHLCSeries;
3422
- }(ColumnSeries));
4301
+ }(HLCSeries));
3423
4302
  extend(OHLCSeries.prototype, {
3424
- animate: null,
3425
- directTouch: false,
3426
- pointArrayMap: ['open', 'high', 'low', 'close'],
3427
- pointAttrToOptions: {
3428
- stroke: 'color',
3429
- 'stroke-width': 'lineWidth'
3430
- },
3431
- pointValKey: 'close'
4303
+ pointArrayMap: ['open', 'high', 'low', 'close']
3432
4304
  });
3433
4305
  OHLCSeries.prototype.pointClass = OHLCPoint;
3434
4306
  SeriesRegistry.registerSeriesType('ohlc', OHLCSeries);
@@ -3437,6 +4309,30 @@
3437
4309
  * Default Export
3438
4310
  *
3439
4311
  * */
4312
+ // Add useOhlcData option
4313
+ addEvent(Series, 'init', function (eventOptions) {
4314
+ // eslint-disable-next-line no-invalid-this
4315
+ var series = this,
4316
+ options = eventOptions.options;
4317
+ if (options.useOhlcData &&
4318
+ options.id !== 'highcharts-navigator-series') {
4319
+ extend(series, {
4320
+ pointValKey: OHLCSeries.prototype.pointValKey,
4321
+ // keys: ohlcProto.keys, // @todo potentially nonsense
4322
+ pointArrayMap: OHLCSeries.prototype.pointArrayMap,
4323
+ toYData: OHLCSeries.prototype.toYData
4324
+ });
4325
+ }
4326
+ });
4327
+ addEvent(Series, 'afterSetOptions', function (e) {
4328
+ var options = e.options,
4329
+ dataGrouping = options.dataGrouping;
4330
+ if (dataGrouping &&
4331
+ options.useOhlcData &&
4332
+ options.id !== 'highcharts-navigator-series') {
4333
+ dataGrouping.approximation = 'ohlc';
4334
+ }
4335
+ });
3440
4336
  /* *
3441
4337
  *
3442
4338
  * API Options
@@ -3497,16 +4393,9 @@
3497
4393
  *
3498
4394
  * @type {Array<Array<(number|string),number,number,number>|Array<(number|string),number,number,number,number>|*>}
3499
4395
  * @extends series.arearange.data
3500
- * @excluding y, marker
3501
- * @product highstock
3502
- * @apioption series.ohlc.data
3503
- */
3504
- /**
3505
- * The closing value of each data point.
3506
- *
3507
- * @type {number}
4396
+ * @excluding y, marker
3508
4397
  * @product highstock
3509
- * @apioption series.ohlc.data.close
4398
+ * @apioption series.ohlc.data
3510
4399
  */
3511
4400
  /**
3512
4401
  * The opening value of each data point.
@@ -3519,7 +4408,7 @@
3519
4408
 
3520
4409
  return OHLCSeries;
3521
4410
  });
3522
- _registerModule(_modules, 'Series/Candlestick/CandlestickSeries.js', [_modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (D, palette, SeriesRegistry, U) {
4411
+ _registerModule(_modules, 'Series/Candlestick/CandlestickSeries.js', [_modules['Core/DefaultOptions.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (D, SeriesRegistry, U) {
3523
4412
  /* *
3524
4413
  *
3525
4414
  * (c) 2010-2021 Torstein Honsi
@@ -3569,7 +4458,7 @@
3569
4458
  function CandlestickSeries() {
3570
4459
  /* *
3571
4460
  *
3572
- * Static properties
4461
+ * Static Properties
3573
4462
  *
3574
4463
  * */
3575
4464
  var _this = _super !== null && _super.apply(this,
@@ -3625,7 +4514,6 @@
3625
4514
  *
3626
4515
  * @private
3627
4516
  * @function Highcharts.seriesTypes.candlestick#drawPoints
3628
- * @return {void}
3629
4517
  */
3630
4518
  CandlestickSeries.prototype.drawPoints = function () {
3631
4519
  var series = this,
@@ -3706,9 +4594,10 @@
3706
4594
  });
3707
4595
  /* eslint-enable valid-jsdoc */
3708
4596
  };
4597
+ CandlestickSeries.defaultOptions = merge(OHLCSeries.defaultOptions, defaultOptions.plotOptions,
3709
4598
  /**
3710
- * A candlestick chart is a style of financial chart used to describe price
3711
- * movements over time.
4599
+ * A candlestick chart is a style of financial chart used to describe
4600
+ * price movements over time.
3712
4601
  *
3713
4602
  * @sample stock/demo/candlestick/
3714
4603
  * Candlestick chart
@@ -3718,7 +4607,7 @@
3718
4607
  * @product highstock
3719
4608
  * @optionparent plotOptions.candlestick
3720
4609
  */
3721
- CandlestickSeries.defaultOptions = merge(OHLCSeries.defaultOptions, defaultOptions.plotOptions, {
4610
+ {
3722
4611
  /**
3723
4612
  * The specific line color for up candle sticks. The default is to
3724
4613
  * inherit the general `lineColor` setting.
@@ -3731,12 +4620,6 @@
3731
4620
  * @product highstock
3732
4621
  * @apioption plotOptions.candlestick.upLineColor
3733
4622
  */
3734
- /**
3735
- * @type {Highcharts.DataGroupingApproximationValue|Function}
3736
- * @default ohlc
3737
- * @product highstock
3738
- * @apioption plotOptions.candlestick.dataGrouping.approximation
3739
- */
3740
4623
  states: {
3741
4624
  /**
3742
4625
  * @extends plotOptions.column.states.hover
@@ -3744,16 +4627,14 @@
3744
4627
  */
3745
4628
  hover: {
3746
4629
  /**
3747
- * The pixel width of the line/border around the candlestick.
4630
+ * The pixel width of the line/border around the
4631
+ * candlestick.
3748
4632
  *
3749
4633
  * @product highstock
3750
4634
  */
3751
4635
  lineWidth: 2
3752
4636
  }
3753
4637
  },
3754
- /**
3755
- * @extends plotOptions.ohlc.tooltip
3756
- */
3757
4638
  tooltip: defaultOptions.plotOptions.ohlc.tooltip,
3758
4639
  /**
3759
4640
  * @type {number|null}
@@ -3775,7 +4656,7 @@
3775
4656
  * @default #000000
3776
4657
  * @product highstock
3777
4658
  */
3778
- lineColor: palette.neutralColor100,
4659
+ lineColor: "#000000" /* neutralColor100 */,
3779
4660
  /**
3780
4661
  * The pixel width of the candlestick line/border. Defaults to `1`.
3781
4662
  *
@@ -3800,8 +4681,8 @@
3800
4681
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
3801
4682
  * @default #ffffff
3802
4683
  * @product highstock
3803
- */
3804
- upColor: palette.backgroundColor,
4684
+ */
4685
+ upColor: "#ffffff" /* backgroundColor */,
3805
4686
  /**
3806
4687
  * @product highstock
3807
4688
  */
@@ -3963,7 +4844,7 @@
3963
4844
 
3964
4845
  return FlagsPoint;
3965
4846
  });
3966
- _registerModule(_modules, 'Mixins/OnSeries.js', [_modules['Series/Column/ColumnSeries.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (ColumnSeries, Series, U) {
4847
+ _registerModule(_modules, 'Series/OnSeriesComposition.js', [_modules['Series/Column/ColumnSeries.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (ColumnSeries, Series, U) {
3967
4848
  /* *
3968
4849
  *
3969
4850
  * (c) 2010-2021 Torstein Honsi
@@ -3977,52 +4858,78 @@
3977
4858
  var seriesProto = Series.prototype;
3978
4859
  var defined = U.defined,
3979
4860
  stableSort = U.stableSort;
3980
- /**
3981
- * @private
3982
- * @mixin onSeriesMixin
3983
- */
3984
- var onSeriesMixin = {
3985
- /* eslint-disable valid-jsdoc */
3986
- /**
3987
- * Override getPlotBox. If the onSeries option is valid,
3988
- return the plot box
3989
- * of the onSeries,
3990
- otherwise proceed as usual.
3991
- *
3992
- * @private
3993
- * @function onSeriesMixin.getPlotBox
3994
- * @return {Highcharts.SeriesPlotBoxObject}
3995
- */
3996
- getPlotBox: function () {
3997
- return seriesProto.getPlotBox.call((this.options.onSeries &&
3998
- this.chart.get(this.options.onSeries)) || this);
3999
- },
4861
+ /* *
4862
+ *
4863
+ * Composition
4864
+ *
4865
+ * */
4866
+ var OnSeriesComposition;
4867
+ (function (OnSeriesComposition) {
4868
+ /* *
4869
+ *
4870
+ * Declarations
4871
+ *
4872
+ * */
4873
+ /* *
4874
+ *
4875
+ * Properties
4876
+ *
4877
+ * */
4878
+ var composedClasses = [];
4879
+ /* *
4880
+ *
4881
+ * Functions
4882
+ *
4883
+ * */
4884
+ /* eslint-disable valid-jsdoc */
4885
+ /**
4886
+ * @private
4887
+ */
4888
+ function compose(SeriesClass) {
4889
+ if (composedClasses.indexOf(SeriesClass) === -1) {
4890
+ composedClasses.push(SeriesClass);
4891
+ var seriesProto_1 = SeriesClass.prototype;
4892
+ seriesProto_1.getPlotBox = getPlotBox;
4893
+ seriesProto_1.translate = translate;
4894
+ }
4895
+ return SeriesClass;
4896
+ }
4897
+ OnSeriesComposition.compose = compose;
4898
+ /**
4899
+ * Override getPlotBox. If the onSeries option is valid, return the plot box
4900
+ * of the onSeries, otherwise proceed as usual.
4901
+ *
4902
+ * @private
4903
+ */
4904
+ function getPlotBox() {
4905
+ return seriesProto.getPlotBox.call((this.options.onSeries &&
4906
+ this.chart.get(this.options.onSeries)) || this);
4907
+ }
4908
+ OnSeriesComposition.getPlotBox = getPlotBox;
4000
4909
  /**
4001
4910
  * Extend the translate method by placing the point on the related series
4002
4911
  *
4003
4912
  * @private
4004
- * @function onSeriesMixin.translate
4005
- * @return {void}
4006
4913
  */
4007
- translate: function () {
4914
+ function translate() {
4008
4915
  columnProto.translate.apply(this);
4009
4916
  var series = this,
4010
4917
  options = series.options,
4011
4918
  chart = series.chart,
4012
4919
  points = series.points,
4013
- cursor = points.length - 1,
4014
- point,
4015
- lastPoint,
4016
4920
  optionsOnSeries = options.onSeries,
4017
4921
  onSeries = (optionsOnSeries &&
4018
4922
  chart.get(optionsOnSeries)),
4019
- onKey = options.onKey || 'y',
4020
4923
  step = onSeries && onSeries.options.step,
4021
4924
  onData = (onSeries && onSeries.points),
4022
- i = onData && onData.length,
4023
4925
  inverted = chart.inverted,
4024
4926
  xAxis = series.xAxis,
4025
- yAxis = series.yAxis,
4927
+ yAxis = series.yAxis;
4928
+ var cursor = points.length - 1,
4929
+ point,
4930
+ lastPoint,
4931
+ onKey = options.onKey || 'y',
4932
+ i = onData && onData.length,
4026
4933
  xOffset = 0,
4027
4934
  leftPoint,
4028
4935
  lastX,
@@ -4036,9 +4943,7 @@
4036
4943
  lastX = (onData[i - 1].x +
4037
4944
  (currentDataGrouping ? currentDataGrouping.totalRange : 0)); // #2374
4038
4945
  // sort the data points
4039
- stableSort(points, function (a, b) {
4040
- return (a.x - b.x);
4041
- });
4946
+ stableSort(points, function (a, b) { return (a.x - b.x); });
4042
4947
  onKey = 'plot' + onKey[0].toUpperCase() + onKey.substr(1);
4043
4948
  while (i-- && points[cursor]) {
4044
4949
  leftPoint = onData[i];
@@ -4117,10 +5022,15 @@
4117
5022
  });
4118
5023
  this.onSeries = onSeries;
4119
5024
  }
4120
- /* eslint-enable valid-jsdoc */
4121
- };
5025
+ OnSeriesComposition.translate = translate;
5026
+ })(OnSeriesComposition || (OnSeriesComposition = {}));
5027
+ /* *
5028
+ *
5029
+ * Default Export
5030
+ *
5031
+ * */
4122
5032
 
4123
- return onSeriesMixin;
5033
+ return OnSeriesComposition;
4124
5034
  });
4125
5035
  _registerModule(_modules, 'Series/Flags/FlagsSymbols.js', [_modules['Core/Renderer/RendererRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js']], function (RendererRegistry, SVGRenderer) {
4126
5036
  /* *
@@ -4148,8 +5058,8 @@
4148
5058
  /**
4149
5059
  * Create the circlepin and squarepin icons with anchor.
4150
5060
  * @private
4151
- * @param {string} shape - circle or square
4152
- * @return {void}
5061
+ * @param {string} shape
5062
+ * circle or square
4153
5063
  */
4154
5064
  function createPinSymbol(shape) {
4155
5065
  symbols[(shape + 'pin')] = function (x, y, w, h, options) {
@@ -4216,7 +5126,7 @@
4216
5126
 
4217
5127
  return symbols;
4218
5128
  });
4219
- _registerModule(_modules, 'Series/Flags/FlagsSeries.js', [_modules['Series/Flags/FlagsPoint.js'], _modules['Core/Globals.js'], _modules['Mixins/OnSeries.js'], _modules['Core/Color/Palette.js'], _modules['Core/Renderer/RendererUtilities.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (FlagsPoint, H, OnSeriesMixin, palette, R, SeriesRegistry, SVGElement, U) {
5129
+ _registerModule(_modules, 'Series/Flags/FlagsSeries.js', [_modules['Series/Flags/FlagsPoint.js'], _modules['Core/Globals.js'], _modules['Series/OnSeriesComposition.js'], _modules['Core/Renderer/RendererUtilities.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (FlagsPoint, H, OnSeriesComposition, R, SeriesRegistry, SVGElement, U) {
4220
5130
  /* *
4221
5131
  *
4222
5132
  * (c) 2010-2021 Torstein Honsi
@@ -4421,11 +5331,15 @@
4421
5331
  }
4422
5332
  // Handle X-dimension overlapping
4423
5333
  if (!options.allowOverlapX) {
5334
+ var maxDistance_1 = 100;
4424
5335
  objectEach(boxesMap, function (box) {
4425
5336
  box.plotX = box.anchorX;
4426
5337
  boxes.push(box);
5338
+ maxDistance_1 = Math.max(box.size, maxDistance_1);
4427
5339
  });
4428
- distribute(boxes, inverted ? yAxis.len : this.xAxis.len, 100);
5340
+ // If necessary (for overlapping or long labels) distribute it
5341
+ // depending on the label width or a hardcoded value, #16041.
5342
+ distribute(boxes, inverted ? yAxis.len : this.xAxis.len, maxDistance_1);
4429
5343
  points.forEach(function (point) {
4430
5344
  var box = point.graphic && boxesMap[point.plotX];
4431
5345
  if (box) {
@@ -4689,7 +5603,7 @@
4689
5603
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
4690
5604
  * @product highstock
4691
5605
  */
4692
- fillColor: palette.backgroundColor,
5606
+ fillColor: "#ffffff" /* backgroundColor */,
4693
5607
  /**
4694
5608
  * The color of the line/border of the flag.
4695
5609
  *
@@ -4719,14 +5633,14 @@
4719
5633
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
4720
5634
  * @product highstock
4721
5635
  */
4722
- lineColor: palette.neutralColor100,
5636
+ lineColor: "#000000" /* neutralColor100 */,
4723
5637
  /**
4724
5638
  * The fill or background color of the flag.
4725
5639
  *
4726
5640
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
4727
5641
  * @product highstock
4728
5642
  */
4729
- fillColor: palette.highlightColor20
5643
+ fillColor: "#ccd6eb" /* highlightColor20 */
4730
5644
  }
4731
5645
  },
4732
5646
  /**
@@ -4748,37 +5662,27 @@
4748
5662
  });
4749
5663
  return FlagsSeries;
4750
5664
  }(ColumnSeries));
5665
+ OnSeriesComposition.compose(FlagsSeries);
4751
5666
  extend(FlagsSeries.prototype, {
4752
5667
  allowDG: false,
4753
- /**
4754
- * @private
4755
- * @function Highcharts.seriesTypes.flags#buildKDTree
4756
- */
4757
- buildKDTree: noop,
4758
5668
  forceCrop: true,
4759
- getPlotBox: OnSeriesMixin.getPlotBox,
5669
+ invertible: false,
5670
+ noSharedTooltip: true,
5671
+ pointClass: FlagsPoint,
5672
+ sorted: false,
5673
+ takeOrdinalPosition: false,
5674
+ trackerGroups: ['markerGroup'],
5675
+ buildKDTree: noop,
4760
5676
  /**
4761
5677
  * Inherit the initialization from base Series.
4762
- *
4763
5678
  * @private
4764
- * @borrows Highcharts.Series#init as Highcharts.seriesTypes.flags#init
4765
5679
  */
4766
5680
  init: Series.prototype.init,
4767
5681
  /**
4768
5682
  * Don't invert the flag marker group (#4960).
4769
- *
4770
5683
  * @private
4771
- * @function Highcharts.seriesTypes.flags#invertGroups
4772
5684
  */
4773
- invertGroups: noop,
4774
- // Flags series group should not be invertible (#14063).
4775
- invertible: false,
4776
- noSharedTooltip: true,
4777
- pointClass: FlagsPoint,
4778
- sorted: false,
4779
- takeOrdinalPosition: false,
4780
- trackerGroups: ['markerGroup'],
4781
- translate: OnSeriesMixin.translate
5685
+ invertGroups: noop
4782
5686
  });
4783
5687
  SeriesRegistry.registerSeriesType('flags', FlagsSeries);
4784
5688
  /* *
@@ -4958,7 +5862,8 @@
4958
5862
  from = unitedMin + range * (1 - this.to);
4959
5863
  }
4960
5864
  if (this.shouldUpdateExtremes(e.DOMType)) {
4961
- axis.setExtremes(from, to, true, e.DOMType !== 'mousemove' && e.DOMType !== 'touchmove', e);
5865
+ axis.setExtremes(from, to, true, (e.DOMType !== 'mousemove' &&
5866
+ e.DOMType !== 'touchmove'), e);
4962
5867
  }
4963
5868
  else {
4964
5869
  // When live redraw is disabled, don't change extremes
@@ -4975,7 +5880,7 @@
4975
5880
  scrollMin = _a.scrollMin,
4976
5881
  scrollMax = _a.scrollMax,
4977
5882
  scrollbar = axis.scrollbar,
4978
- offset = axis.axisTitleMargin + (axis.titleOffset || 0),
5883
+ offset = (axis.axisTitleMargin + (axis.titleOffset || 0)),
4979
5884
  scrollbarsOffsets = axis.chart.scrollbarsOffsets,
4980
5885
  axisMargin = axis.options.margin || 0,
4981
5886
  offsetsIndex,
@@ -4987,8 +5892,11 @@
4987
5892
  if (!axis.opposite) {
4988
5893
  scrollbarsOffsets[1] += offset;
4989
5894
  }
4990
- scrollbar.position(axis.left, axis.top + axis.height + 2 + scrollbarsOffsets[1] -
4991
- (axis.opposite ? axisMargin : 0), axis.width, axis.height);
5895
+ scrollbar.position(axis.left, (axis.top +
5896
+ axis.height +
5897
+ 2 +
5898
+ scrollbarsOffsets[1] -
5899
+ (axis.opposite ? axisMargin : 0)), axis.width, axis.height);
4992
5900
  // Next scrollbar should reserve space for margin (if set)
4993
5901
  if (!axis.opposite) {
4994
5902
  scrollbarsOffsets[1] += axisMargin;
@@ -5000,8 +5908,18 @@
5000
5908
  if (axis.opposite) {
5001
5909
  scrollbarsOffsets[0] += offset;
5002
5910
  }
5003
- scrollbar.position(axis.left + axis.width + 2 + scrollbarsOffsets[0] -
5004
- (axis.opposite ? 0 : axisMargin), axis.top, axis.width, axis.height);
5911
+ var xPosition = void 0;
5912
+ if (!scrollbar.options.opposite) {
5913
+ xPosition = axis.opposite ? 0 : axisMargin;
5914
+ }
5915
+ else {
5916
+ xPosition = axis.left +
5917
+ axis.width +
5918
+ 2 +
5919
+ scrollbarsOffsets[0] -
5920
+ (axis.opposite ? 0 : axisMargin);
5921
+ }
5922
+ scrollbar.position(xPosition, axis.top, axis.width, axis.height);
5005
5923
  // Next scrollbar should reserve space for margin (if set)
5006
5924
  if (axis.opposite) {
5007
5925
  scrollbarsOffsets[0] += axisMargin;
@@ -5022,10 +5940,10 @@
5022
5940
  scrollbar.setRange(0, 1);
5023
5941
  }
5024
5942
  else {
5025
- from =
5026
- (axis.min - scrollMin) / (scrollMax - scrollMin);
5027
- to =
5028
- (axis.max - scrollMin) / (scrollMax - scrollMin);
5943
+ from = ((axis.min - scrollMin) /
5944
+ (scrollMax - scrollMin));
5945
+ to = ((axis.max - scrollMin) /
5946
+ (scrollMax - scrollMin));
5029
5947
  if ((axis.horiz && !axis.reversed) ||
5030
5948
  (!axis.horiz && axis.reversed)) {
5031
5949
  scrollbar.setRange(from, to);
@@ -5040,10 +5958,12 @@
5040
5958
  // Make space for a scrollbar:
5041
5959
  addEvent(AxisClass, 'afterGetOffset', function () {
5042
5960
  var axis = this,
5043
- index = axis.horiz ? 2 : 1,
5961
+ opposite = axis.scrollbar && !axis.scrollbar.options.opposite,
5962
+ index = axis.horiz ? 2 : opposite ? 3 : 1,
5044
5963
  scrollbar = axis.scrollbar;
5045
5964
  if (scrollbar) {
5046
- axis.chart.scrollbarsOffsets = [0, 0]; // reset scrollbars offsets
5965
+ // reset scrollbars offsets
5966
+ axis.chart.scrollbarsOffsets = [0, 0];
5047
5967
  axis.chart.axisOffset[index] +=
5048
5968
  scrollbar.size + scrollbar.options.margin;
5049
5969
  }
@@ -5056,7 +5976,7 @@
5056
5976
 
5057
5977
  return ScrollbarAxis;
5058
5978
  });
5059
- _registerModule(_modules, 'Core/ScrollbarDefaults.js', [_modules['Core/Globals.js'], _modules['Core/Color/Palette.js']], function (H, Palette) {
5979
+ _registerModule(_modules, 'Core/ScrollbarDefaults.js', [_modules['Core/Globals.js']], function (H) {
5060
5980
  /* *
5061
5981
  *
5062
5982
  * (c) 2010-2021 Torstein Honsi
@@ -5155,6 +6075,8 @@
5155
6075
  * @since 1.2.5
5156
6076
  */
5157
6077
  minWidth: 6,
6078
+ /** @ignore-option */
6079
+ opposite: true,
5158
6080
  /**
5159
6081
  * Whether to show or hide the scrollbar when the scrolled content is
5160
6082
  * zoomed out to it full extent.
@@ -5176,7 +6098,7 @@
5176
6098
  *
5177
6099
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5178
6100
  */
5179
- barBackgroundColor: Palette.neutralColor20,
6101
+ barBackgroundColor: "#cccccc" /* neutralColor20 */,
5180
6102
  /**
5181
6103
  * The width of the bar's border.
5182
6104
  *
@@ -5189,7 +6111,7 @@
5189
6111
  *
5190
6112
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5191
6113
  */
5192
- barBorderColor: Palette.neutralColor20,
6114
+ barBorderColor: "#cccccc" /* neutralColor20 */,
5193
6115
  /**
5194
6116
  * The color of the small arrow inside the scrollbar buttons.
5195
6117
  *
@@ -5198,7 +6120,7 @@
5198
6120
  *
5199
6121
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5200
6122
  */
5201
- buttonArrowColor: Palette.neutralColor80,
6123
+ buttonArrowColor: "#333333" /* neutralColor80 */,
5202
6124
  /**
5203
6125
  * The color of scrollbar buttons.
5204
6126
  *
@@ -5207,7 +6129,7 @@
5207
6129
  *
5208
6130
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5209
6131
  */
5210
- buttonBackgroundColor: Palette.neutralColor10,
6132
+ buttonBackgroundColor: "#e6e6e6" /* neutralColor10 */,
5211
6133
  /**
5212
6134
  * The color of the border of the scrollbar buttons.
5213
6135
  *
@@ -5216,7 +6138,7 @@
5216
6138
  *
5217
6139
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5218
6140
  */
5219
- buttonBorderColor: Palette.neutralColor20,
6141
+ buttonBorderColor: "#cccccc" /* neutralColor20 */,
5220
6142
  /**
5221
6143
  * The border width of the scrollbar buttons.
5222
6144
  *
@@ -5229,7 +6151,7 @@
5229
6151
  *
5230
6152
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5231
6153
  */
5232
- rifleColor: Palette.neutralColor80,
6154
+ rifleColor: "#333333" /* neutralColor80 */,
5233
6155
  /**
5234
6156
  * The color of the track background.
5235
6157
  *
@@ -5238,7 +6160,7 @@
5238
6160
  *
5239
6161
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5240
6162
  */
5241
- trackBackgroundColor: Palette.neutralColor5,
6163
+ trackBackgroundColor: "#f2f2f2" /* neutralColor5 */,
5242
6164
  /**
5243
6165
  * The color of the border of the scrollbar track.
5244
6166
  *
@@ -5247,7 +6169,7 @@
5247
6169
  *
5248
6170
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
5249
6171
  */
5250
- trackBorderColor: Palette.neutralColor5,
6172
+ trackBorderColor: "#f2f2f2" /* neutralColor5 */,
5251
6173
  /**
5252
6174
  * The corner radius of the border of the scrollbar track.
5253
6175
  *
@@ -5408,10 +6330,16 @@
5408
6330
  mouseUpHandler = this.mouseUpHandler.bind(this);
5409
6331
  // Mouse events
5410
6332
  var _events = [
5411
- [buttons[buttonsOrder[0]].element, 'click',
5412
- this.buttonToMinClick.bind(this)],
5413
- [buttons[buttonsOrder[1]].element, 'click',
5414
- this.buttonToMaxClick.bind(this)],
6333
+ [
6334
+ buttons[buttonsOrder[0]].element,
6335
+ 'click',
6336
+ this.buttonToMinClick.bind(this)
6337
+ ],
6338
+ [
6339
+ buttons[buttonsOrder[1]].element,
6340
+ 'click',
6341
+ this.buttonToMaxClick.bind(this)
6342
+ ],
5415
6343
  [track, 'click',
5416
6344
  this.trackClick.bind(this)],
5417
6345
  [bar, 'mousedown',
@@ -5433,7 +6361,8 @@
5433
6361
  };
5434
6362
  Scrollbar.prototype.buttonToMaxClick = function (e) {
5435
6363
  var scroller = this;
5436
- var range = (scroller.to - scroller.from) * pick(scroller.options.step, 0.2);
6364
+ var range = ((scroller.to - scroller.from) *
6365
+ pick(scroller.options.step, 0.2));
5437
6366
  scroller.updatePosition(scroller.from + range, scroller.to + range);
5438
6367
  fireEvent(scroller, 'changed', {
5439
6368
  from: scroller.from,
@@ -5486,7 +6415,6 @@
5486
6415
  *
5487
6416
  * @private
5488
6417
  * @function Highcharts.Scrollbar#destroy
5489
- * @return {void}
5490
6418
  */
5491
6419
  Scrollbar.prototype.destroy = function () {
5492
6420
  var scroller = this,
@@ -5519,7 +6447,6 @@
5519
6447
  * @function Highcharts.Scrollbar#drawScrollbarButton
5520
6448
  * @param {number} index
5521
6449
  * 0 is left, 1 is right
5522
- * @return {void}
5523
6450
  */
5524
6451
  Scrollbar.prototype.drawScrollbarButton = function (index) {
5525
6452
  var scroller = this,
@@ -5612,7 +6539,8 @@
5612
6539
  var scroller = this,
5613
6540
  normalizedEvent = scroller.chart.pointer.normalize(e),
5614
6541
  options = scroller.options,
5615
- direction = options.vertical ? 'chartY' : 'chartX',
6542
+ direction = options.vertical ?
6543
+ 'chartY' : 'chartX',
5616
6544
  initPositions = scroller.initPositions || [];
5617
6545
  var scrollPosition,
5618
6546
  chartPosition,
@@ -5673,7 +6601,6 @@
5673
6601
  * width of the scrollbar
5674
6602
  * @param {number} height
5675
6603
  * height of the scorllbar
5676
- * @return {void}
5677
6604
  */
5678
6605
  Scrollbar.prototype.position = function (x, y, width, height) {
5679
6606
  var scroller = this,
@@ -5722,7 +6649,6 @@
5722
6649
  *
5723
6650
  * @private
5724
6651
  * @function Highcharts.Scrollbar#removeEvents
5725
- * @return {void}
5726
6652
  */
5727
6653
  Scrollbar.prototype.removeEvents = function () {
5728
6654
  this._events.forEach(function (args) {
@@ -5814,7 +6740,6 @@
5814
6740
  * scale (0-1) where bar should start
5815
6741
  * @param {number} to
5816
6742
  * scale (0-1) where bar should end
5817
- * @return {void}
5818
6743
  */
5819
6744
  Scrollbar.prototype.setRange = function (from, to) {
5820
6745
  var scroller = this,
@@ -5893,8 +6818,6 @@
5893
6818
  *
5894
6819
  * @private
5895
6820
  * @function Highcharts.Scrollbar#shouldUpdateExtremes
5896
- * @param {string} [eventType]
5897
- * @return {boolean}
5898
6821
  */
5899
6822
  Scrollbar.prototype.shouldUpdateExtremes = function (eventType) {
5900
6823
  return (pick(this.options.liveRedraw, H.svg && !H.isTouchDevice && !this.chart.isBoosting) ||
@@ -5944,7 +6867,6 @@
5944
6867
  * @function Highcharts.Scrollbar#updatePosition
5945
6868
  * @param {number} from
5946
6869
  * @param {number} to
5947
- * @return {void}
5948
6870
  */
5949
6871
  Scrollbar.prototype.updatePosition = function (from, to) {
5950
6872
  if (to > 1) {
@@ -6027,11 +6949,6 @@
6027
6949
  *
6028
6950
  * @private
6029
6951
  * @function Highcharts.Axis#toFixedRange
6030
- * @param {number} [pxMin]
6031
- * @param {number} [pxMax]
6032
- * @param {number} [fixedMin]
6033
- * @param {number} [fixedMax]
6034
- * @return {*}
6035
6952
  */
6036
6953
  NavigatorAxisAdditions.prototype.toFixedRange = function (pxMin, pxMax, fixedMin, fixedMax) {
6037
6954
  var navigator = this;
@@ -6156,7 +7073,7 @@
6156
7073
 
6157
7074
  return NavigatorAxis;
6158
7075
  });
6159
- _registerModule(_modules, 'Core/Navigator.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Color/Color.js'], _modules['Core/Globals.js'], _modules['Core/Axis/NavigatorAxis.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Renderer/RendererRegistry.js'], _modules['Core/Scrollbar.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Axis, Chart, Color, H, NavigatorAxis, D, Palette, RendererRegistry, Scrollbar, Series, SeriesRegistry, U) {
7076
+ _registerModule(_modules, 'Core/Navigator.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Color/Color.js'], _modules['Core/Globals.js'], _modules['Core/Axis/NavigatorAxis.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Renderer/RendererRegistry.js'], _modules['Core/Scrollbar.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Axis, Chart, Color, H, NavigatorAxis, D, RendererRegistry, Scrollbar, Series, SeriesRegistry, U) {
6160
7077
  /* *
6161
7078
  *
6162
7079
  * (c) 2010-2021 Torstein Honsi
@@ -6364,13 +7281,13 @@
6364
7281
  *
6365
7282
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
6366
7283
  */
6367
- backgroundColor: Palette.neutralColor5,
7284
+ backgroundColor: "#f2f2f2" /* neutralColor5 */,
6368
7285
  /**
6369
7286
  * The stroke for the handle border and the stripes inside.
6370
7287
  *
6371
7288
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
6372
7289
  */
6373
- borderColor: Palette.neutralColor40
7290
+ borderColor: "#999999" /* neutralColor40 */
6374
7291
  },
6375
7292
  /**
6376
7293
  * The color of the mask covering the areas of the navigator series
@@ -6387,7 +7304,7 @@
6387
7304
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
6388
7305
  * @default rgba(102,133,194,0.3)
6389
7306
  */
6390
- maskFill: color(Palette.highlightColor60).setOpacity(0.3).get(),
7307
+ maskFill: color("#6685c2" /* highlightColor60 */).setOpacity(0.3).get(),
6391
7308
  /**
6392
7309
  * The color of the line marking the currently zoomed area in the
6393
7310
  * navigator.
@@ -6398,7 +7315,7 @@
6398
7315
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
6399
7316
  * @default #cccccc
6400
7317
  */
6401
- outlineColor: Palette.neutralColor20,
7318
+ outlineColor: "#cccccc" /* neutralColor20 */,
6402
7319
  /**
6403
7320
  * The width of the line marking the currently zoomed area in the
6404
7321
  * navigator.
@@ -6589,7 +7506,7 @@
6589
7506
  className: 'highcharts-navigator-xaxis',
6590
7507
  tickLength: 0,
6591
7508
  lineWidth: 0,
6592
- gridLineColor: Palette.neutralColor10,
7509
+ gridLineColor: "#e6e6e6" /* neutralColor10 */,
6593
7510
  gridLineWidth: 1,
6594
7511
  tickPixelInterval: 200,
6595
7512
  labels: {
@@ -6599,7 +7516,7 @@
6599
7516
  */
6600
7517
  style: {
6601
7518
  /** @ignore */
6602
- color: Palette.neutralColor40
7519
+ color: "#999999" /* neutralColor40 */
6603
7520
  },
6604
7521
  x: 3,
6605
7522
  y: -4
@@ -6782,17 +7699,32 @@
6782
7699
  verticalMin = navigatorTop + zoomedMax + outlineCorrection;
6783
7700
  zoomedMax = navigatorTop + zoomedMin + outlineCorrection;
6784
7701
  path = [
6785
- ['M', left + outlineHeight, navigatorTop - scrollbarHeight - outlineCorrection],
7702
+ [
7703
+ 'M',
7704
+ left + outlineHeight,
7705
+ navigatorTop - scrollbarHeight - outlineCorrection
7706
+ ],
7707
+ // top right of zoomed range
6786
7708
  ['L', left + outlineHeight, verticalMin],
6787
7709
  ['L', left, verticalMin],
6788
7710
  ['L', left, zoomedMax],
6789
7711
  ['L', left + outlineHeight, zoomedMax],
6790
- ['L', left + outlineHeight, navigatorTop + navigatorSize + scrollbarHeight]
7712
+ [
7713
+ 'L',
7714
+ left + outlineHeight,
7715
+ navigatorTop + navigatorSize + scrollbarHeight
7716
+ ]
6791
7717
  ];
6792
7718
  if (maskInside) {
6793
- path.push(['M', left + outlineHeight, verticalMin - halfOutline], // upper left of zoomed range
6794
- ['L', left + outlineHeight, zoomedMax + halfOutline] // upper right of z.r.
6795
- );
7719
+ path.push(
7720
+ // upper left of zoomed range
7721
+ ['M', left + outlineHeight, verticalMin - halfOutline],
7722
+ // upper right of z.r.
7723
+ [
7724
+ 'L',
7725
+ left + outlineHeight,
7726
+ zoomedMax + halfOutline
7727
+ ]);
6796
7728
  }
6797
7729
  }
6798
7730
  else {
@@ -6800,17 +7732,25 @@
6800
7732
  zoomedMax += left + scrollbarHeight - outlineCorrection;
6801
7733
  navigatorTop += halfOutline;
6802
7734
  path = [
7735
+ // left
6803
7736
  ['M', left, navigatorTop],
7737
+ // upper left of zoomed range
6804
7738
  ['L', zoomedMin, navigatorTop],
7739
+ // lower left of z.r.
6805
7740
  ['L', zoomedMin, navigatorTop + outlineHeight],
7741
+ // lower right of z.r.
6806
7742
  ['L', zoomedMax, navigatorTop + outlineHeight],
7743
+ // upper right of z.r.
6807
7744
  ['L', zoomedMax, navigatorTop],
6808
- ['L', left + navigatorSize + scrollbarHeight * 2, navigatorTop] // right
7745
+ // right
7746
+ ['L', left + navigatorSize + scrollbarHeight * 2, navigatorTop]
6809
7747
  ];
6810
7748
  if (maskInside) {
6811
- path.push(['M', zoomedMin - halfOutline, navigatorTop], // upper left of zoomed range
6812
- ['L', zoomedMax + halfOutline, navigatorTop] // upper right of z.r.
6813
- );
7749
+ path.push(
7750
+ // upper left of zoomed range
7751
+ ['M', zoomedMin - halfOutline, navigatorTop],
7752
+ // upper right of z.r.
7753
+ ['L', zoomedMax + halfOutline, navigatorTop]);
6814
7754
  }
6815
7755
  }
6816
7756
  navigator.outline[verb]({
@@ -6996,7 +7936,6 @@
6996
7936
  * Pixel value minimum
6997
7937
  * @param {number} [pxMax]
6998
7938
  * Pixel value maximum
6999
- * @return {void}
7000
7939
  */
7001
7940
  Navigator.prototype.render = function (min, max, pxMin, pxMax) {
7002
7941
  var navigator = this,
@@ -7273,7 +8212,6 @@
7273
8212
  * Mouse event
7274
8213
  * @param {number} index
7275
8214
  * Index of a handle in Navigator.handles array
7276
- * @return {void}
7277
8215
  */
7278
8216
  Navigator.prototype.handlesMousedown = function (e, index) {
7279
8217
  e = this.chart.pointer.normalize(e);
@@ -7369,7 +8307,6 @@
7369
8307
  * @function Highcharts.Navigator#onMouseUp
7370
8308
  * @param {Highcharts.PointerEventObject} e
7371
8309
  * Mouse event
7372
- * @return {void}
7373
8310
  */
7374
8311
  Navigator.prototype.onMouseUp = function (e) {
7375
8312
  var navigator = this,
@@ -7456,7 +8393,6 @@
7456
8393
  *
7457
8394
  * @private
7458
8395
  * @function Highcharts.Navigator#removeEvents
7459
- * @return {void}
7460
8396
  */
7461
8397
  Navigator.prototype.removeEvents = function () {
7462
8398
  if (this.eventsToUnbind) {
@@ -7472,7 +8408,6 @@
7472
8408
  *
7473
8409
  * @private
7474
8410
  * @function Highcharts.Navigator#removeBaseSeriesEvents
7475
- * @return {void}
7476
8411
  */
7477
8412
  Navigator.prototype.removeBaseSeriesEvents = function () {
7478
8413
  var baseSeries = this.baseSeries || [];
@@ -7558,7 +8493,8 @@
7558
8493
  offset: 0,
7559
8494
  index: yAxisIndex,
7560
8495
  isInternal: true,
7561
- reversed: pick((navigatorOptions.yAxis && navigatorOptions.yAxis.reversed), (chart.yAxis[0] && chart.yAxis[0].reversed), false),
8496
+ reversed: pick((navigatorOptions.yAxis &&
8497
+ navigatorOptions.yAxis.reversed), (chart.yAxis[0] && chart.yAxis[0].reversed), false),
7562
8498
  zoomEnabled: false
7563
8499
  }, chart.inverted ? {
7564
8500
  width: height
@@ -7640,9 +8576,6 @@
7640
8576
  *
7641
8577
  * @private
7642
8578
  * @function Highcharts.Navigator#getUnionExtremes
7643
- * @param {boolean} [returnFalseOnNoBaseSeries]
7644
- * as the param says.
7645
- * @return {Highcharts.Dictionary<(number|undefined)>|undefined}
7646
8579
  */
7647
8580
  Navigator.prototype.getUnionExtremes = function (returnFalseOnNoBaseSeries) {
7648
8581
  var baseAxis = this.chart.xAxis[0],
@@ -7670,7 +8603,6 @@
7670
8603
  * Additional series options for a navigator
7671
8604
  * @param {boolean} [redraw]
7672
8605
  * Whether to redraw after update.
7673
- * @return {void}
7674
8606
  */
7675
8607
  Navigator.prototype.setBaseSeries = function (baseSeriesOptions, redraw) {
7676
8608
  var chart = this.chart,
@@ -7709,7 +8641,6 @@
7709
8641
  * @function Highcharts.Navigator.updateNavigatorSeries
7710
8642
  * @param {boolean} addEvents
7711
8643
  * @param {boolean} [redraw]
7712
- * @return {void}
7713
8644
  */
7714
8645
  Navigator.prototype.updateNavigatorSeries = function (addEvents, redraw) {
7715
8646
  var navigator = this,
@@ -7850,7 +8781,6 @@
7850
8781
  *
7851
8782
  * @private
7852
8783
  * @function Highcharts.Navigator#addBaseSeriesEvent
7853
- * @return {void}
7854
8784
  */
7855
8785
  Navigator.prototype.addBaseSeriesEvents = function () {
7856
8786
  var navigator = this,
@@ -8026,7 +8956,7 @@
8026
8956
  // If range declared, stick to the minimum only if the range
8027
8957
  // is smaller than the data set range.
8028
8958
  if (range && max - xDataMin > 0) {
8029
- stickToMin = max - xDataMin < range && (!this.chart.fixedRange);
8959
+ stickToMin = max - xDataMin < range;
8030
8960
  }
8031
8961
  else {
8032
8962
  // If the current axis minimum falls outside the new
@@ -8044,7 +8974,6 @@
8044
8974
  *
8045
8975
  * @private
8046
8976
  * @function Highcharts.Navigator#addChartEvents
8047
- * @return {void}
8048
8977
  */
8049
8978
  Navigator.prototype.addChartEvents = function () {
8050
8979
  if (!this.eventsToUnbind) {
@@ -8253,7 +9182,7 @@
8253
9182
 
8254
9183
  return H.Navigator;
8255
9184
  });
8256
- _registerModule(_modules, 'Extensions/RangeSelector.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (Axis, Chart, H, D, palette, SVGElement, U) {
9185
+ _registerModule(_modules, 'Extensions/RangeSelector.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (Axis, Chart, H, D, SVGElement, U) {
8257
9186
  /* *
8258
9187
  *
8259
9188
  * (c) 2010-2021 Torstein Honsi
@@ -8743,7 +9672,7 @@
8743
9672
  */
8744
9673
  inputStyle: {
8745
9674
  /** @ignore */
8746
- color: palette.highlightColor80,
9675
+ color: "#335cad" /* highlightColor80 */,
8747
9676
  /** @ignore */
8748
9677
  cursor: 'pointer'
8749
9678
  },
@@ -8760,7 +9689,7 @@
8760
9689
  */
8761
9690
  labelStyle: {
8762
9691
  /** @ignore */
8763
- color: palette.neutralColor60
9692
+ color: "#666666" /* neutralColor60 */
8764
9693
  }
8765
9694
  }
8766
9695
  });
@@ -8843,7 +9772,6 @@
8843
9772
  * @param {number} i
8844
9773
  * The index of the button
8845
9774
  * @param {boolean} [redraw]
8846
- * @return {void}
8847
9775
  */
8848
9776
  RangeSelector.prototype.clickButton = function (i, redraw) {
8849
9777
  var rangeSelector = this,
@@ -8941,7 +9869,8 @@
8941
9869
  // If the navigator exist and the axis range is declared reset that
8942
9870
  // range and from now on only use the range set by a user, #14742.
8943
9871
  if (chart.navigator && chart.navigator.baseSeries[0]) {
8944
- chart.navigator.baseSeries[0].xAxis.options.range = void 0;
9872
+ chart.navigator.baseSeries[0].xAxis.options
9873
+ .range = void 0;
8945
9874
  }
8946
9875
  newMin = dataMin;
8947
9876
  newMax = dataMax;
@@ -8986,7 +9915,6 @@
8986
9915
  * @private
8987
9916
  * @function Highcharts.RangeSelector#setSelected
8988
9917
  * @param {number} [selected]
8989
- * @return {void}
8990
9918
  */
8991
9919
  RangeSelector.prototype.setSelected = function (selected) {
8992
9920
  this.selected = this.options.selected = selected;
@@ -8997,12 +9925,11 @@
8997
9925
  * @private
8998
9926
  * @function Highcharts.RangeSelector#init
8999
9927
  * @param {Highcharts.Chart} chart
9000
- * @return {void}
9001
9928
  */
9002
9929
  RangeSelector.prototype.init = function (chart) {
9003
9930
  var rangeSelector = this,
9004
9931
  options = chart.options.rangeSelector,
9005
- buttonOptions = options.buttons || rangeSelector.defaultButtons.slice(),
9932
+ buttonOptions = (options.buttons || rangeSelector.defaultButtons.slice()),
9006
9933
  selectedOption = options.selected,
9007
9934
  blurInputs = function () {
9008
9935
  var minInput = rangeSelector.minInput,
@@ -9052,7 +9979,6 @@
9052
9979
  *
9053
9980
  * @private
9054
9981
  * @function Highcharts.RangeSelector#updateButtonStates
9055
- * @return {void}
9056
9982
  */
9057
9983
  RangeSelector.prototype.updateButtonStates = function () {
9058
9984
  var rangeSelector = this,
@@ -9158,7 +10084,6 @@
9158
10084
  * @private
9159
10085
  * @function Highcharts.RangeSelector#computeButtonRange
9160
10086
  * @param {Highcharts.RangeSelectorButtonsOptions} rangeOptions
9161
- * @return {void}
9162
10087
  */
9163
10088
  RangeSelector.prototype.computeButtonRange = function (rangeOptions) {
9164
10089
  var type = rangeOptions.type,
@@ -9193,12 +10118,11 @@
9193
10118
  *
9194
10119
  * @private
9195
10120
  * @function Highcharts.RangeSelector#getInputValue
9196
- * @param {string} name
9197
- * @return {number}
9198
10121
  */
9199
10122
  RangeSelector.prototype.getInputValue = function (name) {
9200
10123
  var input = name === 'min' ? this.minInput : this.maxInput;
9201
- var options = this.chart.options.rangeSelector;
10124
+ var options = this.chart.options
10125
+ .rangeSelector;
9202
10126
  var time = this.chart.time;
9203
10127
  if (input) {
9204
10128
  return ((input.type === 'text' && options.inputDateParser) ||
@@ -9211,9 +10135,6 @@
9211
10135
  *
9212
10136
  * @private
9213
10137
  * @function Highcharts.RangeSelector#setInputValue
9214
- * @param {string} name
9215
- * @param {number} [inputTime]
9216
- * @return {void}
9217
10138
  */
9218
10139
  RangeSelector.prototype.setInputValue = function (name, inputTime) {
9219
10140
  var options = this.options, time = this.chart.time, input = name === 'min' ? this.minInput : this.maxInput, dateBox = name === 'min' ? this.minDateBox : this.maxDateBox;
@@ -9228,7 +10149,8 @@
9228
10149
  input.setAttribute('data-hc-time', inputTime);
9229
10150
  updatedTime = inputTime;
9230
10151
  }
9231
- input.value = time.dateFormat(this.inputTypeFormats[input.type] || options.inputEditDateFormat, updatedTime);
10152
+ input.value = time.dateFormat((this.inputTypeFormats[input.type] ||
10153
+ options.inputEditDateFormat), updatedTime);
9232
10154
  if (dateBox) {
9233
10155
  dateBox.attr({
9234
10156
  text: time.dateFormat(options.inputDateFormat, updatedTime)
@@ -9241,10 +10163,6 @@
9241
10163
  *
9242
10164
  * @private
9243
10165
  * @function Highcharts.RangeSelector#setInputExtremes
9244
- * @param {string} name
9245
- * @param {number} min
9246
- * @param {number} max
9247
- * @return {void}
9248
10166
  */
9249
10167
  RangeSelector.prototype.setInputExtremes = function (name, min, max) {
9250
10168
  var input = name === 'min' ? this.minInput : this.maxInput;
@@ -9269,7 +10187,6 @@
9269
10187
  * @private
9270
10188
  * @function Highcharts.RangeSelector#showInput
9271
10189
  * @param {string} name
9272
- * @return {void}
9273
10190
  */
9274
10191
  RangeSelector.prototype.showInput = function (name) {
9275
10192
  var dateBox = name === 'min' ? this.minDateBox : this.maxDateBox;
@@ -9281,7 +10198,9 @@
9281
10198
  translateY = _a.translateY;
9282
10199
  var inputBoxWidth = this.options.inputBoxWidth;
9283
10200
  css(input, {
9284
- width: isTextInput ? ((dateBox.width + (inputBoxWidth ? -2 : 20)) + 'px') : 'auto',
10201
+ width: isTextInput ?
10202
+ ((dateBox.width + (inputBoxWidth ? -2 : 20)) + 'px') :
10203
+ 'auto',
9285
10204
  height: isTextInput ? ((dateBox.height - 2) + 'px') : 'auto',
9286
10205
  border: '2px solid silver'
9287
10206
  });
@@ -9307,7 +10226,6 @@
9307
10226
  * @private
9308
10227
  * @function Highcharts.RangeSelector#hideInput
9309
10228
  * @param {string} name
9310
- * @return {void}
9311
10229
  */
9312
10230
  RangeSelector.prototype.hideInput = function (name) {
9313
10231
  var input = name === 'min' ? this.minInput : this.maxInput;
@@ -9359,8 +10277,6 @@
9359
10277
  *
9360
10278
  * @private
9361
10279
  * @function Highcharts.RangeSelector#drawInput
9362
- * @param {string} name
9363
- * @return {RangeSelectorInputElements}
9364
10280
  */
9365
10281
  RangeSelector.prototype.drawInput = function (name) {
9366
10282
  var _a = this,
@@ -9463,7 +10379,7 @@
9463
10379
  // Styles
9464
10380
  label.css(merge(chartStyle, options.labelStyle));
9465
10381
  dateBox.css(merge({
9466
- color: palette.neutralColor80
10382
+ color: "#333333" /* neutralColor80 */
9467
10383
  }, chartStyle, options.inputStyle));
9468
10384
  css(input, extend({
9469
10385
  position: 'absolute',
@@ -9529,8 +10445,6 @@
9529
10445
  *
9530
10446
  * @private
9531
10447
  * @function Highcharts.RangeSelector#getPosition
9532
- *
9533
- * @return {Highcharts.Dictionary<number>}
9534
10448
  */
9535
10449
  RangeSelector.prototype.getPosition = function () {
9536
10450
  var chart = this.chart,
@@ -9550,13 +10464,8 @@
9550
10464
  *
9551
10465
  * @private
9552
10466
  * @function Highcharts.RangeSelector#getYTDExtremes
9553
- *
9554
- * @param {number} dataMax
9555
- *
9556
- * @param {number} dataMin
9557
- *
9558
10467
  * @return {*}
9559
- * Returns min and max for the YTD
10468
+ * Returns min and max for the YTD
9560
10469
  */
9561
10470
  RangeSelector.prototype.getYTDExtremes = function (dataMax, dataMin, useUTC) {
9562
10471
  var time = this.chart.time,
@@ -9585,7 +10494,6 @@
9585
10494
  * X axis minimum
9586
10495
  * @param {number} [max]
9587
10496
  * X axis maximum
9588
- * @return {void}
9589
10497
  */
9590
10498
  RangeSelector.prototype.render = function (min, max) {
9591
10499
  var chart = this.chart,
@@ -9639,7 +10547,8 @@
9639
10547
  this.setInputValue('min', min);
9640
10548
  this.setInputValue('max', max);
9641
10549
  var unionExtremes = (chart.scroller && chart.scroller.getUnionExtremes()) || chart.xAxis[0] || {};
9642
- if (defined(unionExtremes.dataMin) && defined(unionExtremes.dataMax)) {
10550
+ if (defined(unionExtremes.dataMin) &&
10551
+ defined(unionExtremes.dataMax)) {
9643
10552
  var minRange = chart.xAxis[0].minRange || 0;
9644
10553
  this.setInputExtremes('min', unionExtremes.dataMin, Math.min(unionExtremes.dataMax, this.getInputValue('max')) - minRange);
9645
10554
  this.setInputExtremes('max', Math.max(unionExtremes.dataMin, this.getInputValue('min')) + minRange, unionExtremes.dataMax);
@@ -9672,7 +10581,6 @@
9672
10581
  *
9673
10582
  * @private
9674
10583
  * @function Highcharts.RangeSelector#renderButtons
9675
- * @return {void}
9676
10584
  */
9677
10585
  RangeSelector.prototype.renderButtons = function () {
9678
10586
  var _this = this;
@@ -9773,7 +10681,6 @@
9773
10681
  *
9774
10682
  * @private
9775
10683
  * @function Highcharts.RangeSelector#alignElements
9776
- * @return {void}
9777
10684
  */
9778
10685
  RangeSelector.prototype.alignElements = function () {
9779
10686
  var _this = this;
@@ -9929,7 +10836,6 @@
9929
10836
  * @function Highcharts.RangeSelector#alignButtonGroup
9930
10837
  * @param {number} xOffsetForExportButton
9931
10838
  * @param {number} [width]
9932
- * @return {void}
9933
10839
  */
9934
10840
  RangeSelector.prototype.alignButtonGroup = function (xOffsetForExportButton, width) {
9935
10841
  var _a = this,
@@ -9959,7 +10865,6 @@
9959
10865
  /**
9960
10866
  * @private
9961
10867
  * @function Highcharts.RangeSelector#positionButtons
9962
- * @return {void}
9963
10868
  */
9964
10869
  RangeSelector.prototype.positionButtons = function () {
9965
10870
  var _a = this,
@@ -10000,7 +10905,6 @@
10000
10905
  * @param {number} xOffsetForExportButton
10001
10906
  * The X offset of the group required to make room for the
10002
10907
  * exporting button
10003
- * @return {void}
10004
10908
  */
10005
10909
  RangeSelector.prototype.handleCollision = function (xOffsetForExportButton) {
10006
10910
  var _this = this;
@@ -10101,7 +11005,6 @@
10101
11005
  * @private
10102
11006
  * @function Highcharts.RangeSelector#collapseButtons
10103
11007
  * @param {number} xOffsetForExportButton
10104
- * @return {void}
10105
11008
  */
10106
11009
  RangeSelector.prototype.collapseButtons = function (xOffsetForExportButton) {
10107
11010
  var _a = this,
@@ -10155,7 +11058,6 @@
10155
11058
  *
10156
11059
  * @private
10157
11060
  * @function Highcharts.RangeSelector#expandButtons
10158
- * @return {void}
10159
11061
  */
10160
11062
  RangeSelector.prototype.expandButtons = function () {
10161
11063
  var _a = this,
@@ -10187,7 +11089,6 @@
10187
11089
  *
10188
11090
  * @private
10189
11091
  * @function Highcharts.RangeSelector#currentButtonIndex
10190
- * @return {number}
10191
11092
  */
10192
11093
  RangeSelector.prototype.currentButtonIndex = function () {
10193
11094
  var dropdown = this.dropdown;
@@ -10201,7 +11102,6 @@
10201
11102
  *
10202
11103
  * @private
10203
11104
  * @function Highcharts.RangeSelector#showDropdown
10204
- * @return {void}
10205
11105
  */
10206
11106
  RangeSelector.prototype.showDropdown = function () {
10207
11107
  var _a = this,
@@ -10225,7 +11125,6 @@
10225
11125
  /**
10226
11126
  * @private
10227
11127
  * @function Highcharts.RangeSelector#hideDropdown
10228
- * @return {void}
10229
11128
  */
10230
11129
  RangeSelector.prototype.hideDropdown = function () {
10231
11130
  var dropdown = this.dropdown;
@@ -10244,7 +11143,7 @@
10244
11143
  * @private
10245
11144
  * @function Highcharts.RangeSelector#getHeight
10246
11145
  * @return {number}
10247
- * Returns rangeSelector height
11146
+ * Returns rangeSelector height
10248
11147
  */
10249
11148
  RangeSelector.prototype.getHeight = function () {
10250
11149
  var rangeSelector = this,
@@ -10280,11 +11179,8 @@
10280
11179
  *
10281
11180
  * @private
10282
11181
  * @function Highcharts.RangeSelector#titleCollision
10283
- *
10284
- * @param {Highcharts.Chart} chart
10285
- *
10286
11182
  * @return {boolean}
10287
- * Returns collision status
11183
+ * Returns collision status
10288
11184
  */
10289
11185
  RangeSelector.prototype.titleCollision = function (chart) {
10290
11186
  return !(chart.options.title.text ||
@@ -10296,7 +11192,6 @@
10296
11192
  * @private
10297
11193
  * @function Highcharts.RangeSelector#update
10298
11194
  * @param {Highcharts.RangeSelectorOptions} options
10299
- * @return {void}
10300
11195
  */
10301
11196
  RangeSelector.prototype.update = function (options) {
10302
11197
  var chart = this.chart;
@@ -10392,17 +11287,14 @@
10392
11287
  *
10393
11288
  * @private
10394
11289
  * @function preferredInputType
10395
- * @param {string} format
10396
- * @return {string}
10397
11290
  */
10398
11291
  function preferredInputType(format) {
10399
11292
  var ms = format.indexOf('%L') !== -1;
10400
11293
  if (ms) {
10401
11294
  return 'text';
10402
11295
  }
10403
- var date = ['a', 'A', 'd', 'e', 'w', 'b', 'B', 'm', 'o', 'y', 'Y'].some(function (char) {
10404
- return format.indexOf('%' + char) !== -1;
10405
- });
11296
+ var date = ['a', 'A', 'd', 'e', 'w', 'b', 'B', 'm', 'o', 'y', 'Y']
11297
+ .some(function (char) { return format.indexOf('%' + char) !== -1; });
10406
11298
  var time = ['H', 'k', 'I', 'l', 'M', 'S'].some(function (char) {
10407
11299
  return format.indexOf('%' + char) !== -1;
10408
11300
  });
@@ -10439,7 +11331,8 @@
10439
11331
  // Get the true range from a start date
10440
11332
  getTrueRange = function (base,
10441
11333
  count) {
10442
- var timeName = type === 'year' ? 'FullYear' : 'Month';
11334
+ var timeName = type === 'year' ?
11335
+ 'FullYear' : 'Month';
10443
11336
  var date = new time.Date(base);
10444
11337
  var basePeriod = time.get(timeName,
10445
11338
  date);
@@ -10646,7 +11539,7 @@
10646
11539
 
10647
11540
  return RangeSelector;
10648
11541
  });
10649
- _registerModule(_modules, 'Core/Chart/StockChart.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/FormatUtilities.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Point.js'], _modules['Core/Series/Series.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (A, Axis, Chart, F, D, Palette, Point, Series, SVGRenderer, U) {
11542
+ _registerModule(_modules, 'Core/Chart/StockChart.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/FormatUtilities.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Series/Series.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (A, Axis, Chart, F, D, Series, SVGRenderer, U) {
10650
11543
  /* *
10651
11544
  *
10652
11545
  * (c) 2010-2021 Torstein Honsi
@@ -10675,13 +11568,7 @@
10675
11568
  var animObject = A.animObject;
10676
11569
  var format = F.format;
10677
11570
  var getOptions = D.getOptions;
10678
- var pointTooltipFormatter = Point.prototype.tooltipFormatter;
10679
- var _a = Series.prototype,
10680
- seriesInit = _a.init,
10681
- seriesProcessData = _a.processData;
10682
11571
  var addEvent = U.addEvent,
10683
- arrayMax = U.arrayMax,
10684
- arrayMin = U.arrayMin,
10685
11572
  clamp = U.clamp,
10686
11573
  defined = U.defined,
10687
11574
  extend = U.extend,
@@ -10729,10 +11616,9 @@
10729
11616
  * Function to run when the chart has loaded and and all external
10730
11617
  * images are loaded.
10731
11618
  *
10732
- * @return {void}
10733
11619
  *
10734
- * @fires Highcharts.StockChart#event:init
10735
- * @fires Highcharts.StockChart#event:afterInit
11620
+ * @emits Highcharts.StockChart#event:init
11621
+ * @emits Highcharts.StockChart#event:afterInit
10736
11622
  */
10737
11623
  StockChart.prototype.init = function (userOptions, callback) {
10738
11624
  var defaultOptions = getOptions(),
@@ -10758,7 +11644,8 @@
10758
11644
  },
10759
11645
  scrollbar: {
10760
11646
  // #4988 - check if setOptions was called
10761
- enabled: pick(defaultOptions.scrollbar && defaultOptions.scrollbar.enabled,
11647
+ enabled: pick((defaultOptions.scrollbar &&
11648
+ defaultOptions.scrollbar.enabled),
10762
11649
  true)
10763
11650
  },
10764
11651
  rangeSelector: {
@@ -10787,15 +11674,15 @@
10787
11674
  // apply X axis options to both single and multi y axes
10788
11675
  options.xAxis = splat(userOptions.xAxis || {}).map(function (xAxisOptions, i) {
10789
11676
  return merge(getDefaultAxisOptions('xAxis', xAxisOptions), defaultOptions.xAxis, // #3802
10790
- defaultOptions.xAxis && defaultOptions.xAxis[i], // #7690
10791
- xAxisOptions, // user options
11677
+ // #7690
11678
+ defaultOptions.xAxis && defaultOptions.xAxis[i], xAxisOptions, // user options
10792
11679
  getForcedAxisOptions('xAxis', userOptions));
10793
11680
  });
10794
11681
  // apply Y axis options to both single and multi y axes
10795
11682
  options.yAxis = splat(userOptions.yAxis || {}).map(function (yAxisOptions, i) {
10796
11683
  return merge(getDefaultAxisOptions('yAxis', yAxisOptions), defaultOptions.yAxis, // #3802
10797
- defaultOptions.yAxis && defaultOptions.yAxis[i], // #7690
10798
- yAxisOptions // user options
11684
+ // #7690
11685
+ defaultOptions.yAxis && defaultOptions.yAxis[i], yAxisOptions // user options
10799
11686
  );
10800
11687
  });
10801
11688
  _super.prototype.init.call(this, options, callback);
@@ -10806,14 +11693,10 @@
10806
11693
  *
10807
11694
  * @private
10808
11695
  * @function Highcharts.StockChart#createAxis
10809
- *
10810
11696
  * @param {string} type
10811
- * An axis type.
10812
- *
11697
+ * An axis type.
10813
11698
  * @param {Chart.CreateAxisOptionsObject} options
10814
- * The axis creation options.
10815
- *
10816
- * @return {Highcharts.Axis | Highcharts.ColorAxis}
11699
+ * The axis creation options.
10817
11700
  */
10818
11701
  StockChart.prototype.createAxis = function (type, options) {
10819
11702
  options.axis = merge(getDefaultAxisOptions(type, options.axis), options.axis, getForcedAxisOptions(type, this.userOptions));
@@ -10869,9 +11752,6 @@
10869
11752
  *
10870
11753
  * @private
10871
11754
  * @function getDefaultAxisOptions
10872
- * @param {string} type
10873
- * @param {Highcharts.AxisOptions} options
10874
- * @return {Highcharts.AxisOptions}
10875
11755
  */
10876
11756
  function getDefaultAxisOptions(type, options) {
10877
11757
  if (type === 'xAxis') {
@@ -10918,9 +11798,6 @@
10918
11798
  *
10919
11799
  * @private
10920
11800
  * @function getForcedAxisOptions
10921
- * @param {string} type
10922
- * @param {Highcharts.Options} chartOptions
10923
- * @return {Highcharts.AxisOptions}
10924
11801
  */
10925
11802
  function getForcedAxisOptions(type, chartOptions) {
10926
11803
  if (type === 'xAxis') {
@@ -11139,9 +12016,6 @@
11139
12016
  *
11140
12017
  * @private
11141
12018
  * @function Highcharts.SVGRenderer#crispPolyLine
11142
- * @param {Highcharts.SVGPathArray} points
11143
- * @param {number} width
11144
- * @return {Highcharts.SVGPathArray}
11145
12019
  */
11146
12020
  SVGRenderer.prototype.crispPolyLine = function (points, width) {
11147
12021
  // points format: [['M', 0, 0], ['L', 100, 0]]
@@ -11215,12 +12089,12 @@
11215
12089
  .attr({
11216
12090
  fill: options.backgroundColor ||
11217
12091
  point && point.series && point.series.color || // #14888
11218
- Palette.neutralColor60,
12092
+ "#666666" /* neutralColor60 */,
11219
12093
  stroke: options.borderColor || '',
11220
12094
  'stroke-width': options.borderWidth || 0
11221
12095
  })
11222
12096
  .css(extend({
11223
- color: Palette.backgroundColor,
12097
+ color: "#ffffff" /* backgroundColor */,
11224
12098
  fontWeight: 'normal',
11225
12099
  fontSize: '11px',
11226
12100
  textAlign: 'center'
@@ -11313,76 +12187,6 @@
11313
12187
  posy + crossBox.height / 2
11314
12188
  });
11315
12189
  });
11316
- /* ************************************************************************** *
11317
- * Start value compare logic *
11318
- * ************************************************************************** */
11319
- /**
11320
- * Extend series.init by adding a method to modify the y value used for plotting
11321
- * on the y axis. This method is called both from the axis when finding dataMin
11322
- * and dataMax, and from the series.translate method.
11323
- *
11324
- * @ignore
11325
- * @function Highcharts.Series#init
11326
- */
11327
- Series.prototype.init = function () {
11328
- // Call base method
11329
- seriesInit.apply(this, arguments);
11330
- // Set comparison mode
11331
- this.initCompare(this.options.compare);
11332
- };
11333
- /**
11334
- * Highcharts Stock only. Set the
11335
- * [compare](https://api.highcharts.com/highstock/plotOptions.series.compare)
11336
- * mode of the series after render time. In most cases it is more useful running
11337
- * {@link Axis#setCompare} on the X axis to update all its series.
11338
- *
11339
- * @function Highcharts.Series#setCompare
11340
- *
11341
- * @param {string} [compare]
11342
- * Can be one of `null` (default), `"percent"` or `"value"`.
11343
- */
11344
- Series.prototype.setCompare = function (compare) {
11345
- this.initCompare(compare);
11346
- // Survive to export, #5485
11347
- this.userOptions.compare = compare;
11348
- };
11349
- /**
11350
- * @ignore
11351
- * @function Highcharts.Series#initCompare
11352
- *
11353
- * @param {string} [compare]
11354
- * Can be one of `null` (default), `"percent"` or `"value"`.
11355
- */
11356
- Series.prototype.initCompare = function (compare) {
11357
- // Set or unset the modifyValue method
11358
- this.modifyValue = (compare === 'value' || compare === 'percent') ?
11359
- function (value, point) {
11360
- var compareValue = this.compareValue;
11361
- if (typeof value !== 'undefined' &&
11362
- typeof compareValue !== 'undefined') { // #2601, #5814
11363
- // Get the modified value
11364
- if (compare === 'value') {
11365
- value -= compareValue;
11366
- // Compare percent
11367
- }
11368
- else {
11369
- value = 100 * (value / compareValue) -
11370
- (this.options.compareBase === 100 ? 0 : 100);
11371
- }
11372
- // record for tooltip etc.
11373
- if (point) {
11374
- point.change = value;
11375
- }
11376
- return value;
11377
- }
11378
- return 0;
11379
- } :
11380
- null;
11381
- // Mark dirty
11382
- if (this.chart.hasRendered) {
11383
- this.isDirty = true;
11384
- }
11385
- };
11386
12190
  /**
11387
12191
  * Based on the data grouping options decides whether
11388
12192
  * the data should be cropped while processing.
@@ -11399,173 +12203,6 @@
11399
12203
  chart.options.isStock);
11400
12204
  return groupingEnabled;
11401
12205
  };
11402
- /**
11403
- * Extend series.processData by finding the first y value in the plot area,
11404
- * used for comparing the following values
11405
- *
11406
- * @ignore
11407
- * @function Highcharts.Series#processData
11408
- */
11409
- Series.prototype.processData = function (force) {
11410
- var series = this,
11411
- i,
11412
- keyIndex = -1,
11413
- processedXData,
11414
- processedYData,
11415
- compareStart = series.options.compareStart === true ? 0 : 1,
11416
- length,
11417
- compareValue;
11418
- // call base method
11419
- seriesProcessData.apply(this, arguments);
11420
- if (series.xAxis && series.processedYData) { // not pies
11421
- // local variables
11422
- processedXData = series.processedXData;
11423
- processedYData = series.processedYData;
11424
- length = processedYData.length;
11425
- // For series with more than one value (range, OHLC etc), compare
11426
- // against close or the pointValKey (#4922, #3112, #9854)
11427
- if (series.pointArrayMap) {
11428
- keyIndex = series.pointArrayMap.indexOf(series.options.pointValKey || series.pointValKey || 'y');
11429
- }
11430
- // find the first value for comparison
11431
- for (i = 0; i < length - compareStart; i++) {
11432
- compareValue = processedYData[i] && keyIndex > -1 ?
11433
- processedYData[i][keyIndex] :
11434
- processedYData[i];
11435
- if (isNumber(compareValue) &&
11436
- processedXData[i + compareStart] >=
11437
- series.xAxis.min &&
11438
- compareValue !== 0) {
11439
- series.compareValue = compareValue;
11440
- break;
11441
- }
11442
- }
11443
- }
11444
- return;
11445
- };
11446
- // Modify series extremes
11447
- addEvent(Series, 'afterGetExtremes', function (e) {
11448
- var dataExtremes = e.dataExtremes;
11449
- if (this.modifyValue && dataExtremes) {
11450
- var extremes = [
11451
- this.modifyValue(dataExtremes.dataMin),
11452
- this.modifyValue(dataExtremes.dataMax)
11453
- ];
11454
- dataExtremes.dataMin = arrayMin(extremes);
11455
- dataExtremes.dataMax = arrayMax(extremes);
11456
- }
11457
- });
11458
- /**
11459
- * Highcharts Stock only. Set the compare mode on all series
11460
- * belonging to an Y axis after render time.
11461
- *
11462
- * @see [series.plotOptions.compare](https://api.highcharts.com/highstock/series.plotOptions.compare)
11463
- *
11464
- * @sample stock/members/axis-setcompare/
11465
- * Set compoare
11466
- *
11467
- * @function Highcharts.Axis#setCompare
11468
- *
11469
- * @param {string} [compare]
11470
- * The compare mode. Can be one of `null` (default), `"value"` or
11471
- * `"percent"`.
11472
- *
11473
- * @param {boolean} [redraw=true]
11474
- * Whether to redraw the chart or to wait for a later call to
11475
- * {@link Chart#redraw}.
11476
- */
11477
- Axis.prototype.setCompare = function (compare, redraw) {
11478
- if (!this.isXAxis) {
11479
- this.series.forEach(function (series) {
11480
- series.setCompare(compare);
11481
- });
11482
- if (pick(redraw, true)) {
11483
- this.chart.redraw();
11484
- }
11485
- }
11486
- };
11487
- /**
11488
- * Extend the tooltip formatter by adding support for the point.change variable
11489
- * as well as the changeDecimals option.
11490
- *
11491
- * @ignore
11492
- * @function Highcharts.Point#tooltipFormatter
11493
- *
11494
- * @param {string} pointFormat
11495
- */
11496
- Point.prototype.tooltipFormatter = function (pointFormat) {
11497
- var point = this;
11498
- var numberFormatter = point.series.chart.numberFormatter;
11499
- pointFormat = pointFormat.replace('{point.change}', (point.change > 0 ? '+' : '') + numberFormatter(point.change, pick(point.series.tooltipOptions.changeDecimals, 2)));
11500
- return pointTooltipFormatter.apply(this, [pointFormat]);
11501
- };
11502
- /* ************************************************************************** *
11503
- * End value compare logic *
11504
- * ************************************************************************** */
11505
- // Extend the Series prototype to create a separate series clip box. This is
11506
- // related to using multiple panes, and a future pane logic should incorporate
11507
- // this feature (#2754).
11508
- addEvent(Series, 'render', function () {
11509
- var chart = this.chart,
11510
- clipHeight;
11511
- // Only do this on not 3d (#2939, #5904) nor polar (#6057) charts, and only
11512
- // if the series type handles clipping in the animate method (#2975).
11513
- if (!(chart.is3d && chart.is3d()) &&
11514
- !chart.polar &&
11515
- this.xAxis &&
11516
- !this.xAxis.isRadial && // Gauge, #6192
11517
- this.options.clip !== false // #15128
11518
- ) {
11519
- clipHeight = this.yAxis.len;
11520
- // Include xAxis line width (#8031) but only if the Y axis ends on the
11521
- // edge of the X axis (#11005).
11522
- if (this.xAxis.axisLine) {
11523
- var dist = chart.plotTop + chart.plotHeight -
11524
- this.yAxis.pos - this.yAxis.len,
11525
- lineHeightCorrection = Math.floor(this.xAxis.axisLine.strokeWidth() / 2);
11526
- if (dist >= 0) {
11527
- clipHeight -= Math.max(lineHeightCorrection - dist, 0);
11528
- }
11529
- }
11530
- // First render, initial clip box. clipBox also needs to be updated if
11531
- // the series is rendered again before starting animating, in
11532
- // compliance with a responsive rule (#13858).
11533
- if (!chart.hasLoaded || (!this.clipBox && this.isDirty && !this.isDirtyData)) {
11534
- this.clipBox = this.clipBox || merge(chart.clipBox);
11535
- this.clipBox.width = this.xAxis.len;
11536
- this.clipBox.height = clipHeight;
11537
- }
11538
- if (chart.hasRendered) {
11539
- var animation = animObject(this.options.animation);
11540
- // #15435: this.sharedClipKey might not have been set yet, for
11541
- // example when updating the series, so we need to use this
11542
- // function instead
11543
- var sharedClipKey = this.getSharedClipKey(animation);
11544
- var clipRect = chart.sharedClips[sharedClipKey];
11545
- // On redrawing, resizing etc, update the clip rectangle.
11546
- //
11547
- // #15435: Update it even when we are creating/updating clipBox,
11548
- // since there could be series updating and pane size changes
11549
- // happening at the same time and we dont destroy shared clips in
11550
- // stock.
11551
- if (clipRect) {
11552
- // animate in case resize is done during initial animation
11553
- clipRect.animate({
11554
- width: this.xAxis.len,
11555
- height: clipHeight
11556
- });
11557
- var markerClipRect = chart.sharedClips[sharedClipKey + 'm'];
11558
- // also change markers clip animation for consistency
11559
- // (marker clip rects should exist only on chart init)
11560
- if (markerClipRect) {
11561
- markerClipRect.animate({
11562
- width: this.xAxis.len
11563
- });
11564
- }
11565
- }
11566
- }
11567
- }
11568
- });
11569
12206
  addEvent(Chart, 'update', function (e) {
11570
12207
  var options = e.options;
11571
12208
  // Use case: enabling scrollbar from a disabled state.
@@ -11582,68 +12219,10 @@
11582
12219
  * Default Export
11583
12220
  *
11584
12221
  * */
11585
- /* *
11586
- *
11587
- * API Options
11588
- *
11589
- * */
11590
- /**
11591
- * Compare the values of the series against the first non-null, non-
11592
- * zero value in the visible range. The y axis will show percentage
11593
- * or absolute change depending on whether `compare` is set to `"percent"`
11594
- * or `"value"`. When this is applied to multiple series, it allows
11595
- * comparing the development of the series against each other. Adds
11596
- * a `change` field to every point object.
11597
- *
11598
- * @see [compareBase](#plotOptions.series.compareBase)
11599
- * @see [Axis.setCompare()](/class-reference/Highcharts.Axis#setCompare)
11600
- *
11601
- * @sample {highstock} stock/plotoptions/series-compare-percent/
11602
- * Percent
11603
- * @sample {highstock} stock/plotoptions/series-compare-value/
11604
- * Value
11605
- *
11606
- * @type {string}
11607
- * @since 1.0.1
11608
- * @product highstock
11609
- * @apioption plotOptions.series.compare
11610
- */
11611
- /**
11612
- * Defines if comparison should start from the first point within the visible
11613
- * range or should start from the first point **before** the range.
11614
- *
11615
- * In other words, this flag determines if first point within the visible range
11616
- * will have 0% (`compareStart=true`) or should have been already calculated
11617
- * according to the previous point (`compareStart=false`).
11618
- *
11619
- * @sample {highstock} stock/plotoptions/series-comparestart/
11620
- * Calculate compare within visible range
11621
- *
11622
- * @type {boolean}
11623
- * @default false
11624
- * @since 6.0.0
11625
- * @product highstock
11626
- * @apioption plotOptions.series.compareStart
11627
- */
11628
- /**
11629
- * When [compare](#plotOptions.series.compare) is `percent`, this option
11630
- * dictates whether to use 0 or 100 as the base of comparison.
11631
- *
11632
- * @sample {highstock} stock/plotoptions/series-comparebase/
11633
- * Compare base is 100
11634
- *
11635
- * @type {number}
11636
- * @default 0
11637
- * @since 5.0.6
11638
- * @product highstock
11639
- * @validvalue [0, 100]
11640
- * @apioption plotOptions.series.compareBase
11641
- */
11642
- ''; // keeps doclets above in transpiled file
11643
12222
 
11644
12223
  return StockChart;
11645
12224
  });
11646
- _registerModule(_modules, 'masters/modules/stock.src.js', [_modules['Core/Globals.js'], _modules['Core/Axis/OrdinalAxis.js'], _modules['Core/Scrollbar.js'], _modules['Core/Chart/StockChart.js']], function (Highcharts, OrdinalAxis, Scrollbar, StockChart) {
12225
+ _registerModule(_modules, 'masters/modules/stock.src.js', [_modules['Core/Globals.js'], _modules['Core/Axis/OrdinalAxis.js'], _modules['Series/DataModifyComposition.js'], _modules['Core/Scrollbar.js'], _modules['Core/Chart/StockChart.js']], function (Highcharts, OrdinalAxis, DataModifyComposition, Scrollbar, StockChart) {
11647
12226
 
11648
12227
  var G = Highcharts;
11649
12228
  // Classes
@@ -11652,6 +12231,7 @@
11652
12231
  // Compositions
11653
12232
  Scrollbar.compose(G.Axis);
11654
12233
  OrdinalAxis.compose(G.Axis, G.Series, G.Chart);
12234
+ DataModifyComposition.compose(G.Series, G.Axis, G.Point);
11655
12235
 
11656
12236
  });
11657
12237
  }));