highcharts 7.1.1 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/bower.json +1 -1
  2. package/css/annotations/popup.css +3 -3
  3. package/css/annotations/popup.scss +1 -1
  4. package/css/stocktools/gui.css +5 -5
  5. package/css/stocktools/gui.scss +1 -1
  6. package/es-modules/annotations/ControlPoint.js +1 -1
  7. package/es-modules/annotations/MockPoint.js +45 -12
  8. package/es-modules/annotations/annotations.src.js +203 -166
  9. package/es-modules/annotations/controllable/ControllableCircle.js +2 -10
  10. package/es-modules/annotations/controllable/ControllableImage.js +2 -10
  11. package/es-modules/annotations/controllable/ControllableLabel.js +54 -9
  12. package/es-modules/annotations/controllable/ControllableRect.js +2 -10
  13. package/es-modules/annotations/controllable/controllableMixin.js +32 -4
  14. package/es-modules/annotations/controllable/markerMixin.js +1 -0
  15. package/es-modules/annotations/eventEmitterMixin.js +1 -0
  16. package/es-modules/annotations/navigationBindings.js +15 -11
  17. package/es-modules/annotations/popup.js +59 -81
  18. package/es-modules/annotations/types/CrookedLine.js +19 -7
  19. package/es-modules/annotations/types/ElliottWave.js +7 -6
  20. package/es-modules/annotations/types/Fibonacci.js +14 -14
  21. package/es-modules/annotations/types/InfinityLine.js +4 -4
  22. package/es-modules/annotations/types/Measure.js +41 -41
  23. package/es-modules/annotations/types/Pitchfork.js +5 -4
  24. package/es-modules/annotations/types/VerticalLine.js +6 -5
  25. package/es-modules/error-messages.js +6 -1
  26. package/es-modules/indicators/indicators.src.js +5 -3
  27. package/es-modules/mixins/nodes.js +16 -8
  28. package/es-modules/modules/accessibility/AccessibilityComponent.js +4 -4
  29. package/es-modules/modules/accessibility/KeyboardNavigation.js +17 -4
  30. package/es-modules/modules/accessibility/components/RangeSelectorComponent.js +3 -2
  31. package/es-modules/modules/accessibility/components/SeriesComponent.js +110 -2
  32. package/es-modules/modules/accessibility/components/ZoomComponent.js +1 -1
  33. package/es-modules/modules/accessibility/options.js +2 -1
  34. package/es-modules/modules/bellcurve.src.js +27 -29
  35. package/es-modules/modules/boost/boost-init.js +14 -0
  36. package/es-modules/modules/boost/boost-overrides.js +13 -3
  37. package/es-modules/modules/boost/wgl-renderer.js +30 -15
  38. package/es-modules/modules/boost/wgl-shader.js +33 -16
  39. package/es-modules/modules/boost/wgl-vbuffer.js +8 -4
  40. package/es-modules/modules/broken-axis.src.js +1 -1
  41. package/es-modules/modules/bullet.src.js +68 -68
  42. package/es-modules/modules/cylinder.src.js +3 -1
  43. package/es-modules/modules/data.src.js +9 -5
  44. package/es-modules/modules/draggable-points.src.js +1 -1
  45. package/es-modules/modules/drilldown.src.js +1 -1
  46. package/es-modules/modules/export-data.src.js +7 -8
  47. package/es-modules/modules/exporting.src.js +9 -1
  48. package/es-modules/modules/full-screen.src.js +1 -1
  49. package/es-modules/modules/funnel3d.src.js +10 -3
  50. package/es-modules/modules/histogram.src.js +162 -164
  51. package/es-modules/modules/item-series.src.js +10 -10
  52. package/es-modules/modules/networkgraph/layouts.js +16 -12
  53. package/es-modules/modules/networkgraph/networkgraph.src.js +147 -51
  54. package/es-modules/modules/offline-exporting.src.js +15 -2
  55. package/es-modules/modules/oldie-polyfills.src.js +1 -1
  56. package/es-modules/modules/organization.src.js +65 -20
  57. package/es-modules/modules/pareto.src.js +52 -51
  58. package/es-modules/modules/pattern-fill.src.js +1 -1
  59. package/es-modules/modules/price-indicator.src.js +1 -1
  60. package/es-modules/modules/pyramid3d.src.js +1 -1
  61. package/es-modules/modules/sankey.src.js +22 -10
  62. package/es-modules/modules/series-label.src.js +16 -8
  63. package/es-modules/modules/solid-gauge.src.js +128 -79
  64. package/es-modules/modules/static-scale.src.js +8 -1
  65. package/es-modules/modules/stock-tools-gui.js +1 -1
  66. package/es-modules/modules/streamgraph.src.js +11 -11
  67. package/es-modules/modules/sunburst.src.js +23 -2
  68. package/es-modules/modules/tilemap.src.js +58 -57
  69. package/es-modules/modules/timeline.src.js +17 -12
  70. package/es-modules/modules/treemap.src.js +6 -6
  71. package/es-modules/modules/variwide.src.js +39 -39
  72. package/es-modules/modules/vector.src.js +108 -107
  73. package/es-modules/modules/venn.src.js +4 -2
  74. package/es-modules/modules/windbarb.src.js +43 -43
  75. package/es-modules/modules/wordcloud.src.js +1 -0
  76. package/es-modules/modules/xrange.src.js +112 -104
  77. package/es-modules/parts/AreaSeries.js +4 -1
  78. package/es-modules/parts/Axis.js +809 -1870
  79. package/es-modules/parts/Chart.js +254 -743
  80. package/es-modules/parts/Color.js +160 -113
  81. package/es-modules/parts/ColumnSeries.js +9 -3
  82. package/es-modules/parts/DataLabels.js +31 -2
  83. package/es-modules/parts/Dynamics.js +73 -26
  84. package/es-modules/parts/FlagsSeries.js +6 -4
  85. package/es-modules/parts/Globals.js +20 -36
  86. package/es-modules/parts/Html.js +116 -235
  87. package/es-modules/parts/Interaction.js +17 -7
  88. package/es-modules/parts/Legend.js +277 -632
  89. package/es-modules/parts/MSPointer.js +62 -106
  90. package/es-modules/parts/Options.js +128 -367
  91. package/es-modules/parts/OrdinalAxis.js +12 -0
  92. package/es-modules/parts/PieSeries.js +61 -44
  93. package/es-modules/parts/PlotLineOrBand.js +38 -3
  94. package/es-modules/parts/Point.js +117 -227
  95. package/es-modules/parts/Pointer.js +273 -558
  96. package/es-modules/parts/RangeSelector.js +5 -3
  97. package/es-modules/parts/Responsive.js +8 -4
  98. package/es-modules/parts/ScrollablePlotArea.js +215 -81
  99. package/es-modules/parts/Scrollbar.js +38 -23
  100. package/es-modules/parts/Series.js +151 -47
  101. package/es-modules/parts/Stacking.js +8 -3
  102. package/es-modules/parts/StockChart.js +42 -29
  103. package/es-modules/parts/SvgRenderer.js +1080 -2100
  104. package/es-modules/parts/Tick.js +11 -4
  105. package/es-modules/parts/Time.js +179 -363
  106. package/es-modules/parts/Tooltip.js +23 -12
  107. package/es-modules/parts/TouchPointer.js +69 -187
  108. package/es-modules/parts/Utilities.js +593 -846
  109. package/es-modules/parts-3d/Axis.js +2 -2
  110. package/es-modules/parts-3d/Column.js +18 -8
  111. package/es-modules/parts-gantt/GanttSeries.js +17 -21
  112. package/es-modules/parts-gantt/GridAxis.js +183 -101
  113. package/es-modules/parts-gantt/PathfinderAlgorithms.js +2 -2
  114. package/es-modules/parts-gantt/TreeGrid.js +53 -36
  115. package/es-modules/parts-map/ColorAxis.js +35 -14
  116. package/es-modules/parts-map/MapBubbleSeries.js +2 -1
  117. package/es-modules/parts-map/MapSeries.js +29 -18
  118. package/es-modules/parts-more/AreaRangeSeries.js +13 -12
  119. package/es-modules/parts-more/ColumnRangeSeries.js +8 -2
  120. package/es-modules/parts-more/GaugeSeries.js +9 -9
  121. package/es-modules/parts-more/PackedBubbleSeries.js +152 -115
  122. package/es-modules/parts-more/RadialAxis.js +102 -8
  123. package/es-modules/parts-more/WaterfallSeries.js +148 -35
  124. package/highcharts-3d.js +68 -67
  125. package/highcharts-3d.js.map +1 -1
  126. package/highcharts-3d.src.js +21 -11
  127. package/highcharts-gantt.d.ts +5 -3
  128. package/highcharts-gantt.js +618 -610
  129. package/highcharts-gantt.js.map +1 -1
  130. package/highcharts-gantt.src.d.ts +5 -3
  131. package/highcharts-gantt.src.js +5185 -8892
  132. package/highcharts-more.js +144 -140
  133. package/highcharts-more.js.map +1 -1
  134. package/highcharts-more.src.js +449 -194
  135. package/highcharts.d.ts +3943 -5236
  136. package/highcharts.js +454 -449
  137. package/highcharts.js.map +1 -1
  138. package/highcharts.src.d.ts +3943 -5236
  139. package/highcharts.src.js +4767 -8601
  140. package/highmaps.d.ts +5 -3
  141. package/highmaps.js +498 -494
  142. package/highmaps.js.map +1 -1
  143. package/highmaps.src.d.ts +5 -3
  144. package/highmaps.src.js +4547 -8507
  145. package/highstock.d.ts +5 -3
  146. package/highstock.js +597 -590
  147. package/highstock.js.map +1 -1
  148. package/highstock.src.d.ts +5 -3
  149. package/highstock.src.js +4871 -8661
  150. package/indicators/acceleration-bands.js +1 -1
  151. package/indicators/acceleration-bands.src.js +1 -1
  152. package/indicators/accumulation-distribution.js +1 -1
  153. package/indicators/accumulation-distribution.src.js +1 -1
  154. package/indicators/ao.js +1 -1
  155. package/indicators/ao.src.js +1 -1
  156. package/indicators/apo.js +1 -1
  157. package/indicators/apo.src.js +1 -1
  158. package/indicators/aroon-oscillator.js +1 -1
  159. package/indicators/aroon-oscillator.src.js +1 -1
  160. package/indicators/aroon.js +1 -1
  161. package/indicators/aroon.src.js +1 -1
  162. package/indicators/atr.js +1 -1
  163. package/indicators/atr.src.js +1 -1
  164. package/indicators/bollinger-bands.js +1 -1
  165. package/indicators/bollinger-bands.src.js +1 -1
  166. package/indicators/cci.js +1 -1
  167. package/indicators/cci.src.js +1 -1
  168. package/indicators/chaikin.js +1 -1
  169. package/indicators/chaikin.src.js +1 -1
  170. package/indicators/cmf.js +1 -1
  171. package/indicators/cmf.src.js +1 -1
  172. package/indicators/dema.js +1 -1
  173. package/indicators/dema.src.js +1 -1
  174. package/indicators/dpo.js +1 -1
  175. package/indicators/dpo.src.js +1 -1
  176. package/indicators/ema.js +1 -1
  177. package/indicators/ema.src.js +1 -1
  178. package/indicators/ichimoku-kinko-hyo.js +1 -1
  179. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  180. package/indicators/indicators-all.js +105 -105
  181. package/indicators/indicators-all.js.map +1 -1
  182. package/indicators/indicators-all.src.js +6 -4
  183. package/indicators/indicators.js +9 -9
  184. package/indicators/indicators.js.map +1 -1
  185. package/indicators/indicators.src.js +6 -4
  186. package/indicators/keltner-channels.js +1 -1
  187. package/indicators/keltner-channels.src.js +1 -1
  188. package/indicators/macd.js +1 -1
  189. package/indicators/macd.src.js +1 -1
  190. package/indicators/mfi.js +1 -1
  191. package/indicators/mfi.src.js +1 -1
  192. package/indicators/momentum.js +1 -1
  193. package/indicators/momentum.src.js +1 -1
  194. package/indicators/natr.js +1 -1
  195. package/indicators/natr.src.js +1 -1
  196. package/indicators/pivot-points.js +1 -1
  197. package/indicators/pivot-points.src.js +1 -1
  198. package/indicators/ppo.js +1 -1
  199. package/indicators/ppo.src.js +1 -1
  200. package/indicators/price-channel.js +1 -1
  201. package/indicators/price-channel.src.js +1 -1
  202. package/indicators/price-envelopes.js +1 -1
  203. package/indicators/price-envelopes.src.js +1 -1
  204. package/indicators/psar.js +1 -1
  205. package/indicators/psar.src.js +1 -1
  206. package/indicators/regressions.js +1 -1
  207. package/indicators/regressions.src.js +1 -1
  208. package/indicators/roc.js +1 -1
  209. package/indicators/roc.src.js +1 -1
  210. package/indicators/rsi.js +1 -1
  211. package/indicators/rsi.src.js +1 -1
  212. package/indicators/stochastic.js +1 -1
  213. package/indicators/stochastic.src.js +1 -1
  214. package/indicators/supertrend.js +1 -1
  215. package/indicators/supertrend.src.js +1 -1
  216. package/indicators/tema.js +1 -1
  217. package/indicators/tema.src.js +1 -1
  218. package/indicators/trix.js +1 -1
  219. package/indicators/trix.src.js +1 -1
  220. package/indicators/volume-by-price.js +1 -1
  221. package/indicators/volume-by-price.src.js +1 -1
  222. package/indicators/vwap.js +1 -1
  223. package/indicators/vwap.src.js +1 -1
  224. package/indicators/williams-r.js +1 -1
  225. package/indicators/williams-r.src.js +1 -1
  226. package/indicators/wma.js +1 -1
  227. package/indicators/wma.src.js +1 -1
  228. package/indicators/zigzag.js +1 -1
  229. package/indicators/zigzag.src.js +1 -1
  230. package/modules/accessibility.js +92 -89
  231. package/modules/accessibility.js.map +1 -1
  232. package/modules/accessibility.src.js +138 -15
  233. package/modules/annotations-advanced.js +128 -127
  234. package/modules/annotations-advanced.js.map +1 -1
  235. package/modules/annotations-advanced.src.js +514 -396
  236. package/modules/annotations.d.ts +36 -0
  237. package/modules/annotations.js +81 -81
  238. package/modules/annotations.js.map +1 -1
  239. package/modules/annotations.src.d.ts +36 -0
  240. package/modules/annotations.src.js +418 -315
  241. package/modules/arrow-symbols.js +1 -1
  242. package/modules/arrow-symbols.src.js +1 -1
  243. package/modules/boost-canvas.js +1 -1
  244. package/modules/boost-canvas.src.js +1 -1
  245. package/modules/boost.js +63 -63
  246. package/modules/boost.js.map +1 -1
  247. package/modules/boost.src.js +99 -39
  248. package/modules/broken-axis.js +1 -1
  249. package/modules/broken-axis.src.js +2 -2
  250. package/modules/bullet.js +1 -1
  251. package/modules/bullet.src.js +69 -69
  252. package/modules/current-date-indicator.js +1 -1
  253. package/modules/current-date-indicator.src.js +1 -1
  254. package/modules/cylinder.js +1 -1
  255. package/modules/cylinder.js.map +1 -1
  256. package/modules/cylinder.src.js +4 -2
  257. package/modules/data.js +4 -4
  258. package/modules/data.js.map +1 -1
  259. package/modules/data.src.js +10 -6
  260. package/modules/datagrouping.js +1 -1
  261. package/modules/datagrouping.src.js +1 -1
  262. package/modules/debugger.js +4 -4
  263. package/modules/debugger.js.map +1 -1
  264. package/modules/debugger.src.js +7 -2
  265. package/modules/dependency-wheel.js +1 -1
  266. package/modules/dependency-wheel.src.js +1 -1
  267. package/modules/dotplot.js +1 -1
  268. package/modules/dotplot.src.js +1 -1
  269. package/modules/drag-panes.js +1 -1
  270. package/modules/drag-panes.src.js +1 -1
  271. package/modules/draggable-points.js +1 -1
  272. package/modules/draggable-points.src.js +2 -2
  273. package/modules/drilldown.js +1 -1
  274. package/modules/drilldown.src.js +2 -2
  275. package/modules/export-data.js +2 -2
  276. package/modules/export-data.js.map +1 -1
  277. package/modules/export-data.src.js +8 -9
  278. package/modules/exporting.js +25 -25
  279. package/modules/exporting.js.map +1 -1
  280. package/modules/exporting.src.js +11 -3
  281. package/modules/full-screen.js +1 -1
  282. package/modules/full-screen.src.js +2 -2
  283. package/modules/funnel.js +1 -1
  284. package/modules/funnel.src.js +1 -1
  285. package/modules/funnel3d.js +2 -2
  286. package/modules/funnel3d.js.map +1 -1
  287. package/modules/funnel3d.src.js +11 -4
  288. package/modules/gantt.js +166 -164
  289. package/modules/gantt.js.map +1 -1
  290. package/modules/gantt.src.js +422 -295
  291. package/modules/grid-axis.js +18 -16
  292. package/modules/grid-axis.js.map +1 -1
  293. package/modules/grid-axis.src.js +184 -102
  294. package/modules/heatmap.js +22 -22
  295. package/modules/heatmap.js.map +1 -1
  296. package/modules/heatmap.src.js +36 -15
  297. package/modules/histogram-bellcurve.js +1 -1
  298. package/modules/histogram-bellcurve.js.map +1 -1
  299. package/modules/histogram-bellcurve.src.js +186 -183
  300. package/modules/item-series.js +1 -1
  301. package/modules/item-series.src.js +11 -11
  302. package/modules/map-parser.js +1 -1
  303. package/modules/map-parser.src.js +1 -1
  304. package/modules/map.js +83 -83
  305. package/modules/map.js.map +1 -1
  306. package/modules/map.src.js +67 -34
  307. package/modules/networkgraph.js +10 -9
  308. package/modules/networkgraph.js.map +1 -1
  309. package/modules/networkgraph.src.js +180 -72
  310. package/modules/no-data-to-display.js +1 -1
  311. package/modules/no-data-to-display.src.js +1 -1
  312. package/modules/offline-exporting.js +15 -15
  313. package/modules/offline-exporting.js.map +1 -1
  314. package/modules/offline-exporting.src.js +17 -4
  315. package/modules/oldie-polyfills.js +1 -1
  316. package/modules/oldie-polyfills.src.js +2 -2
  317. package/modules/oldie.js +2 -2
  318. package/modules/oldie.src.js +2 -2
  319. package/modules/organization.js +1 -1
  320. package/modules/organization.js.map +1 -1
  321. package/modules/organization.src.js +66 -21
  322. package/modules/overlapping-datalabels.js +1 -1
  323. package/modules/overlapping-datalabels.src.js +1 -1
  324. package/modules/parallel-coordinates.js +1 -1
  325. package/modules/parallel-coordinates.src.js +1 -1
  326. package/modules/pareto.js +1 -1
  327. package/modules/pareto.js.map +1 -1
  328. package/modules/pareto.src.js +53 -52
  329. package/modules/pathfinder.js +3 -3
  330. package/modules/pathfinder.js.map +1 -1
  331. package/modules/pathfinder.src.js +3 -3
  332. package/modules/pattern-fill.js +1 -1
  333. package/modules/pattern-fill.src.js +2 -2
  334. package/modules/price-indicator.js +1 -1
  335. package/modules/price-indicator.src.js +2 -2
  336. package/modules/pyramid3d.js +1 -1
  337. package/modules/pyramid3d.src.js +2 -2
  338. package/modules/sankey.js +14 -14
  339. package/modules/sankey.js.map +1 -1
  340. package/modules/sankey.src.js +39 -19
  341. package/modules/series-label.js +16 -16
  342. package/modules/series-label.js.map +1 -1
  343. package/modules/series-label.src.js +17 -9
  344. package/modules/solid-gauge.js +5 -5
  345. package/modules/solid-gauge.js.map +1 -1
  346. package/modules/solid-gauge.src.js +129 -80
  347. package/modules/sonification.js +1 -1
  348. package/modules/sonification.src.js +1 -1
  349. package/modules/static-scale.js +4 -4
  350. package/modules/static-scale.js.map +1 -1
  351. package/modules/static-scale.src.js +9 -2
  352. package/modules/stock-tools.js +2 -2
  353. package/modules/stock-tools.src.js +3 -3
  354. package/modules/stock.js +146 -145
  355. package/modules/stock.js.map +1 -1
  356. package/modules/stock.src.js +105 -61
  357. package/modules/streamgraph.js +1 -1
  358. package/modules/streamgraph.src.js +12 -12
  359. package/modules/sunburst.js +40 -40
  360. package/modules/sunburst.js.map +1 -1
  361. package/modules/sunburst.src.js +30 -9
  362. package/modules/tilemap.js +1 -1
  363. package/modules/tilemap.js.map +1 -1
  364. package/modules/tilemap.src.js +59 -58
  365. package/modules/timeline.js +12 -11
  366. package/modules/timeline.js.map +1 -1
  367. package/modules/timeline.src.js +18 -13
  368. package/modules/treegrid.js +45 -43
  369. package/modules/treegrid.js.map +1 -1
  370. package/modules/treegrid.src.js +238 -139
  371. package/modules/treemap.js +1 -1
  372. package/modules/treemap.src.js +7 -7
  373. package/modules/variable-pie.js +1 -1
  374. package/modules/variable-pie.src.js +1 -1
  375. package/modules/variwide.js +1 -1
  376. package/modules/variwide.src.js +40 -40
  377. package/modules/vector.js +1 -1
  378. package/modules/vector.js.map +1 -1
  379. package/modules/vector.src.js +109 -108
  380. package/modules/venn.js +23 -23
  381. package/modules/venn.js.map +1 -1
  382. package/modules/venn.src.js +5 -3
  383. package/modules/windbarb.js +1 -1
  384. package/modules/windbarb.src.js +44 -44
  385. package/modules/wordcloud.js +10 -10
  386. package/modules/wordcloud.js.map +1 -1
  387. package/modules/wordcloud.src.js +2 -1
  388. package/modules/xrange.js +12 -12
  389. package/modules/xrange.js.map +1 -1
  390. package/modules/xrange.src.js +113 -105
  391. package/package.json +1 -1
  392. package/themes/avocado.js +21 -37
  393. package/themes/avocado.src.js +1 -1
  394. package/themes/dark-blue.js +1 -1
  395. package/themes/dark-blue.src.js +1 -1
  396. package/themes/dark-green.js +1 -1
  397. package/themes/dark-green.src.js +1 -1
  398. package/themes/dark-unica.js +1 -1
  399. package/themes/dark-unica.src.js +1 -1
  400. package/themes/gray.js +1 -1
  401. package/themes/gray.src.js +1 -1
  402. package/themes/grid-light.js +1 -1
  403. package/themes/grid-light.src.js +1 -1
  404. package/themes/grid.js +1 -1
  405. package/themes/grid.src.js +1 -1
  406. package/themes/sand-signika.js +1 -1
  407. package/themes/sand-signika.src.js +1 -1
  408. package/themes/skies.js +1 -1
  409. package/themes/skies.src.js +1 -1
  410. package/themes/sunset.js +21 -37
  411. package/themes/sunset.src.js +1 -1
  412. package/.DS_Store +0 -0
  413. package/es-modules/.DS_Store +0 -0
  414. package/es-modules/modules/annotations-legacy.src.js +0 -1977
  415. package/js/.DS_Store +0 -0
@@ -1,25 +1,29 @@
1
1
  /* *
2
- * (c) 2010-2019 Torstein Honsi
3
2
  *
4
- * License: www.highcharts.com/license
5
- */
6
-
3
+ * (c) 2010-2019 Torstein Honsi
4
+ *
5
+ * License: www.highcharts.com/license
6
+ *
7
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
8
+ *
9
+ * */
10
+ 'use strict';
11
+ import Highcharts from './Globals.js';
7
12
  /**
8
13
  * Normalized interval.
9
14
  *
10
15
  * @interface Highcharts.NormalizedIntervalObject
11
- *//**
12
- * The interval in axis values (ms).
13
- *
14
- * @name Highcharts.NormalizedIntervalObject#unitRange
15
- * @type {number}
16
- *//**
17
- * The count.
18
- *
19
- * @name Highcharts.NormalizedIntervalObject#count
20
- * @type {number}
21
- */
22
-
16
+ */ /**
17
+ * The count.
18
+ *
19
+ * @name Highcharts.NormalizedIntervalObject#count
20
+ * @type {number}
21
+ */ /**
22
+ * The interval in axis values (ms).
23
+ *
24
+ * @name Highcharts.NormalizedIntervalObject#unitRange
25
+ * @type {number}
26
+ */
23
27
  /**
24
28
  * Function of an additional date format specifier.
25
29
  *
@@ -31,42 +35,29 @@
31
35
  * @return {string}
32
36
  * The formatted portion of the date.
33
37
  */
34
-
35
38
  /**
36
39
  * Additonal time tick information.
37
40
  *
38
41
  * @interface Highcharts.TimeTicksInfoObject
39
42
  * @augments Highcharts.NormalizedIntervalObject
40
- *//**
41
- * @name Highcharts.TimeTicksInfoObject#higherRanks
42
- * @type {Array<string>}
43
- *//**
44
- * @name Highcharts.TimeTicksInfoObject#totalRange
45
- * @type {number}
46
- */
47
-
43
+ */ /**
44
+ * @name Highcharts.TimeTicksInfoObject#higherRanks
45
+ * @type {Array<string>}
46
+ */ /**
47
+ * @name Highcharts.TimeTicksInfoObject#totalRange
48
+ * @type {number}
49
+ */
48
50
  /**
49
51
  * Time ticks.
50
52
  *
51
53
  * @interface Highcharts.TimeTicksObject
52
54
  * @augments Array<number>
53
- *//**
54
- * @name Highcharts.TimeTicksObject#info
55
- * @type {Highcharts.TimeTicksInfoObject}
56
- */
57
-
58
- 'use strict';
59
-
60
- import Highcharts from './Globals.js';
61
-
62
- var H = Highcharts,
63
- defined = H.defined,
64
- extend = H.extend,
65
- merge = H.merge,
66
- pick = H.pick,
67
- timeUnits = H.timeUnits,
68
- win = H.win;
69
-
55
+ */ /**
56
+ * @name Highcharts.TimeTicksObject#info
57
+ * @type {Highcharts.TimeTicksInfoObject}
58
+ */
59
+ var H = Highcharts, defined = H.defined, extend = H.extend, merge = H.merge, pick = H.pick, timeUnits = H.timeUnits, win = H.win;
60
+ /* eslint-disable no-invalid-this, valid-jsdoc */
70
61
  /**
71
62
  * The Time class. Time settings are applied in general for each page using
72
63
  * `Highcharts.setOptions`, or individually for each Chart item through the
@@ -111,9 +102,7 @@ var H = Highcharts,
111
102
  Highcharts.Time = function (options) {
112
103
  this.update(options, false);
113
104
  };
114
-
115
105
  Highcharts.Time.prototype = {
116
-
117
106
  /**
118
107
  * Time options that can apply globally or to individual charts. These
119
108
  * settings affect how `datetime` axes are laid out, how tooltips are
@@ -165,7 +154,6 @@ Highcharts.Time.prototype = {
165
154
  * @since 6.0.5
166
155
  * @apioption time
167
156
  */
168
-
169
157
  /**
170
158
  * Whether to use UTC time for axis scaling, tickmark placement and
171
159
  * time display in `Highcharts.dateFormat`. Advantages of using UTC
@@ -183,7 +171,6 @@ Highcharts.Time.prototype = {
183
171
  * @default true
184
172
  * @apioption time.useUTC
185
173
  */
186
-
187
174
  /**
188
175
  * A custom `Date` class for advanced date handling. For example,
189
176
  * [JDate](https://github.com/tahajahangir/jdate) can be hooked in to
@@ -194,7 +181,6 @@ Highcharts.Time.prototype = {
194
181
  * @product highcharts highstock gantt
195
182
  * @apioption time.Date
196
183
  */
197
-
198
184
  /**
199
185
  * A callback to return the time zone offset for a given datetime. It
200
186
  * takes the timestamp in terms of milliseconds since January 1 1970,
@@ -212,7 +198,6 @@ Highcharts.Time.prototype = {
212
198
  * @product highcharts highstock gantt
213
199
  * @apioption time.getTimezoneOffset
214
200
  */
215
-
216
201
  /**
217
202
  * Requires [moment.js](http://momentjs.com/). If the timezone option
218
203
  * is specified, it creates a default
@@ -231,7 +216,6 @@ Highcharts.Time.prototype = {
231
216
  * @product highcharts highstock gantt
232
217
  * @apioption time.timezone
233
218
  */
234
-
235
219
  /**
236
220
  * The timezone offset in minutes. Positive values are west, negative
237
221
  * values are east of UTC, as in the ECMAScript
@@ -249,9 +233,7 @@ Highcharts.Time.prototype = {
249
233
  * @product highcharts highstock gantt
250
234
  * @apioption time.timezoneOffset
251
235
  */
252
-
253
236
  defaultOptions: {},
254
-
255
237
  /**
256
238
  * Update the Time object with current options. It is called internally on
257
239
  * initializing Highcharts, after running `Highcharts.setOptions` and on
@@ -261,19 +243,16 @@ Highcharts.Time.prototype = {
261
243
  * @function Highcharts.Time#update
262
244
  *
263
245
  * @param {Highcharts.TimeOptions} options
246
+ *
247
+ * @return {void}
264
248
  */
265
249
  update: function (options) {
266
- var useUTC = pick(options && options.useUTC, true),
267
- time = this;
268
-
250
+ var useUTC = pick(options && options.useUTC, true), time = this;
269
251
  this.options = options = merge(true, this.options || {}, options);
270
-
271
252
  // Allow using a different Date class
272
253
  this.Date = options.Date || win.Date || Date;
273
-
274
254
  this.useUTC = useUTC;
275
- this.timezoneOffset = useUTC && options.timezoneOffset;
276
-
255
+ this.timezoneOffset = (useUTC && options.timezoneOffset);
277
256
  /**
278
257
  * Get the time zone offset based on the current timezone information as
279
258
  * set in the global options.
@@ -287,78 +266,60 @@ Highcharts.Time.prototype = {
287
266
  * The timezone offset in minutes compared to UTC.
288
267
  */
289
268
  this.getTimezoneOffset = this.timezoneOffsetFunction();
290
-
291
269
  /*
292
270
  * The time object has options allowing for variable time zones, meaning
293
271
  * the axis ticks or series data needs to consider this.
294
272
  */
295
- this.variableTimezone = !!(
296
- !useUTC ||
273
+ this.variableTimezone = !!(!useUTC ||
297
274
  options.getTimezoneOffset ||
298
- options.timezone
299
- );
300
-
275
+ options.timezone);
301
276
  // UTC time with timezone handling
302
277
  if (this.variableTimezone || this.timezoneOffset) {
303
278
  this.get = function (unit, date) {
304
- var realMs = date.getTime(),
305
- ms = realMs - time.getTimezoneOffset(date),
306
- ret;
307
-
279
+ var realMs = date.getTime(), ms = realMs - time.getTimezoneOffset(date), ret;
308
280
  date.setTime(ms); // Temporary adjust to timezone
309
281
  ret = date['getUTC' + unit]();
310
282
  date.setTime(realMs); // Reset
311
-
312
283
  return ret;
313
284
  };
314
285
  this.set = function (unit, date, value) {
315
286
  var ms, offset, newOffset;
316
-
317
287
  // For lower order time units, just set it directly using local
318
288
  // time
319
- if (
320
- unit === 'Milliseconds' ||
289
+ if (unit === 'Milliseconds' ||
321
290
  unit === 'Seconds' ||
322
-
323
291
  // If we're dealting with minutes, we only need to
324
292
  // consider timezone if we're in Indian time zones with
325
293
  // half-hour offsets (#8768).
326
- (
327
- unit === 'Minutes' &&
328
- date.getTimezoneOffset() % 60 === 0
329
- )
330
- ) {
294
+ (unit === 'Minutes' &&
295
+ date.getTimezoneOffset() % 60 === 0)) {
331
296
  date['set' + unit](value);
332
-
333
- // Higher order time units need to take the time zone into
334
- // account
335
- } else {
336
-
297
+ // Higher order time units need to take the time zone into
298
+ // account
299
+ }
300
+ else {
337
301
  // Adjust by timezone
338
302
  offset = time.getTimezoneOffset(date);
339
303
  ms = date.getTime() - offset;
340
304
  date.setTime(ms);
341
-
342
305
  date['setUTC' + unit](value);
343
306
  newOffset = time.getTimezoneOffset(date);
344
-
345
307
  ms = date.getTime() + newOffset;
346
308
  date.setTime(ms);
347
309
  }
348
-
349
310
  };
350
-
351
- // UTC time with no timezone handling
352
- } else if (useUTC) {
311
+ // UTC time with no timezone handling
312
+ }
313
+ else if (useUTC) {
353
314
  this.get = function (unit, date) {
354
315
  return date['getUTC' + unit]();
355
316
  };
356
317
  this.set = function (unit, date, value) {
357
318
  return date['setUTC' + unit](value);
358
319
  };
359
-
360
- // Local time
361
- } else {
320
+ // Local time
321
+ }
322
+ else {
362
323
  this.get = function (unit, date) {
363
324
  return date['get' + unit]();
364
325
  };
@@ -366,9 +327,7 @@ Highcharts.Time.prototype = {
366
327
  return date['set' + unit](value);
367
328
  };
368
329
  }
369
-
370
330
  },
371
-
372
331
  /**
373
332
  * Make a time and returns milliseconds. Interprets the inputs as UTC time,
374
333
  * local time or a specific timezone time depending on the current time
@@ -399,40 +358,28 @@ Highcharts.Time.prototype = {
399
358
  */
400
359
  makeTime: function (year, month, date, hours, minutes, seconds) {
401
360
  var d, offset, newOffset;
402
-
403
361
  if (this.useUTC) {
404
362
  d = this.Date.UTC.apply(0, arguments);
405
363
  offset = this.getTimezoneOffset(d);
406
364
  d += offset;
407
365
  newOffset = this.getTimezoneOffset(d);
408
-
409
366
  if (offset !== newOffset) {
410
367
  d += newOffset - offset;
411
-
412
- // A special case for transitioning from summer time to winter time.
413
- // When the clock is set back, the same time is repeated twice, i.e.
414
- // 02:30 am is repeated since the clock is set back from 3 am to
415
- // 2 am. We need to make the same time as local Date does.
416
- } else if (
417
- offset - 36e5 === this.getTimezoneOffset(d - 36e5) &&
418
- !H.isSafari
419
- ) {
368
+ // A special case for transitioning from summer time to winter time.
369
+ // When the clock is set back, the same time is repeated twice, i.e.
370
+ // 02:30 am is repeated since the clock is set back from 3 am to
371
+ // 2 am. We need to make the same time as local Date does.
372
+ }
373
+ else if (offset - 36e5 === this.getTimezoneOffset(d - 36e5) &&
374
+ !H.isSafari) {
420
375
  d -= 36e5;
421
376
  }
422
-
423
- } else {
424
- d = new this.Date(
425
- year,
426
- month,
427
- pick(date, 1),
428
- pick(hours, 0),
429
- pick(minutes, 0),
430
- pick(seconds, 0)
431
- ).getTime();
377
+ }
378
+ else {
379
+ d = new this.Date(year, month, pick(date, 1), pick(hours, 0), pick(minutes, 0), pick(seconds, 0)).getTime();
432
380
  }
433
381
  return d;
434
382
  },
435
-
436
383
  /**
437
384
  * Sets the getTimezoneOffset function. If the `timezone` option is set, a
438
385
  * default getTimezoneOffset function with that timezone is returned. If
@@ -447,45 +394,35 @@ Highcharts.Time.prototype = {
447
394
  * A getTimezoneOffset function
448
395
  */
449
396
  timezoneOffsetFunction: function () {
450
- var time = this,
451
- options = this.options,
452
- moment = win.moment;
453
-
397
+ var time = this, options = this.options, moment = win.moment;
454
398
  if (!this.useUTC) {
455
399
  return function (timestamp) {
456
400
  return new Date(timestamp).getTimezoneOffset() * 60000;
457
401
  };
458
402
  }
459
-
460
403
  if (options.timezone) {
461
404
  if (!moment) {
462
405
  // getTimezoneOffset-function stays undefined because it depends
463
406
  // on Moment.js
464
407
  H.error(25);
465
-
466
- } else {
408
+ }
409
+ else {
467
410
  return function (timestamp) {
468
- return -moment.tz(
469
- timestamp,
470
- options.timezone
471
- ).utcOffset() * 60000;
411
+ return -moment.tz(timestamp, options.timezone).utcOffset() * 60000;
472
412
  };
473
413
  }
474
414
  }
475
-
476
415
  // If not timezone is set, look for the getTimezoneOffset callback
477
416
  if (this.useUTC && options.getTimezoneOffset) {
478
417
  return function (timestamp) {
479
418
  return options.getTimezoneOffset(timestamp) * 60000;
480
419
  };
481
420
  }
482
-
483
421
  // Last, use the `timezoneOffset` option if set
484
422
  return function () {
485
423
  return (time.timezoneOffset || 0) * 60000;
486
424
  };
487
425
  },
488
-
489
426
  /**
490
427
  * Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970)
491
428
  * into a human readable date string. The format is a subset of the formats
@@ -513,105 +450,79 @@ Highcharts.Time.prototype = {
513
450
  return H.defaultOptions.lang.invalidDate || '';
514
451
  }
515
452
  format = H.pick(format, '%Y-%m-%d %H:%M:%S');
516
-
517
- var time = this,
518
- date = new this.Date(timestamp),
519
- // get the basic time values
520
- hours = this.get('Hours', date),
521
- day = this.get('Day', date),
522
- dayOfMonth = this.get('Date', date),
523
- month = this.get('Month', date),
524
- fullYear = this.get('FullYear', date),
525
- lang = H.defaultOptions.lang,
526
- langWeekdays = lang.weekdays,
527
- shortWeekdays = lang.shortWeekdays,
528
- pad = H.pad,
529
-
530
- // List all format keys. Custom formats can be added from the
531
- // outside.
532
- replacements = H.extend(
533
- {
534
-
535
- // Day
536
- // Short weekday, like 'Mon'
537
- 'a': shortWeekdays ?
538
- shortWeekdays[day] :
539
- langWeekdays[day].substr(0, 3),
540
- // Long weekday, like 'Monday'
541
- 'A': langWeekdays[day],
542
- // Two digit day of the month, 01 to 31
543
- 'd': pad(dayOfMonth),
544
- // Day of the month, 1 through 31
545
- 'e': pad(dayOfMonth, 2, ' '),
546
- 'w': day,
547
-
548
- // Week (none implemented)
549
- // 'W': weekNumber(),
550
-
551
- // Month
552
- // Short month, like 'Jan'
553
- 'b': lang.shortMonths[month],
554
- // Long month, like 'January'
555
- 'B': lang.months[month],
556
- // Two digit month number, 01 through 12
557
- 'm': pad(month + 1),
558
- // Month number, 1 through 12 (#8150)
559
- 'o': month + 1,
560
-
561
- // Year
562
- // Two digits year, like 09 for 2009
563
- 'y': fullYear.toString().substr(2, 2),
564
- // Four digits year, like 2009
565
- 'Y': fullYear,
566
-
567
- // Time
568
- // Two digits hours in 24h format, 00 through 23
569
- 'H': pad(hours),
570
- // Hours in 24h format, 0 through 23
571
- 'k': hours,
572
- // Two digits hours in 12h format, 00 through 11
573
- 'I': pad((hours % 12) || 12),
574
- // Hours in 12h format, 1 through 12
575
- 'l': (hours % 12) || 12,
576
- // Two digits minutes, 00 through 59
577
- 'M': pad(time.get('Minutes', date)),
578
- // Upper case AM or PM
579
- 'p': hours < 12 ? 'AM' : 'PM',
580
- // Lower case AM or PM
581
- 'P': hours < 12 ? 'am' : 'pm',
582
- // Two digits seconds, 00 through 59
583
- 'S': pad(date.getSeconds()),
584
- // Milliseconds (naming from Ruby)
585
- 'L': pad(Math.floor(timestamp % 1000), 3)
586
- },
587
-
588
- H.dateFormats
589
- );
590
-
591
-
453
+ var time = this, date = new this.Date(timestamp),
454
+ // get the basic time values
455
+ hours = this.get('Hours', date), day = this.get('Day', date), dayOfMonth = this.get('Date', date), month = this.get('Month', date), fullYear = this.get('FullYear', date), lang = H.defaultOptions.lang, langWeekdays = lang.weekdays, shortWeekdays = lang.shortWeekdays, pad = H.pad,
456
+ // List all format keys. Custom formats can be added from the
457
+ // outside.
458
+ replacements = H.extend({
459
+ // Day
460
+ // Short weekday, like 'Mon'
461
+ a: shortWeekdays ?
462
+ shortWeekdays[day] :
463
+ langWeekdays[day].substr(0, 3),
464
+ // Long weekday, like 'Monday'
465
+ A: langWeekdays[day],
466
+ // Two digit day of the month, 01 to 31
467
+ d: pad(dayOfMonth),
468
+ // Day of the month, 1 through 31
469
+ e: pad(dayOfMonth, 2, ' '),
470
+ w: day,
471
+ // Week (none implemented)
472
+ // 'W': weekNumber(),
473
+ // Month
474
+ // Short month, like 'Jan'
475
+ b: lang.shortMonths[month],
476
+ // Long month, like 'January'
477
+ B: lang.months[month],
478
+ // Two digit month number, 01 through 12
479
+ m: pad(month + 1),
480
+ // Month number, 1 through 12 (#8150)
481
+ o: month + 1,
482
+ // Year
483
+ // Two digits year, like 09 for 2009
484
+ y: fullYear.toString().substr(2, 2),
485
+ // Four digits year, like 2009
486
+ Y: fullYear,
487
+ // Time
488
+ // Two digits hours in 24h format, 00 through 23
489
+ H: pad(hours),
490
+ // Hours in 24h format, 0 through 23
491
+ k: hours,
492
+ // Two digits hours in 12h format, 00 through 11
493
+ I: pad((hours % 12) || 12),
494
+ // Hours in 12h format, 1 through 12
495
+ l: (hours % 12) || 12,
496
+ // Two digits minutes, 00 through 59
497
+ M: pad(time.get('Minutes', date)),
498
+ // Upper case AM or PM
499
+ p: hours < 12 ? 'AM' : 'PM',
500
+ // Lower case AM or PM
501
+ P: hours < 12 ? 'am' : 'pm',
502
+ // Two digits seconds, 00 through 59
503
+ S: pad(date.getSeconds()),
504
+ // Milliseconds (naming from Ruby)
505
+ L: pad(Math.floor(timestamp % 1000), 3)
506
+ }, H.dateFormats);
592
507
  // Do the replaces
593
508
  H.objectEach(replacements, function (val, key) {
594
509
  // Regex would do it in one line, but this is faster
595
510
  while (format.indexOf('%' + key) !== -1) {
596
- format = format.replace(
597
- '%' + key,
598
- typeof val === 'function' ? val.call(time, timestamp) : val
599
- );
511
+ format = format.replace('%' + key, typeof val === 'function' ? val.call(time, timestamp) : val);
600
512
  }
601
-
602
513
  });
603
-
604
514
  // Optionally capitalize the string and return
605
515
  return capitalize ?
606
- format.substr(0, 1).toUpperCase() + format.substr(1) :
516
+ (format.substr(0, 1).toUpperCase() +
517
+ format.substr(1)) :
607
518
  format;
608
519
  },
609
-
610
520
  /**
611
521
  * Resolve legacy formats of dateTimeLabelFormats (strings and arrays) into
612
522
  * an object.
613
- * @param {String|Array|Object} f General format description
614
- * @return {Object} The object definition
523
+ * @private
524
+ * @param {object|string} f - General format description
525
+ * @return {object} - The object definition
615
526
  */
616
527
  resolveDTLFormat: function (f) {
617
528
  if (!H.isObject(f, true)) {
@@ -624,7 +535,6 @@ Highcharts.Time.prototype = {
624
535
  }
625
536
  return f;
626
537
  },
627
-
628
538
  /**
629
539
  * Return an array with time positions distributed on round time values
630
540
  * right and right after min and max. Used in datetime axes as well as for
@@ -645,224 +555,130 @@ Highcharts.Time.prototype = {
645
555
  *
646
556
  * @return {Highcharts.TimeTicksObject}
647
557
  */
648
- getTimeTicks: function (
649
- normalizedInterval,
650
- min,
651
- max,
652
- startOfWeek
653
- ) {
654
- var time = this,
655
- Date = time.Date,
656
- tickPositions = [],
657
- i,
658
- higherRanks = {},
659
- minYear, // used in months and years as a basis for Date.UTC()
660
- // When crossing DST, use the max. Resolves #6278.
661
- minDate = new Date(min),
662
- interval = normalizedInterval.unitRange,
663
- count = normalizedInterval.count || 1,
664
- variableDayLength,
665
- minDay;
666
-
558
+ getTimeTicks: function (normalizedInterval, min, max, startOfWeek) {
559
+ var time = this, Date = time.Date, tickPositions = [], i, higherRanks = {}, minYear, // used in months and years as a basis for Date.UTC()
560
+ // When crossing DST, use the max. Resolves #6278.
561
+ minDate = new Date(min), interval = normalizedInterval.unitRange, count = normalizedInterval.count || 1, variableDayLength, minDay;
667
562
  startOfWeek = pick(startOfWeek, 1);
668
-
669
563
  if (defined(min)) { // #1300
670
- time.set(
671
- 'Milliseconds',
672
- minDate,
673
- interval >= timeUnits.second ?
674
- 0 : // #3935
675
- count * Math.floor(
676
- time.get('Milliseconds', minDate) / count
677
- )
678
- ); // #3652, #3654
679
-
564
+ time.set('Milliseconds', minDate, interval >= timeUnits.second ?
565
+ 0 : // #3935
566
+ count * Math.floor(time.get('Milliseconds', minDate) / count)); // #3652, #3654
680
567
  if (interval >= timeUnits.second) { // second
681
- time.set(
682
- 'Seconds',
683
- minDate,
684
- interval >= timeUnits.minute ?
685
- 0 : // #3935
686
- count * Math.floor(time.get('Seconds', minDate) / count)
687
- );
568
+ time.set('Seconds', minDate, interval >= timeUnits.minute ?
569
+ 0 : // #3935
570
+ count * Math.floor(time.get('Seconds', minDate) / count));
688
571
  }
689
-
690
572
  if (interval >= timeUnits.minute) { // minute
691
- time.set(
692
- 'Minutes',
693
- minDate,
694
- interval >= timeUnits.hour ?
695
- 0 :
696
- count * Math.floor(time.get('Minutes', minDate) / count)
697
- );
573
+ time.set('Minutes', minDate, interval >= timeUnits.hour ?
574
+ 0 :
575
+ count * Math.floor(time.get('Minutes', minDate) / count));
698
576
  }
699
-
700
577
  if (interval >= timeUnits.hour) { // hour
701
- time.set(
702
- 'Hours',
703
- minDate,
704
- interval >= timeUnits.day ?
705
- 0 :
706
- count * Math.floor(
707
- time.get('Hours', minDate) / count
708
- )
709
- );
578
+ time.set('Hours', minDate, interval >= timeUnits.day ?
579
+ 0 :
580
+ count * Math.floor(time.get('Hours', minDate) / count));
710
581
  }
711
-
712
582
  if (interval >= timeUnits.day) { // day
713
- time.set(
714
- 'Date',
715
- minDate,
716
- interval >= timeUnits.month ?
717
- 1 :
718
- Math.max(
719
- 1,
720
- count * Math.floor(
721
- time.get('Date', minDate) / count
722
- )
723
- )
724
- );
583
+ time.set('Date', minDate, interval >= timeUnits.month ?
584
+ 1 :
585
+ Math.max(1, count * Math.floor(time.get('Date', minDate) / count)));
725
586
  }
726
-
727
587
  if (interval >= timeUnits.month) { // month
728
- time.set(
729
- 'Month',
730
- minDate,
731
- interval >= timeUnits.year ? 0 :
732
- count * Math.floor(time.get('Month', minDate) / count)
733
- );
588
+ time.set('Month', minDate, interval >= timeUnits.year ? 0 :
589
+ count * Math.floor(time.get('Month', minDate) / count));
734
590
  minYear = time.get('FullYear', minDate);
735
591
  }
736
-
737
592
  if (interval >= timeUnits.year) { // year
738
593
  minYear -= minYear % count;
739
594
  time.set('FullYear', minDate, minYear);
740
595
  }
741
-
742
596
  // week is a special case that runs outside the hierarchy
743
597
  if (interval === timeUnits.week) {
744
598
  // get start of current week, independent of count
745
599
  minDay = time.get('Day', minDate);
746
- time.set(
747
- 'Date',
748
- minDate,
749
- (
750
- time.get('Date', minDate) -
751
- minDay + startOfWeek +
752
- // We don't want to skip days that are before
753
- // startOfWeek (#7051)
754
- (minDay < startOfWeek ? -7 : 0)
755
- )
756
- );
600
+ time.set('Date', minDate, (time.get('Date', minDate) -
601
+ minDay + startOfWeek +
602
+ // We don't want to skip days that are before
603
+ // startOfWeek (#7051)
604
+ (minDay < startOfWeek ? -7 : 0)));
757
605
  }
758
-
759
-
760
606
  // Get basics for variable time spans
761
607
  minYear = time.get('FullYear', minDate);
762
- var minMonth = time.get('Month', minDate),
763
- minDateDate = time.get('Date', minDate),
764
- minHours = time.get('Hours', minDate);
765
-
608
+ var minMonth = time.get('Month', minDate), minDateDate = time.get('Date', minDate), minHours = time.get('Hours', minDate);
766
609
  // Redefine min to the floored/rounded minimum time (#7432)
767
610
  min = minDate.getTime();
768
-
769
611
  // Handle local timezone offset
770
612
  if (time.variableTimezone) {
771
-
772
613
  // Detect whether we need to take the DST crossover into
773
614
  // consideration. If we're crossing over DST, the day length may
774
615
  // be 23h or 25h and we need to compute the exact clock time for
775
616
  // each tick instead of just adding hours. This comes at a cost,
776
617
  // so first we find out if it is needed (#4951).
777
618
  variableDayLength = (
778
- // Long range, assume we're crossing over.
779
- max - min > 4 * timeUnits.month ||
619
+ // Long range, assume we're crossing over.
620
+ max - min > 4 * timeUnits.month ||
780
621
  // Short range, check if min and max are in different time
781
622
  // zones.
782
- time.getTimezoneOffset(min) !== time.getTimezoneOffset(max)
783
- );
623
+ time.getTimezoneOffset(min) !==
624
+ time.getTimezoneOffset(max));
784
625
  }
785
-
786
626
  // Iterate and add tick positions at appropriate values
787
627
  var t = minDate.getTime();
788
-
789
628
  i = 1;
790
629
  while (t < max) {
791
630
  tickPositions.push(t);
792
-
793
631
  // if the interval is years, use Date.UTC to increase years
794
632
  if (interval === timeUnits.year) {
795
633
  t = time.makeTime(minYear + i * count, 0);
796
-
797
- // if the interval is months, use Date.UTC to increase months
798
- } else if (interval === timeUnits.month) {
634
+ // if the interval is months, use Date.UTC to increase months
635
+ }
636
+ else if (interval === timeUnits.month) {
799
637
  t = time.makeTime(minYear, minMonth + i * count);
800
-
801
- // if we're using global time, the interval is not fixed as it
802
- // jumps one hour at the DST crossover
803
- } else if (
804
- variableDayLength &&
805
- (interval === timeUnits.day || interval === timeUnits.week)
806
- ) {
807
- t = time.makeTime(
808
- minYear,
809
- minMonth,
810
- minDateDate +
811
- i * count * (interval === timeUnits.day ? 1 : 7)
812
- );
813
-
814
- } else if (
815
- variableDayLength &&
638
+ // if we're using global time, the interval is not fixed as it
639
+ // jumps one hour at the DST crossover
640
+ }
641
+ else if (variableDayLength &&
642
+ (interval === timeUnits.day || interval === timeUnits.week)) {
643
+ t = time.makeTime(minYear, minMonth, minDateDate +
644
+ i * count * (interval === timeUnits.day ? 1 : 7));
645
+ }
646
+ else if (variableDayLength &&
816
647
  interval === timeUnits.hour &&
817
- count > 1
818
- ) {
648
+ count > 1) {
819
649
  // make sure higher ranks are preserved across DST (#6797,
820
650
  // #7621)
821
- t = time.makeTime(
822
- minYear,
823
- minMonth,
824
- minDateDate,
825
- minHours + i * count
826
- );
827
-
828
- // else, the interval is fixed and we use simple addition
829
- } else {
651
+ t = time.makeTime(minYear, minMonth, minDateDate, minHours + i * count);
652
+ // else, the interval is fixed and we use simple addition
653
+ }
654
+ else {
830
655
  t += interval * count;
831
656
  }
832
-
833
657
  i++;
834
658
  }
835
-
836
659
  // push the last time
837
660
  tickPositions.push(t);
838
-
839
-
840
661
  // Handle higher ranks. Mark new days if the time is on midnight
841
662
  // (#950, #1649, #1760, #3349). Use a reasonable dropout threshold
842
663
  // to prevent looping over dense data grouping (#6156).
843
664
  if (interval <= timeUnits.hour && tickPositions.length < 10000) {
844
665
  tickPositions.forEach(function (t) {
845
666
  if (
846
- // Speed optimization, no need to run dateFormat unless
847
- // we're on a full or half hour
848
- t % 1800000 === 0 &&
667
+ // Speed optimization, no need to run dateFormat unless
668
+ // we're on a full or half hour
669
+ t % 1800000 === 0 &&
849
670
  // Check for local or global midnight
850
- time.dateFormat('%H%M%S%L', t) === '000000000'
851
- ) {
671
+ time.dateFormat('%H%M%S%L', t) === '000000000') {
852
672
  higherRanks[t] = 'day';
853
673
  }
854
674
  });
855
675
  }
856
676
  }
857
-
858
-
859
677
  // record information on the chosen unit - for dynamic label formatter
860
678
  tickPositions.info = extend(normalizedInterval, {
861
679
  higherRanks: higherRanks,
862
680
  totalRange: interval * count
863
681
  });
864
-
865
682
  return tickPositions;
866
683
  }
867
-
868
684
  }; // end of Time