aw-highstock_rails 7.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (697) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +7 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +22 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +53 -0
  9. data/Rakefile +10 -0
  10. data/aw-highstock_rails.gemspec +28 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/lib/aw/highstock_rails.rb +9 -0
  14. data/lib/aw/highstock_rails/version.rb +5 -0
  15. data/vendor/assets/javascripts/highstock/css/annotations/popup.css +229 -0
  16. data/vendor/assets/javascripts/highstock/css/annotations/popup.scss +235 -0
  17. data/vendor/assets/javascripts/highstock/css/highcharts.css +890 -0
  18. data/vendor/assets/javascripts/highstock/css/highcharts.scss +788 -0
  19. data/vendor/assets/javascripts/highstock/css/stocktools/gui.css +268 -0
  20. data/vendor/assets/javascripts/highstock/css/stocktools/gui.scss +270 -0
  21. data/vendor/assets/javascripts/highstock/css/themes/dark-unica.css +951 -0
  22. data/vendor/assets/javascripts/highstock/css/themes/dark-unica.scss +122 -0
  23. data/vendor/assets/javascripts/highstock/css/themes/grid-light.css +904 -0
  24. data/vendor/assets/javascripts/highstock/css/themes/grid-light.scss +33 -0
  25. data/vendor/assets/javascripts/highstock/css/themes/sand-signika.css +920 -0
  26. data/vendor/assets/javascripts/highstock/css/themes/sand-signika.scss +74 -0
  27. data/vendor/assets/javascripts/highstock/es-modules/annotations/ControlPoint.js +130 -0
  28. data/vendor/assets/javascripts/highstock/es-modules/annotations/MockPoint.js +415 -0
  29. data/vendor/assets/javascripts/highstock/es-modules/annotations/annotations.src.js +1231 -0
  30. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableCircle.js +92 -0
  31. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableImage.js +101 -0
  32. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableLabel.js +452 -0
  33. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllablePath.js +175 -0
  34. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableRect.js +93 -0
  35. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/controllableMixin.js +411 -0
  36. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/markerMixin.js +214 -0
  37. data/vendor/assets/javascripts/highstock/es-modules/annotations/eventEmitterMixin.js +271 -0
  38. data/vendor/assets/javascripts/highstock/es-modules/annotations/navigationBindings.js +1283 -0
  39. data/vendor/assets/javascripts/highstock/es-modules/annotations/popup.js +1069 -0
  40. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/CrookedLine.js +191 -0
  41. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/ElliottWave.js +76 -0
  42. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Fibonacci.js +247 -0
  43. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/InfinityLine.js +185 -0
  44. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Measure.js +928 -0
  45. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Pitchfork.js +203 -0
  46. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Tunnel.js +242 -0
  47. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/VerticalLine.js +157 -0
  48. data/vendor/assets/javascripts/highstock/es-modules/error-messages.js +128 -0
  49. data/vendor/assets/javascripts/highstock/es-modules/error.js +1 -0
  50. data/vendor/assets/javascripts/highstock/es-modules/indicators/acceleration-bands.src.js +199 -0
  51. data/vendor/assets/javascripts/highstock/es-modules/indicators/accumulation-distribution.src.js +129 -0
  52. data/vendor/assets/javascripts/highstock/es-modules/indicators/ao.src.js +206 -0
  53. data/vendor/assets/javascripts/highstock/es-modules/indicators/apo.src.js +148 -0
  54. data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon-oscillator.src.js +128 -0
  55. data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon.src.js +173 -0
  56. data/vendor/assets/javascripts/highstock/es-modules/indicators/atr.src.js +151 -0
  57. data/vendor/assets/javascripts/highstock/es-modules/indicators/bollinger-bands.src.js +209 -0
  58. data/vendor/assets/javascripts/highstock/es-modules/indicators/cci.src.js +131 -0
  59. data/vendor/assets/javascripts/highstock/es-modules/indicators/chaikin.src.js +167 -0
  60. data/vendor/assets/javascripts/highstock/es-modules/indicators/cmf.src.js +246 -0
  61. data/vendor/assets/javascripts/highstock/es-modules/indicators/dema.src.js +191 -0
  62. data/vendor/assets/javascripts/highstock/es-modules/indicators/dpo.src.js +138 -0
  63. data/vendor/assets/javascripts/highstock/es-modules/indicators/ema.src.js +166 -0
  64. data/vendor/assets/javascripts/highstock/es-modules/indicators/ichimoku-kinko-hyo.src.js +850 -0
  65. data/vendor/assets/javascripts/highstock/es-modules/indicators/indicators.src.js +425 -0
  66. data/vendor/assets/javascripts/highstock/es-modules/indicators/keltner-channels.src.js +193 -0
  67. data/vendor/assets/javascripts/highstock/es-modules/indicators/macd.src.js +417 -0
  68. data/vendor/assets/javascripts/highstock/es-modules/indicators/mfi.src.js +198 -0
  69. data/vendor/assets/javascripts/highstock/es-modules/indicators/momentum.src.js +119 -0
  70. data/vendor/assets/javascripts/highstock/es-modules/indicators/natr.src.js +74 -0
  71. data/vendor/assets/javascripts/highstock/es-modules/indicators/pivot-points.src.js +360 -0
  72. data/vendor/assets/javascripts/highstock/es-modules/indicators/ppo.src.js +152 -0
  73. data/vendor/assets/javascripts/highstock/es-modules/indicators/price-channel.src.js +149 -0
  74. data/vendor/assets/javascripts/highstock/es-modules/indicators/price-envelopes.src.js +251 -0
  75. data/vendor/assets/javascripts/highstock/es-modules/indicators/psar.src.js +307 -0
  76. data/vendor/assets/javascripts/highstock/es-modules/indicators/regressions.src.js +427 -0
  77. data/vendor/assets/javascripts/highstock/es-modules/indicators/roc.src.js +149 -0
  78. data/vendor/assets/javascripts/highstock/es-modules/indicators/rsi.src.js +163 -0
  79. data/vendor/assets/javascripts/highstock/es-modules/indicators/stochastic.src.js +193 -0
  80. data/vendor/assets/javascripts/highstock/es-modules/indicators/supertrend.src.js +544 -0
  81. data/vendor/assets/javascripts/highstock/es-modules/indicators/tema.src.js +247 -0
  82. data/vendor/assets/javascripts/highstock/es-modules/indicators/trix.src.js +96 -0
  83. data/vendor/assets/javascripts/highstock/es-modules/indicators/volume-by-price.src.js +671 -0
  84. data/vendor/assets/javascripts/highstock/es-modules/indicators/vwap.src.js +189 -0
  85. data/vendor/assets/javascripts/highstock/es-modules/indicators/williams-r.src.js +128 -0
  86. data/vendor/assets/javascripts/highstock/es-modules/indicators/wma.src.js +146 -0
  87. data/vendor/assets/javascripts/highstock/es-modules/indicators/zigzag.src.js +221 -0
  88. data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-3d.src.js +17 -0
  89. data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-more.src.js +22 -0
  90. data/vendor/assets/javascripts/highstock/es-modules/masters/highstock.src.js +11 -0
  91. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/acceleration-bands.src.js +11 -0
  92. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/accumulation-distribution.src.js +11 -0
  93. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ao.src.js +11 -0
  94. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/apo.src.js +11 -0
  95. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon-oscillator.src.js +11 -0
  96. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon.src.js +11 -0
  97. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/atr.src.js +11 -0
  98. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/bollinger-bands.src.js +11 -0
  99. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cci.src.js +11 -0
  100. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/chaikin.src.js +11 -0
  101. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cmf.src.js +10 -0
  102. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dema.src.js +11 -0
  103. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dpo.src.js +11 -0
  104. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ema.src.js +11 -0
  105. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +11 -0
  106. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators-all.src.js +49 -0
  107. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators.src.js +11 -0
  108. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/keltner-channels.src.js +11 -0
  109. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/macd.src.js +11 -0
  110. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/mfi.src.js +11 -0
  111. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/momentum.src.js +11 -0
  112. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/natr.src.js +11 -0
  113. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/pivot-points.src.js +11 -0
  114. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ppo.src.js +11 -0
  115. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-channel.src.js +11 -0
  116. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-envelopes.src.js +11 -0
  117. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/psar.src.js +11 -0
  118. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/regressions.src.js +11 -0
  119. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/roc.src.js +11 -0
  120. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/rsi.src.js +11 -0
  121. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/stochastic.src.js +11 -0
  122. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/supertrend.src.js +11 -0
  123. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/tema.src.js +11 -0
  124. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/trix.src.js +11 -0
  125. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/volume-by-price.src.js +11 -0
  126. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/vwap.src.js +11 -0
  127. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/williams-r.src.js +11 -0
  128. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/wma.src.js +11 -0
  129. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/zigzag.src.js +11 -0
  130. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/accessibility.src.js +13 -0
  131. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations-advanced.src.js +20 -0
  132. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations.src.js +12 -0
  133. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/arrow-symbols.src.js +10 -0
  134. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost-canvas.src.js +11 -0
  135. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost.src.js +11 -0
  136. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/bullet.src.js +11 -0
  137. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/current-date-indicator.src.js +10 -0
  138. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/cylinder.src.js +10 -0
  139. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/data.src.js +10 -0
  140. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/datagrouping.src.js +12 -0
  141. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/debugger.src.js +13 -0
  142. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/dependency-wheel.src.js +10 -0
  143. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drag-panes.src.js +11 -0
  144. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/draggable-points.src.js +9 -0
  145. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drilldown.src.js +10 -0
  146. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/export-data.src.js +10 -0
  147. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/exporting.src.js +10 -0
  148. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/full-screen.src.js +11 -0
  149. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/funnel.src.js +10 -0
  150. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/grid-axis.src.js +10 -0
  151. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/heatmap.src.js +11 -0
  152. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/histogram-bellcurve.src.js +11 -0
  153. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/item-series.src.js +11 -0
  154. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/networkgraph.src.js +10 -0
  155. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/no-data-to-display.src.js +11 -0
  156. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/offline-exporting.src.js +10 -0
  157. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie-polyfills.src.js +11 -0
  158. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie.src.js +11 -0
  159. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/overlapping-datalabels.src.js +9 -0
  160. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/parallel-coordinates.src.js +11 -0
  161. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pareto.src.js +11 -0
  162. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pathfinder.src.js +10 -0
  163. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pattern-fill.src.js +11 -0
  164. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/price-indicator.src.js +11 -0
  165. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sankey.src.js +10 -0
  166. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/series-label.src.js +9 -0
  167. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/solid-gauge.src.js +10 -0
  168. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sonification.src.js +12 -0
  169. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/static-scale.src.js +10 -0
  170. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock-tools.src.js +12 -0
  171. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock.src.js +19 -0
  172. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/streamgraph.src.js +10 -0
  173. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sunburst.src.js +10 -0
  174. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/tilemap.src.js +10 -0
  175. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/timeline.src.js +11 -0
  176. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treegrid.src.js +10 -0
  177. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treemap.src.js +10 -0
  178. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variable-pie.src.js +11 -0
  179. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variwide.src.js +10 -0
  180. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/vector.src.js +10 -0
  181. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/venn.src.js +10 -0
  182. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/windbarb.src.js +10 -0
  183. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/wordcloud.src.js +10 -0
  184. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/xrange.src.js +10 -0
  185. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.js +9 -0
  186. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.src.js +9 -0
  187. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-blue.src.js +9 -0
  188. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-green.src.js +9 -0
  189. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-unica.src.js +9 -0
  190. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/gray.src.js +9 -0
  191. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid-light.src.js +9 -0
  192. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid.src.js +9 -0
  193. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sand-signika.src.js +9 -0
  194. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/skies.src.js +9 -0
  195. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.js +9 -0
  196. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.src.js +9 -0
  197. data/vendor/assets/javascripts/highstock/es-modules/mixins/ajax.js +123 -0
  198. data/vendor/assets/javascripts/highstock/es-modules/mixins/centered-series.js +116 -0
  199. data/vendor/assets/javascripts/highstock/es-modules/mixins/derived-series.js +150 -0
  200. data/vendor/assets/javascripts/highstock/es-modules/mixins/download-url.js +103 -0
  201. data/vendor/assets/javascripts/highstock/es-modules/mixins/draw-point.js +51 -0
  202. data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry-circles.js +300 -0
  203. data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry.js +50 -0
  204. data/vendor/assets/javascripts/highstock/es-modules/mixins/indicator-required.js +49 -0
  205. data/vendor/assets/javascripts/highstock/es-modules/mixins/multipe-lines.js +223 -0
  206. data/vendor/assets/javascripts/highstock/es-modules/mixins/navigation.js +59 -0
  207. data/vendor/assets/javascripts/highstock/es-modules/mixins/nodes.js +76 -0
  208. data/vendor/assets/javascripts/highstock/es-modules/mixins/on-series.js +167 -0
  209. data/vendor/assets/javascripts/highstock/es-modules/mixins/polygon.js +293 -0
  210. data/vendor/assets/javascripts/highstock/es-modules/mixins/reduce-array.js +53 -0
  211. data/vendor/assets/javascripts/highstock/es-modules/mixins/tree-series.js +256 -0
  212. data/vendor/assets/javascripts/highstock/es-modules/modules/a11y-i18n.src.js +524 -0
  213. data/vendor/assets/javascripts/highstock/es-modules/modules/annotations-legacy.src.js +1951 -0
  214. data/vendor/assets/javascripts/highstock/es-modules/modules/bellcurve.src.js +173 -0
  215. data/vendor/assets/javascripts/highstock/es-modules/modules/boost-canvas.src.js +732 -0
  216. data/vendor/assets/javascripts/highstock/es-modules/modules/boost.src.js +3730 -0
  217. data/vendor/assets/javascripts/highstock/es-modules/modules/bullet.src.js +361 -0
  218. data/vendor/assets/javascripts/highstock/es-modules/modules/cylinder.src.js +389 -0
  219. data/vendor/assets/javascripts/highstock/es-modules/modules/data.src.js +2417 -0
  220. data/vendor/assets/javascripts/highstock/es-modules/modules/debugger.src.js +109 -0
  221. data/vendor/assets/javascripts/highstock/es-modules/modules/dependency-wheel.src.js +199 -0
  222. data/vendor/assets/javascripts/highstock/es-modules/modules/drag-panes.src.js +624 -0
  223. data/vendor/assets/javascripts/highstock/es-modules/modules/draggable-points.src.js +2625 -0
  224. data/vendor/assets/javascripts/highstock/es-modules/modules/drilldown.src.js +1300 -0
  225. data/vendor/assets/javascripts/highstock/es-modules/modules/export-data.src.js +983 -0
  226. data/vendor/assets/javascripts/highstock/es-modules/modules/exporting.src.js +2149 -0
  227. data/vendor/assets/javascripts/highstock/es-modules/modules/full-screen.src.js +40 -0
  228. data/vendor/assets/javascripts/highstock/es-modules/modules/funnel.src.js +552 -0
  229. data/vendor/assets/javascripts/highstock/es-modules/modules/histogram.src.js +229 -0
  230. data/vendor/assets/javascripts/highstock/es-modules/modules/item-series.src.js +150 -0
  231. data/vendor/assets/javascripts/highstock/es-modules/modules/keyboard-navigation.src.js +1606 -0
  232. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/QuadTree.js +175 -0
  233. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/layouts.js +506 -0
  234. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/networkgraph.src.js +740 -0
  235. data/vendor/assets/javascripts/highstock/es-modules/modules/no-data-to-display.src.js +260 -0
  236. data/vendor/assets/javascripts/highstock/es-modules/modules/offline-exporting.src.js +710 -0
  237. data/vendor/assets/javascripts/highstock/es-modules/modules/oldie-polyfills.src.js +121 -0
  238. data/vendor/assets/javascripts/highstock/es-modules/modules/oldie.src.js +1556 -0
  239. data/vendor/assets/javascripts/highstock/es-modules/modules/overlapping-datalabels.src.js +250 -0
  240. data/vendor/assets/javascripts/highstock/es-modules/modules/parallel-coordinates.src.js +492 -0
  241. data/vendor/assets/javascripts/highstock/es-modules/modules/pareto.src.js +152 -0
  242. data/vendor/assets/javascripts/highstock/es-modules/modules/pattern-fill.src.js +607 -0
  243. data/vendor/assets/javascripts/highstock/es-modules/modules/price-indicator.src.js +149 -0
  244. data/vendor/assets/javascripts/highstock/es-modules/modules/sankey.src.js +809 -0
  245. data/vendor/assets/javascripts/highstock/es-modules/modules/screen-reader.src.js +954 -0
  246. data/vendor/assets/javascripts/highstock/es-modules/modules/series-label.src.js +1042 -0
  247. data/vendor/assets/javascripts/highstock/es-modules/modules/solid-gauge.src.js +486 -0
  248. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Earcon.js +184 -0
  249. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Instrument.js +582 -0
  250. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Timeline.js +702 -0
  251. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/chartSonify.js +1026 -0
  252. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/instrumentDefinitions.js +37 -0
  253. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/musicalFrequencies.js +113 -0
  254. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/pointSonify.js +385 -0
  255. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/sonification.js +107 -0
  256. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/utilities.js +178 -0
  257. data/vendor/assets/javascripts/highstock/es-modules/modules/static-scale.src.js +88 -0
  258. data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-bindings.js +1950 -0
  259. data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-gui.js +1458 -0
  260. data/vendor/assets/javascripts/highstock/es-modules/modules/streamgraph.src.js +132 -0
  261. data/vendor/assets/javascripts/highstock/es-modules/modules/sunburst.src.js +1041 -0
  262. data/vendor/assets/javascripts/highstock/es-modules/modules/tilemap.src.js +769 -0
  263. data/vendor/assets/javascripts/highstock/es-modules/modules/timeline.src.js +750 -0
  264. data/vendor/assets/javascripts/highstock/es-modules/modules/treemap.src.js +1803 -0
  265. data/vendor/assets/javascripts/highstock/es-modules/modules/variable-pie.src.js +459 -0
  266. data/vendor/assets/javascripts/highstock/es-modules/modules/variwide.src.js +350 -0
  267. data/vendor/assets/javascripts/highstock/es-modules/modules/vector.src.js +354 -0
  268. data/vendor/assets/javascripts/highstock/es-modules/modules/venn.src.js +1192 -0
  269. data/vendor/assets/javascripts/highstock/es-modules/modules/windbarb.src.js +380 -0
  270. data/vendor/assets/javascripts/highstock/es-modules/modules/wordcloud.src.js +1103 -0
  271. data/vendor/assets/javascripts/highstock/es-modules/modules/xrange.src.js +761 -0
  272. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Axis.js +669 -0
  273. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Chart.js +1753 -0
  274. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Column.js +437 -0
  275. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Math.js +206 -0
  276. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Pie.js +207 -0
  277. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/SVGRenderer.js +1002 -0
  278. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Scatter.js +154 -0
  279. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Series.js +73 -0
  280. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/VMLRenderer.js +62 -0
  281. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/ArrowSymbols.js +198 -0
  282. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/CurrentDateIndicator.js +100 -0
  283. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttChart.js +140 -0
  284. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttSeries.js +415 -0
  285. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GridAxis.js +961 -0
  286. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Pathfinder.js +1298 -0
  287. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/PathfinderAlgorithms.js +816 -0
  288. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Tree.js +158 -0
  289. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/TreeGrid.js +1003 -0
  290. data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorAxis.js +1103 -0
  291. data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorSeriesMixin.js +138 -0
  292. data/vendor/assets/javascripts/highstock/es-modules/parts-map/GeoJSON.js +435 -0
  293. data/vendor/assets/javascripts/highstock/es-modules/parts-map/HeatmapSeries.js +474 -0
  294. data/vendor/assets/javascripts/highstock/es-modules/parts-map/Map.js +477 -0
  295. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapAxis.js +124 -0
  296. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapBubbleSeries.js +274 -0
  297. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapLineSeries.js +143 -0
  298. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapNavigation.js +357 -0
  299. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointSeries.js +187 -0
  300. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointer.js +132 -0
  301. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapSeries.js +1294 -0
  302. data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaRangeSeries.js +725 -0
  303. data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaSplineRangeSeries.js +98 -0
  304. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BoxPlotSeries.js +617 -0
  305. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleLegend.js +1167 -0
  306. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleSeries.js +661 -0
  307. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnPyramidSeries.js +288 -0
  308. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnRangeSeries.js +278 -0
  309. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ErrorBarSeries.js +172 -0
  310. data/vendor/assets/javascripts/highstock/es-modules/parts-more/GaugeSeries.js +618 -0
  311. data/vendor/assets/javascripts/highstock/es-modules/parts-more/PackedBubbleSeries.js +567 -0
  312. data/vendor/assets/javascripts/highstock/es-modules/parts-more/Pane.js +399 -0
  313. data/vendor/assets/javascripts/highstock/es-modules/parts-more/Polar.js +634 -0
  314. data/vendor/assets/javascripts/highstock/es-modules/parts-more/PolygonSeries.js +151 -0
  315. data/vendor/assets/javascripts/highstock/es-modules/parts-more/RadialAxis.js +685 -0
  316. data/vendor/assets/javascripts/highstock/es-modules/parts-more/WaterfallSeries.js +765 -0
  317. data/vendor/assets/javascripts/highstock/es-modules/parts.js +684 -0
  318. data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSeries.js +578 -0
  319. data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSplineSeries.js +122 -0
  320. data/vendor/assets/javascripts/highstock/es-modules/parts/Axis.js +6453 -0
  321. data/vendor/assets/javascripts/highstock/es-modules/parts/BarSeries.js +153 -0
  322. data/vendor/assets/javascripts/highstock/es-modules/parts/CandlestickSeries.js +358 -0
  323. data/vendor/assets/javascripts/highstock/es-modules/parts/Chart.js +2307 -0
  324. data/vendor/assets/javascripts/highstock/es-modules/parts/Color.js +301 -0
  325. data/vendor/assets/javascripts/highstock/es-modules/parts/ColumnSeries.js +1125 -0
  326. data/vendor/assets/javascripts/highstock/es-modules/parts/DataGrouping.js +1115 -0
  327. data/vendor/assets/javascripts/highstock/es-modules/parts/DataLabels.js +1431 -0
  328. data/vendor/assets/javascripts/highstock/es-modules/parts/DateTimeAxis.js +134 -0
  329. data/vendor/assets/javascripts/highstock/es-modules/parts/Dynamics.js +1301 -0
  330. data/vendor/assets/javascripts/highstock/es-modules/parts/FlagsSeries.js +739 -0
  331. data/vendor/assets/javascripts/highstock/es-modules/parts/Globals.js +75 -0
  332. data/vendor/assets/javascripts/highstock/es-modules/parts/Html.js +539 -0
  333. data/vendor/assets/javascripts/highstock/es-modules/parts/Interaction.js +1299 -0
  334. data/vendor/assets/javascripts/highstock/es-modules/parts/Legend.js +1411 -0
  335. data/vendor/assets/javascripts/highstock/es-modules/parts/LogarithmicAxis.js +168 -0
  336. data/vendor/assets/javascripts/highstock/es-modules/parts/MSPointer.js +176 -0
  337. data/vendor/assets/javascripts/highstock/es-modules/parts/Navigator.js +2486 -0
  338. data/vendor/assets/javascripts/highstock/es-modules/parts/OHLCSeries.js +412 -0
  339. data/vendor/assets/javascripts/highstock/es-modules/parts/Options.js +3732 -0
  340. data/vendor/assets/javascripts/highstock/es-modules/parts/OrdinalAxis.js +962 -0
  341. data/vendor/assets/javascripts/highstock/es-modules/parts/PieSeries.js +1328 -0
  342. data/vendor/assets/javascripts/highstock/es-modules/parts/PlotBandSeries.experimental.js +74 -0
  343. data/vendor/assets/javascripts/highstock/es-modules/parts/PlotLineOrBand.js +1061 -0
  344. data/vendor/assets/javascripts/highstock/es-modules/parts/Point.js +681 -0
  345. data/vendor/assets/javascripts/highstock/es-modules/parts/Pointer.js +1332 -0
  346. data/vendor/assets/javascripts/highstock/es-modules/parts/RangeSelector.js +2063 -0
  347. data/vendor/assets/javascripts/highstock/es-modules/parts/Responsive.js +295 -0
  348. data/vendor/assets/javascripts/highstock/es-modules/parts/ScatterSeries.js +278 -0
  349. data/vendor/assets/javascripts/highstock/es-modules/parts/ScrollablePlotArea.js +266 -0
  350. data/vendor/assets/javascripts/highstock/es-modules/parts/Scrollbar.js +1134 -0
  351. data/vendor/assets/javascripts/highstock/es-modules/parts/Series.js +5864 -0
  352. data/vendor/assets/javascripts/highstock/es-modules/parts/SplineSeries.js +267 -0
  353. data/vendor/assets/javascripts/highstock/es-modules/parts/Stacking.js +604 -0
  354. data/vendor/assets/javascripts/highstock/es-modules/parts/StockChart.js +951 -0
  355. data/vendor/assets/javascripts/highstock/es-modules/parts/SvgRenderer.js +5109 -0
  356. data/vendor/assets/javascripts/highstock/es-modules/parts/Tick.js +746 -0
  357. data/vendor/assets/javascripts/highstock/es-modules/parts/Time.js +881 -0
  358. data/vendor/assets/javascripts/highstock/es-modules/parts/Tooltip.js +1318 -0
  359. data/vendor/assets/javascripts/highstock/es-modules/parts/TouchPointer.js +404 -0
  360. data/vendor/assets/javascripts/highstock/es-modules/parts/Utilities.js +2751 -0
  361. data/vendor/assets/javascripts/highstock/es-modules/themes/avocado.js +37 -0
  362. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-blue.js +259 -0
  363. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-green.js +261 -0
  364. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-unica.js +220 -0
  365. data/vendor/assets/javascripts/highstock/es-modules/themes/gray.js +267 -0
  366. data/vendor/assets/javascripts/highstock/es-modules/themes/grid-light.js +81 -0
  367. data/vendor/assets/javascripts/highstock/es-modules/themes/grid.js +110 -0
  368. data/vendor/assets/javascripts/highstock/es-modules/themes/sand-signika.js +111 -0
  369. data/vendor/assets/javascripts/highstock/es-modules/themes/skies.js +100 -0
  370. data/vendor/assets/javascripts/highstock/es-modules/themes/sunset.js +36 -0
  371. data/vendor/assets/javascripts/highstock/highcharts-3d.js +85 -0
  372. data/vendor/assets/javascripts/highstock/highcharts-3d.js.map +1 -0
  373. data/vendor/assets/javascripts/highstock/highcharts-more.js +101 -0
  374. data/vendor/assets/javascripts/highstock/highcharts-more.js.map +1 -0
  375. data/vendor/assets/javascripts/highstock/highstock.js +583 -0
  376. data/vendor/assets/javascripts/highstock/highstock.js.map +1 -0
  377. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js +16 -0
  378. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js.map +1 -0
  379. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.src.js +448 -0
  380. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js +12 -0
  381. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js.map +1 -0
  382. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.src.js +156 -0
  383. data/vendor/assets/javascripts/highstock/indicators/ao.js +13 -0
  384. data/vendor/assets/javascripts/highstock/indicators/ao.js.map +1 -0
  385. data/vendor/assets/javascripts/highstock/indicators/ao.src.js +233 -0
  386. data/vendor/assets/javascripts/highstock/indicators/apo.js +13 -0
  387. data/vendor/assets/javascripts/highstock/indicators/apo.js.map +1 -0
  388. data/vendor/assets/javascripts/highstock/indicators/apo.src.js +223 -0
  389. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js +15 -0
  390. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js.map +1 -0
  391. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.src.js +426 -0
  392. data/vendor/assets/javascripts/highstock/indicators/aroon.js +16 -0
  393. data/vendor/assets/javascripts/highstock/indicators/aroon.js.map +1 -0
  394. data/vendor/assets/javascripts/highstock/indicators/aroon.src.js +423 -0
  395. data/vendor/assets/javascripts/highstock/indicators/atr.js +12 -0
  396. data/vendor/assets/javascripts/highstock/indicators/atr.js.map +1 -0
  397. data/vendor/assets/javascripts/highstock/indicators/atr.src.js +178 -0
  398. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js +16 -0
  399. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js.map +1 -0
  400. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.src.js +458 -0
  401. data/vendor/assets/javascripts/highstock/indicators/cci.js +12 -0
  402. data/vendor/assets/javascripts/highstock/indicators/cci.js.map +1 -0
  403. data/vendor/assets/javascripts/highstock/indicators/cci.src.js +158 -0
  404. data/vendor/assets/javascripts/highstock/indicators/chaikin.js +15 -0
  405. data/vendor/assets/javascripts/highstock/indicators/chaikin.js.map +1 -0
  406. data/vendor/assets/javascripts/highstock/indicators/chaikin.src.js +370 -0
  407. data/vendor/assets/javascripts/highstock/indicators/cmf.js +12 -0
  408. data/vendor/assets/javascripts/highstock/indicators/cmf.js.map +1 -0
  409. data/vendor/assets/javascripts/highstock/indicators/cmf.src.js +273 -0
  410. data/vendor/assets/javascripts/highstock/indicators/dema.js +13 -0
  411. data/vendor/assets/javascripts/highstock/indicators/dema.js.map +1 -0
  412. data/vendor/assets/javascripts/highstock/indicators/dema.src.js +266 -0
  413. data/vendor/assets/javascripts/highstock/indicators/dpo.js +12 -0
  414. data/vendor/assets/javascripts/highstock/indicators/dpo.js.map +1 -0
  415. data/vendor/assets/javascripts/highstock/indicators/dpo.src.js +166 -0
  416. data/vendor/assets/javascripts/highstock/indicators/ema.js +12 -0
  417. data/vendor/assets/javascripts/highstock/indicators/ema.js.map +1 -0
  418. data/vendor/assets/javascripts/highstock/indicators/ema.src.js +193 -0
  419. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js +22 -0
  420. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js.map +1 -0
  421. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.src.js +877 -0
  422. data/vendor/assets/javascripts/highstock/indicators/indicators-all.js +117 -0
  423. data/vendor/assets/javascripts/highstock/indicators/indicators-all.js.map +1 -0
  424. data/vendor/assets/javascripts/highstock/indicators/indicators-all.src.js +9389 -0
  425. data/vendor/assets/javascripts/highstock/indicators/indicators.js +17 -0
  426. data/vendor/assets/javascripts/highstock/indicators/indicators.js.map +1 -0
  427. data/vendor/assets/javascripts/highstock/indicators/indicators.src.js +500 -0
  428. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js +16 -0
  429. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js.map +1 -0
  430. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.src.js +442 -0
  431. data/vendor/assets/javascripts/highstock/indicators/macd.js +18 -0
  432. data/vendor/assets/javascripts/highstock/indicators/macd.js.map +1 -0
  433. data/vendor/assets/javascripts/highstock/indicators/macd.src.js +444 -0
  434. data/vendor/assets/javascripts/highstock/indicators/mfi.js +13 -0
  435. data/vendor/assets/javascripts/highstock/indicators/mfi.js.map +1 -0
  436. data/vendor/assets/javascripts/highstock/indicators/mfi.src.js +225 -0
  437. data/vendor/assets/javascripts/highstock/indicators/momentum.js +12 -0
  438. data/vendor/assets/javascripts/highstock/indicators/momentum.js.map +1 -0
  439. data/vendor/assets/javascripts/highstock/indicators/momentum.src.js +146 -0
  440. data/vendor/assets/javascripts/highstock/indicators/natr.js +12 -0
  441. data/vendor/assets/javascripts/highstock/indicators/natr.js.map +1 -0
  442. data/vendor/assets/javascripts/highstock/indicators/natr.src.js +101 -0
  443. data/vendor/assets/javascripts/highstock/indicators/pivot-points.js +16 -0
  444. data/vendor/assets/javascripts/highstock/indicators/pivot-points.js.map +1 -0
  445. data/vendor/assets/javascripts/highstock/indicators/pivot-points.src.js +387 -0
  446. data/vendor/assets/javascripts/highstock/indicators/ppo.js +13 -0
  447. data/vendor/assets/javascripts/highstock/indicators/ppo.js.map +1 -0
  448. data/vendor/assets/javascripts/highstock/indicators/ppo.src.js +227 -0
  449. data/vendor/assets/javascripts/highstock/indicators/price-channel.js +16 -0
  450. data/vendor/assets/javascripts/highstock/indicators/price-channel.js.map +1 -0
  451. data/vendor/assets/javascripts/highstock/indicators/price-channel.src.js +450 -0
  452. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js +15 -0
  453. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js.map +1 -0
  454. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.src.js +278 -0
  455. data/vendor/assets/javascripts/highstock/indicators/psar.js +13 -0
  456. data/vendor/assets/javascripts/highstock/indicators/psar.js.map +1 -0
  457. data/vendor/assets/javascripts/highstock/indicators/psar.src.js +334 -0
  458. data/vendor/assets/javascripts/highstock/indicators/regressions.js +14 -0
  459. data/vendor/assets/javascripts/highstock/indicators/regressions.js.map +1 -0
  460. data/vendor/assets/javascripts/highstock/indicators/regressions.src.js +454 -0
  461. data/vendor/assets/javascripts/highstock/indicators/roc.js +12 -0
  462. data/vendor/assets/javascripts/highstock/indicators/roc.js.map +1 -0
  463. data/vendor/assets/javascripts/highstock/indicators/roc.src.js +176 -0
  464. data/vendor/assets/javascripts/highstock/indicators/rsi.js +12 -0
  465. data/vendor/assets/javascripts/highstock/indicators/rsi.js.map +1 -0
  466. data/vendor/assets/javascripts/highstock/indicators/rsi.src.js +190 -0
  467. data/vendor/assets/javascripts/highstock/indicators/stochastic.js +17 -0
  468. data/vendor/assets/javascripts/highstock/indicators/stochastic.js.map +1 -0
  469. data/vendor/assets/javascripts/highstock/indicators/stochastic.src.js +494 -0
  470. data/vendor/assets/javascripts/highstock/indicators/supertrend.js +17 -0
  471. data/vendor/assets/javascripts/highstock/indicators/supertrend.js.map +1 -0
  472. data/vendor/assets/javascripts/highstock/indicators/supertrend.src.js +571 -0
  473. data/vendor/assets/javascripts/highstock/indicators/tema.js +14 -0
  474. data/vendor/assets/javascripts/highstock/indicators/tema.js.map +1 -0
  475. data/vendor/assets/javascripts/highstock/indicators/tema.src.js +322 -0
  476. data/vendor/assets/javascripts/highstock/indicators/trix.js +12 -0
  477. data/vendor/assets/javascripts/highstock/indicators/trix.js.map +1 -0
  478. data/vendor/assets/javascripts/highstock/indicators/trix.src.js +171 -0
  479. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js +21 -0
  480. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js.map +1 -0
  481. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.src.js +698 -0
  482. data/vendor/assets/javascripts/highstock/indicators/vwap.js +12 -0
  483. data/vendor/assets/javascripts/highstock/indicators/vwap.js.map +1 -0
  484. data/vendor/assets/javascripts/highstock/indicators/vwap.src.js +216 -0
  485. data/vendor/assets/javascripts/highstock/indicators/williams-r.js +13 -0
  486. data/vendor/assets/javascripts/highstock/indicators/williams-r.js.map +1 -0
  487. data/vendor/assets/javascripts/highstock/indicators/williams-r.src.js +207 -0
  488. data/vendor/assets/javascripts/highstock/indicators/wma.js +12 -0
  489. data/vendor/assets/javascripts/highstock/indicators/wma.js.map +1 -0
  490. data/vendor/assets/javascripts/highstock/indicators/wma.src.js +173 -0
  491. data/vendor/assets/javascripts/highstock/indicators/zigzag.js +13 -0
  492. data/vendor/assets/javascripts/highstock/indicators/zigzag.js.map +1 -0
  493. data/vendor/assets/javascripts/highstock/indicators/zigzag.src.js +248 -0
  494. data/vendor/assets/javascripts/highstock/lib/canvg.js +130 -0
  495. data/vendor/assets/javascripts/highstock/lib/canvg.src.js +3073 -0
  496. data/vendor/assets/javascripts/highstock/lib/jspdf.js +283 -0
  497. data/vendor/assets/javascripts/highstock/lib/jspdf.src.js +21627 -0
  498. data/vendor/assets/javascripts/highstock/lib/rgbcolor.js +17 -0
  499. data/vendor/assets/javascripts/highstock/lib/rgbcolor.src.js +299 -0
  500. data/vendor/assets/javascripts/highstock/lib/svg2pdf.js +38 -0
  501. data/vendor/assets/javascripts/highstock/lib/svg2pdf.src.js +4390 -0
  502. data/vendor/assets/javascripts/highstock/modules/accessibility.js +73 -0
  503. data/vendor/assets/javascripts/highstock/modules/accessibility.js.map +1 -0
  504. data/vendor/assets/javascripts/highstock/modules/accessibility.src.js +3103 -0
  505. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js +132 -0
  506. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js.map +1 -0
  507. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.src.js +8230 -0
  508. data/vendor/assets/javascripts/highstock/modules/annotations.js +94 -0
  509. data/vendor/assets/javascripts/highstock/modules/annotations.js.map +1 -0
  510. data/vendor/assets/javascripts/highstock/modules/annotations.src.js +6001 -0
  511. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js +11 -0
  512. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js.map +1 -0
  513. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.src.js +225 -0
  514. data/vendor/assets/javascripts/highstock/modules/boost-canvas.js +23 -0
  515. data/vendor/assets/javascripts/highstock/modules/boost-canvas.js.map +1 -0
  516. data/vendor/assets/javascripts/highstock/modules/boost-canvas.src.js +756 -0
  517. data/vendor/assets/javascripts/highstock/modules/boost.js +65 -0
  518. data/vendor/assets/javascripts/highstock/modules/boost.js.map +1 -0
  519. data/vendor/assets/javascripts/highstock/modules/boost.src.js +3752 -0
  520. data/vendor/assets/javascripts/highstock/modules/bullet.js +14 -0
  521. data/vendor/assets/javascripts/highstock/modules/bullet.js.map +1 -0
  522. data/vendor/assets/javascripts/highstock/modules/bullet.src.js +388 -0
  523. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js +11 -0
  524. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js.map +1 -0
  525. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.src.js +127 -0
  526. data/vendor/assets/javascripts/highstock/modules/cylinder.js +14 -0
  527. data/vendor/assets/javascripts/highstock/modules/cylinder.js.map +1 -0
  528. data/vendor/assets/javascripts/highstock/modules/cylinder.src.js +413 -0
  529. data/vendor/assets/javascripts/highstock/modules/data.js +37 -0
  530. data/vendor/assets/javascripts/highstock/modules/data.js.map +1 -0
  531. data/vendor/assets/javascripts/highstock/modules/data.src.js +2565 -0
  532. data/vendor/assets/javascripts/highstock/modules/datagrouping.js +25 -0
  533. data/vendor/assets/javascripts/highstock/modules/datagrouping.js.map +1 -0
  534. data/vendor/assets/javascripts/highstock/modules/datagrouping.src.js +1140 -0
  535. data/vendor/assets/javascripts/highstock/modules/debugger.js +28 -0
  536. data/vendor/assets/javascripts/highstock/modules/debugger.js.map +1 -0
  537. data/vendor/assets/javascripts/highstock/modules/debugger.src.js +267 -0
  538. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js +15 -0
  539. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js.map +1 -0
  540. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.src.js +301 -0
  541. data/vendor/assets/javascripts/highstock/modules/drag-panes.js +18 -0
  542. data/vendor/assets/javascripts/highstock/modules/drag-panes.js.map +1 -0
  543. data/vendor/assets/javascripts/highstock/modules/drag-panes.src.js +649 -0
  544. data/vendor/assets/javascripts/highstock/modules/draggable-points.js +40 -0
  545. data/vendor/assets/javascripts/highstock/modules/draggable-points.js.map +1 -0
  546. data/vendor/assets/javascripts/highstock/modules/draggable-points.src.js +2650 -0
  547. data/vendor/assets/javascripts/highstock/modules/drilldown.js +29 -0
  548. data/vendor/assets/javascripts/highstock/modules/drilldown.js.map +1 -0
  549. data/vendor/assets/javascripts/highstock/modules/drilldown.src.js +1321 -0
  550. data/vendor/assets/javascripts/highstock/modules/export-data.js +27 -0
  551. data/vendor/assets/javascripts/highstock/modules/export-data.js.map +1 -0
  552. data/vendor/assets/javascripts/highstock/modules/export-data.src.js +1234 -0
  553. data/vendor/assets/javascripts/highstock/modules/exporting.js +35 -0
  554. data/vendor/assets/javascripts/highstock/modules/exporting.js.map +1 -0
  555. data/vendor/assets/javascripts/highstock/modules/exporting.src.js +2233 -0
  556. data/vendor/assets/javascripts/highstock/modules/full-screen.js +11 -0
  557. data/vendor/assets/javascripts/highstock/modules/full-screen.js.map +1 -0
  558. data/vendor/assets/javascripts/highstock/modules/full-screen.src.js +68 -0
  559. data/vendor/assets/javascripts/highstock/modules/funnel.js +14 -0
  560. data/vendor/assets/javascripts/highstock/modules/funnel.js.map +1 -0
  561. data/vendor/assets/javascripts/highstock/modules/funnel.src.js +576 -0
  562. data/vendor/assets/javascripts/highstock/modules/grid-axis.js +23 -0
  563. data/vendor/assets/javascripts/highstock/modules/grid-axis.js.map +1 -0
  564. data/vendor/assets/javascripts/highstock/modules/grid-axis.src.js +988 -0
  565. data/vendor/assets/javascripts/highstock/modules/heatmap.js +28 -0
  566. data/vendor/assets/javascripts/highstock/modules/heatmap.js.map +1 -0
  567. data/vendor/assets/javascripts/highstock/modules/heatmap.src.js +1731 -0
  568. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js +16 -0
  569. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js.map +1 -0
  570. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.src.js +570 -0
  571. data/vendor/assets/javascripts/highstock/modules/item-series.js +13 -0
  572. data/vendor/assets/javascripts/highstock/modules/item-series.js.map +1 -0
  573. data/vendor/assets/javascripts/highstock/modules/item-series.src.js +176 -0
  574. data/vendor/assets/javascripts/highstock/modules/networkgraph.js +31 -0
  575. data/vendor/assets/javascripts/highstock/modules/networkgraph.js.map +1 -0
  576. data/vendor/assets/javascripts/highstock/modules/networkgraph.src.js +1348 -0
  577. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js +13 -0
  578. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js.map +1 -0
  579. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.src.js +285 -0
  580. data/vendor/assets/javascripts/highstock/modules/offline-exporting.js +22 -0
  581. data/vendor/assets/javascripts/highstock/modules/offline-exporting.js.map +1 -0
  582. data/vendor/assets/javascripts/highstock/modules/offline-exporting.src.js +838 -0
  583. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js +13 -0
  584. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js.map +1 -0
  585. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.src.js +150 -0
  586. data/vendor/assets/javascripts/highstock/modules/oldie.js +35 -0
  587. data/vendor/assets/javascripts/highstock/modules/oldie.js.map +1 -0
  588. data/vendor/assets/javascripts/highstock/modules/oldie.src.js +1582 -0
  589. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js +9 -0
  590. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js.map +1 -0
  591. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.src.js +22 -0
  592. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js +18 -0
  593. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js.map +1 -0
  594. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.src.js +517 -0
  595. data/vendor/assets/javascripts/highstock/modules/pareto.js +14 -0
  596. data/vendor/assets/javascripts/highstock/modules/pareto.js.map +1 -0
  597. data/vendor/assets/javascripts/highstock/modules/pareto.src.js +327 -0
  598. data/vendor/assets/javascripts/highstock/modules/pathfinder.js +34 -0
  599. data/vendor/assets/javascripts/highstock/modules/pathfinder.js.map +1 -0
  600. data/vendor/assets/javascripts/highstock/modules/pathfinder.src.js +2336 -0
  601. data/vendor/assets/javascripts/highstock/modules/pattern-fill.js +21 -0
  602. data/vendor/assets/javascripts/highstock/modules/pattern-fill.js.map +1 -0
  603. data/vendor/assets/javascripts/highstock/modules/pattern-fill.src.js +634 -0
  604. data/vendor/assets/javascripts/highstock/modules/price-indicator.js +13 -0
  605. data/vendor/assets/javascripts/highstock/modules/price-indicator.js.map +1 -0
  606. data/vendor/assets/javascripts/highstock/modules/price-indicator.src.js +176 -0
  607. data/vendor/assets/javascripts/highstock/modules/sankey.js +22 -0
  608. data/vendor/assets/javascripts/highstock/modules/sankey.js.map +1 -0
  609. data/vendor/assets/javascripts/highstock/modules/sankey.src.js +911 -0
  610. data/vendor/assets/javascripts/highstock/modules/series-label.js +23 -0
  611. data/vendor/assets/javascripts/highstock/modules/series-label.js.map +1 -0
  612. data/vendor/assets/javascripts/highstock/modules/series-label.src.js +1065 -0
  613. data/vendor/assets/javascripts/highstock/modules/solid-gauge.js +15 -0
  614. data/vendor/assets/javascripts/highstock/modules/solid-gauge.js.map +1 -0
  615. data/vendor/assets/javascripts/highstock/modules/solid-gauge.src.js +510 -0
  616. data/vendor/assets/javascripts/highstock/modules/sonification.js +53 -0
  617. data/vendor/assets/javascripts/highstock/modules/sonification.js.map +1 -0
  618. data/vendor/assets/javascripts/highstock/modules/sonification.src.js +3341 -0
  619. data/vendor/assets/javascripts/highstock/modules/static-scale.js +12 -0
  620. data/vendor/assets/javascripts/highstock/modules/static-scale.js.map +1 -0
  621. data/vendor/assets/javascripts/highstock/modules/static-scale.src.js +114 -0
  622. data/vendor/assets/javascripts/highstock/modules/stock-tools.js +65 -0
  623. data/vendor/assets/javascripts/highstock/modules/stock-tools.js.map +1 -0
  624. data/vendor/assets/javascripts/highstock/modules/stock-tools.src.js +3437 -0
  625. data/vendor/assets/javascripts/highstock/modules/stock.js +151 -0
  626. data/vendor/assets/javascripts/highstock/modules/stock.js.map +1 -0
  627. data/vendor/assets/javascripts/highstock/modules/stock.src.js +10907 -0
  628. data/vendor/assets/javascripts/highstock/modules/streamgraph.js +10 -0
  629. data/vendor/assets/javascripts/highstock/modules/streamgraph.js.map +1 -0
  630. data/vendor/assets/javascripts/highstock/modules/streamgraph.src.js +158 -0
  631. data/vendor/assets/javascripts/highstock/modules/sunburst.js +52 -0
  632. data/vendor/assets/javascripts/highstock/modules/sunburst.js.map +1 -0
  633. data/vendor/assets/javascripts/highstock/modules/sunburst.src.js +3174 -0
  634. data/vendor/assets/javascripts/highstock/modules/tilemap.js +26 -0
  635. data/vendor/assets/javascripts/highstock/modules/tilemap.js.map +1 -0
  636. data/vendor/assets/javascripts/highstock/modules/tilemap.src.js +1402 -0
  637. data/vendor/assets/javascripts/highstock/modules/timeline.js +23 -0
  638. data/vendor/assets/javascripts/highstock/modules/timeline.js.map +1 -0
  639. data/vendor/assets/javascripts/highstock/modules/timeline.src.js +778 -0
  640. data/vendor/assets/javascripts/highstock/modules/treegrid.js +50 -0
  641. data/vendor/assets/javascripts/highstock/modules/treegrid.js.map +1 -0
  642. data/vendor/assets/javascripts/highstock/modules/treegrid.src.js +2917 -0
  643. data/vendor/assets/javascripts/highstock/modules/treemap.js +39 -0
  644. data/vendor/assets/javascripts/highstock/modules/treemap.js.map +1 -0
  645. data/vendor/assets/javascripts/highstock/modules/treemap.src.js +2083 -0
  646. data/vendor/assets/javascripts/highstock/modules/variable-pie.js +16 -0
  647. data/vendor/assets/javascripts/highstock/modules/variable-pie.js.map +1 -0
  648. data/vendor/assets/javascripts/highstock/modules/variable-pie.src.js +485 -0
  649. data/vendor/assets/javascripts/highstock/modules/variwide.js +15 -0
  650. data/vendor/assets/javascripts/highstock/modules/variwide.js.map +1 -0
  651. data/vendor/assets/javascripts/highstock/modules/variwide.src.js +376 -0
  652. data/vendor/assets/javascripts/highstock/modules/vector.js +13 -0
  653. data/vendor/assets/javascripts/highstock/modules/vector.js.map +1 -0
  654. data/vendor/assets/javascripts/highstock/modules/vector.src.js +381 -0
  655. data/vendor/assets/javascripts/highstock/modules/venn.js +30 -0
  656. data/vendor/assets/javascripts/highstock/modules/venn.js.map +1 -0
  657. data/vendor/assets/javascripts/highstock/modules/venn.src.js +1624 -0
  658. data/vendor/assets/javascripts/highstock/modules/windbarb.js +17 -0
  659. data/vendor/assets/javascripts/highstock/modules/windbarb.js.map +1 -0
  660. data/vendor/assets/javascripts/highstock/modules/windbarb.src.js +574 -0
  661. data/vendor/assets/javascripts/highstock/modules/wordcloud.js +25 -0
  662. data/vendor/assets/javascripts/highstock/modules/wordcloud.js.map +1 -0
  663. data/vendor/assets/javascripts/highstock/modules/wordcloud.src.js +1475 -0
  664. data/vendor/assets/javascripts/highstock/modules/xrange.js +20 -0
  665. data/vendor/assets/javascripts/highstock/modules/xrange.js.map +1 -0
  666. data/vendor/assets/javascripts/highstock/modules/xrange.src.js +788 -0
  667. data/vendor/assets/javascripts/highstock/themes/avocado.js +9 -0
  668. data/vendor/assets/javascripts/highstock/themes/avocado.js.map +1 -0
  669. data/vendor/assets/javascripts/highstock/themes/avocado.src.js +63 -0
  670. data/vendor/assets/javascripts/highstock/themes/dark-blue.js +15 -0
  671. data/vendor/assets/javascripts/highstock/themes/dark-blue.js.map +1 -0
  672. data/vendor/assets/javascripts/highstock/themes/dark-blue.src.js +285 -0
  673. data/vendor/assets/javascripts/highstock/themes/dark-green.js +15 -0
  674. data/vendor/assets/javascripts/highstock/themes/dark-green.js.map +1 -0
  675. data/vendor/assets/javascripts/highstock/themes/dark-green.src.js +287 -0
  676. data/vendor/assets/javascripts/highstock/themes/dark-unica.js +14 -0
  677. data/vendor/assets/javascripts/highstock/themes/dark-unica.js.map +1 -0
  678. data/vendor/assets/javascripts/highstock/themes/dark-unica.src.js +246 -0
  679. data/vendor/assets/javascripts/highstock/themes/gray.js +15 -0
  680. data/vendor/assets/javascripts/highstock/themes/gray.js.map +1 -0
  681. data/vendor/assets/javascripts/highstock/themes/gray.src.js +293 -0
  682. data/vendor/assets/javascripts/highstock/themes/grid-light.js +11 -0
  683. data/vendor/assets/javascripts/highstock/themes/grid-light.js.map +1 -0
  684. data/vendor/assets/javascripts/highstock/themes/grid-light.src.js +107 -0
  685. data/vendor/assets/javascripts/highstock/themes/grid.js +11 -0
  686. data/vendor/assets/javascripts/highstock/themes/grid.js.map +1 -0
  687. data/vendor/assets/javascripts/highstock/themes/grid.src.js +136 -0
  688. data/vendor/assets/javascripts/highstock/themes/sand-signika.js +11 -0
  689. data/vendor/assets/javascripts/highstock/themes/sand-signika.js.map +1 -0
  690. data/vendor/assets/javascripts/highstock/themes/sand-signika.src.js +137 -0
  691. data/vendor/assets/javascripts/highstock/themes/skies.js +11 -0
  692. data/vendor/assets/javascripts/highstock/themes/skies.js.map +1 -0
  693. data/vendor/assets/javascripts/highstock/themes/skies.src.js +126 -0
  694. data/vendor/assets/javascripts/highstock/themes/sunset.js +9 -0
  695. data/vendor/assets/javascripts/highstock/themes/sunset.js.map +1 -0
  696. data/vendor/assets/javascripts/highstock/themes/sunset.src.js +62 -0
  697. metadata +781 -0
@@ -0,0 +1,2417 @@
1
+ /**
2
+ * Data module
3
+ *
4
+ * (c) 2012-2019 Torstein Honsi
5
+ *
6
+ * License: www.highcharts.com/license
7
+ */
8
+
9
+ /**
10
+ * Callback function to modify the CSV before parsing it by the data module.
11
+ *
12
+ * @callback Highcharts.DataBeforeParseCallbackFunction
13
+ *
14
+ * @param {string} csv
15
+ * The CSV to modify.
16
+ *
17
+ * @return {string}
18
+ * The CSV to parse.
19
+ */
20
+
21
+ /**
22
+ * Callback function that gets called after parsing data.
23
+ *
24
+ * @callback Highcharts.DataCompleteCallbackFunction
25
+ *
26
+ * @param {Highcharts.ChartOptions} chartOptions
27
+ * The chart options that were used.
28
+ */
29
+
30
+ /**
31
+ * Callback function that returns the correspondig Date object to a match.
32
+ *
33
+ * @callback Highcharts.DataDateFormatCallbackFunction
34
+ *
35
+ * @param {Array<number>} match
36
+ *
37
+ * @return {global.Date}
38
+ */
39
+
40
+ /**
41
+ * Structure for alternative date formats to parse.
42
+ *
43
+ * @interface Highcharts.DataDateFormatObject
44
+ *//**
45
+ * @name Highcharts.DataDateFormatObject#alternative
46
+ * @type {string|undefined}
47
+ *//**
48
+ * @name Highcharts.DataDateFormatObject#parser
49
+ * @type {Highcharts.DataDateFormatCallbackFunction}
50
+ *//**
51
+ * @name Highcharts.DataDateFormatObject#regex
52
+ * @type {global.RegExp}
53
+ */
54
+
55
+ /**
56
+ * Callback function to parse string representations of dates into
57
+ * JavaScript timestamps (milliseconds since 1.1.1970).
58
+ *
59
+ * @callback Highcharts.DataParseDateCallbackFunction
60
+ *
61
+ * @param {string} dateValue
62
+ *
63
+ * @return {number}
64
+ * Timestamp (milliseconds since 1.1.1970) as integer for Date class.
65
+ */
66
+
67
+ /**
68
+ * Callback function to access the parsed columns, the two-dimentional
69
+ * input data array directly, before they are interpreted into series
70
+ * data and categories.
71
+ *
72
+ * @callback Highcharts.DataParsedCallbackFunction
73
+ *
74
+ * @param {Array<Array<*>>} columns
75
+ * The parsed columns by the data module.
76
+ *
77
+ * @return {boolean|undefined}
78
+ * Return `false` to stop completion, or call `this.complete()` to
79
+ * continue async.
80
+ */
81
+
82
+ 'use strict';
83
+
84
+ import Highcharts from '../parts/Globals.js';
85
+ import '../parts/Utilities.js';
86
+ import '../parts/Chart.js';
87
+ import '../mixins/ajax.js';
88
+
89
+ // Utilities
90
+ var addEvent = Highcharts.addEvent,
91
+ Chart = Highcharts.Chart,
92
+ win = Highcharts.win,
93
+ doc = win.document,
94
+ objectEach = Highcharts.objectEach,
95
+ pick = Highcharts.pick,
96
+ isNumber = Highcharts.isNumber,
97
+ merge = Highcharts.merge,
98
+ splat = Highcharts.splat,
99
+ fireEvent = Highcharts.fireEvent,
100
+ SeriesBuilder;
101
+
102
+ /**
103
+ * The Data module provides a simplified interface for adding data to
104
+ * a chart from sources like CVS, HTML tables or grid views. See also
105
+ * the [tutorial article on the Data module](
106
+ * https://www.highcharts.com/docs/working-with-data/data-module).
107
+ *
108
+ * It requires the `modules/data.js` file to be loaded.
109
+ *
110
+ * Please note that the default way of adding data in Highcharts, without
111
+ * the need of a module, is through the [series.data](#series.data)
112
+ * option.
113
+ *
114
+ * @sample {highcharts} highcharts/demo/column-parsed/
115
+ * HTML table
116
+ * @sample {highcharts} highcharts/data/csv/
117
+ * CSV
118
+ *
119
+ * @since 4.0
120
+ * @apioption data
121
+ */
122
+
123
+ /**
124
+ * A callback function to modify the CSV before parsing it. Return the modified
125
+ * string.
126
+ *
127
+ * @sample {highcharts} highcharts/demo/line-ajax/
128
+ * Modify CSV before parse
129
+ *
130
+ * @type {Highcharts.DataBeforeParseCallbackFunction}
131
+ * @since 6.1
132
+ * @apioption data.beforeParse
133
+ */
134
+
135
+ /**
136
+ * A two-dimensional array representing the input data on tabular form.
137
+ * This input can be used when the data is already parsed, for example
138
+ * from a grid view component. Each cell can be a string or number.
139
+ * If not switchRowsAndColumns is set, the columns are interpreted as
140
+ * series.
141
+ *
142
+ * @see [data.rows](#data.rows)
143
+ *
144
+ * @sample {highcharts} highcharts/data/columns/
145
+ * Columns
146
+ *
147
+ * @type {Array<Array<*>>}
148
+ * @since 4.0
149
+ * @apioption data.columns
150
+ */
151
+
152
+ /**
153
+ * The callback that is evaluated when the data is finished loading,
154
+ * optionally from an external source, and parsed. The first argument
155
+ * passed is a finished chart options object, containing the series.
156
+ * These options can be extended with additional options and passed
157
+ * directly to the chart constructor.
158
+ *
159
+ * @see [data.parsed](#data.parsed)
160
+ *
161
+ * @sample {highcharts} highcharts/data/complete/
162
+ * Modify data on complete
163
+ *
164
+ * @type {Highcharts.DataCompleteCallbackFunction}
165
+ * @since 4.0
166
+ * @apioption data.complete
167
+ */
168
+
169
+ /**
170
+ * A comma delimited string to be parsed. Related options are [startRow](
171
+ * #data.startRow), [endRow](#data.endRow), [startColumn](#data.startColumn)
172
+ * and [endColumn](#data.endColumn) to delimit what part of the table
173
+ * is used. The [lineDelimiter](#data.lineDelimiter) and [itemDelimiter](
174
+ * #data.itemDelimiter) options define the CSV delimiter formats.
175
+ *
176
+ * The built-in CSV parser doesn't support all flavours of CSV, so in
177
+ * some cases it may be necessary to use an external CSV parser. See
178
+ * [this example](https://jsfiddle.net/highcharts/u59176h4/) of parsing
179
+ * CSV through the MIT licensed [Papa Parse](http://papaparse.com/)
180
+ * library.
181
+ *
182
+ * @sample {highcharts} highcharts/data/csv/
183
+ * Data from CSV
184
+ *
185
+ * @type {string}
186
+ * @since 4.0
187
+ * @apioption data.csv
188
+ */
189
+
190
+ /**
191
+ * Which of the predefined date formats in Date.prototype.dateFormats
192
+ * to use to parse date values. Defaults to a best guess based on what
193
+ * format gives valid and ordered dates. Valid options include: `YYYY/mm/dd`,
194
+ * `dd/mm/YYYY`, `mm/dd/YYYY`, `dd/mm/YY`, `mm/dd/YY`.
195
+ *
196
+ * @see [data.parseDate](#data.parseDate)
197
+ *
198
+ * @sample {highcharts} highcharts/data/dateformat-auto/
199
+ * Best guess date format
200
+ *
201
+ * @type {string}
202
+ * @since 4.0
203
+ * @validvalue ["YYYY/mm/dd", "dd/mm/YYYY", "mm/dd/YYYY", "dd/mm/YYYY",
204
+ * "dd/mm/YY", "mm/dd/YY"]
205
+ * @apioption data.dateFormat
206
+ */
207
+
208
+ /**
209
+ * The decimal point used for parsing numbers in the CSV.
210
+ *
211
+ * If both this and data.delimiter is set to `undefined`, the parser will
212
+ * attempt to deduce the decimal point automatically.
213
+ *
214
+ * @sample {highcharts} highcharts/data/delimiters/
215
+ * Comma as decimal point
216
+ *
217
+ * @type {string}
218
+ * @default .
219
+ * @since 4.1.0
220
+ * @apioption data.decimalPoint
221
+ */
222
+
223
+ /**
224
+ * In tabular input data, the last column (indexed by 0) to use. Defaults
225
+ * to the last column containing data.
226
+ *
227
+ * @sample {highcharts} highcharts/data/start-end/
228
+ * Limited data
229
+ *
230
+ * @type {number}
231
+ * @since 4.0
232
+ * @apioption data.endColumn
233
+ */
234
+
235
+ /**
236
+ * In tabular input data, the last row (indexed by 0) to use. Defaults
237
+ * to the last row containing data.
238
+ *
239
+ * @sample {highcharts} highcharts/data/start-end/
240
+ * Limited data
241
+ *
242
+ * @type {number}
243
+ * @since 4.0.4
244
+ * @apioption data.endRow
245
+ */
246
+
247
+ /**
248
+ * Whether to use the first row in the data set as series names.
249
+ *
250
+ * @sample {highcharts} highcharts/data/start-end/
251
+ * Don't get series names from the CSV
252
+ * @sample {highstock} highcharts/data/start-end/
253
+ * Don't get series names from the CSV
254
+ *
255
+ * @type {boolean}
256
+ * @default true
257
+ * @since 4.1.0
258
+ * @product highcharts highstock gantt
259
+ * @apioption data.firstRowAsNames
260
+ */
261
+
262
+ /**
263
+ * The key for a Google Spreadsheet to load. See [general information
264
+ * on GS](https://developers.google.com/gdata/samples/spreadsheet_sample).
265
+ *
266
+ * @sample {highcharts} highcharts/data/google-spreadsheet/
267
+ * Load a Google Spreadsheet
268
+ *
269
+ * @type {string}
270
+ * @since 4.0
271
+ * @apioption data.googleSpreadsheetKey
272
+ */
273
+
274
+ /**
275
+ * The Google Spreadsheet worksheet to use in combination with
276
+ * [googleSpreadsheetKey](#data.googleSpreadsheetKey). The available id's from
277
+ * your sheet can be read from `https://spreadsheets.google.com/feeds/worksheets/{key}/public/basic`.
278
+ *
279
+ * @sample {highcharts} highcharts/data/google-spreadsheet/
280
+ * Load a Google Spreadsheet
281
+ *
282
+ * @type {string}
283
+ * @since 4.0
284
+ * @apioption data.googleSpreadsheetWorksheet
285
+ */
286
+
287
+ /**
288
+ * Item or cell delimiter for parsing CSV. Defaults to the tab character
289
+ * `\t` if a tab character is found in the CSV string, if not it defaults
290
+ * to `,`.
291
+ *
292
+ * If this is set to false or undefined, the parser will attempt to deduce
293
+ * the delimiter automatically.
294
+ *
295
+ * @sample {highcharts} highcharts/data/delimiters/
296
+ * Delimiters
297
+ *
298
+ * @type {string}
299
+ * @since 4.0
300
+ * @apioption data.itemDelimiter
301
+ */
302
+
303
+ /**
304
+ * Line delimiter for parsing CSV.
305
+ *
306
+ * @sample {highcharts} highcharts/data/delimiters/
307
+ * Delimiters
308
+ *
309
+ * @type {string}
310
+ * @default \n
311
+ * @since 4.0
312
+ * @apioption data.lineDelimiter
313
+ */
314
+
315
+ /**
316
+ * A callback function to parse string representations of dates into
317
+ * JavaScript timestamps. Should return an integer timestamp on success.
318
+ *
319
+ * @see [dateFormat](#data.dateFormat)
320
+ *
321
+ * @type {Highcharts.DataParseDateCallbackFunction}
322
+ * @since 4.0
323
+ * @apioption data.parseDate
324
+ */
325
+
326
+ /**
327
+ * A callback function to access the parsed columns, the two-dimentional
328
+ * input data array directly, before they are interpreted into series
329
+ * data and categories. Return `false` to stop completion, or call
330
+ * `this.complete()` to continue async.
331
+ *
332
+ * @see [data.complete](#data.complete)
333
+ *
334
+ * @sample {highcharts} highcharts/data/parsed/
335
+ * Modify data after parse
336
+ *
337
+ * @type {Highcharts.DataParsedCallbackFunction}
338
+ * @since 4.0
339
+ * @apioption data.parsed
340
+ */
341
+
342
+ /**
343
+ * The same as the columns input option, but defining rows intead of
344
+ * columns.
345
+ *
346
+ * @see [data.columns](#data.columns)
347
+ *
348
+ * @sample {highcharts} highcharts/data/rows/
349
+ * Data in rows
350
+ *
351
+ * @type {Array<Array<*>>}
352
+ * @since 4.0
353
+ * @apioption data.rows
354
+ */
355
+
356
+ /**
357
+ * An array containing dictionaries for each series. A dictionary exists of
358
+ * Point property names as the key and the CSV column index as the value.
359
+ *
360
+ * @sample {highcharts} highcharts/data/seriesmapping-label/
361
+ * Label from data set
362
+ *
363
+ * @type {Array<Highcharts.Dictionary<number>>}
364
+ * @since 4.0.4
365
+ * @apioption data.seriesMapping
366
+ */
367
+
368
+ /**
369
+ * In tabular input data, the first column (indexed by 0) to use.
370
+ *
371
+ * @sample {highcharts} highcharts/data/start-end/
372
+ * Limited data
373
+ *
374
+ * @type {number}
375
+ * @default 0
376
+ * @since 4.0
377
+ * @apioption data.startColumn
378
+ */
379
+
380
+ /**
381
+ * In tabular input data, the first row (indexed by 0) to use.
382
+ *
383
+ * @sample {highcharts} highcharts/data/start-end/
384
+ * Limited data
385
+ *
386
+ * @type {number}
387
+ * @default 0
388
+ * @since 4.0
389
+ * @apioption data.startRow
390
+ */
391
+
392
+ /**
393
+ * Switch rows and columns of the input data, so that `this.columns`
394
+ * effectively becomes the rows of the data set, and the rows are interpreted
395
+ * as series.
396
+ *
397
+ * @sample {highcharts} highcharts/data/switchrowsandcolumns/
398
+ * Switch rows and columns
399
+ *
400
+ * @type {boolean}
401
+ * @default false
402
+ * @since 4.0
403
+ * @apioption data.switchRowsAndColumns
404
+ */
405
+
406
+ /**
407
+ * An HTML table or the id of such to be parsed as input data. Related
408
+ * options are `startRow`, `endRow`, `startColumn` and `endColumn` to
409
+ * delimit what part of the table is used.
410
+ *
411
+ * @sample {highcharts} highcharts/demo/column-parsed/
412
+ * Parsed table
413
+ *
414
+ * @type {string|global.HTMLElement}
415
+ * @since 4.0
416
+ * @apioption data.table
417
+ */
418
+
419
+ /**
420
+ * An URL to a remote CSV dataset. Will be fetched when the chart is created
421
+ * using Ajax.
422
+ *
423
+ * @sample highcharts/data/livedata-columns
424
+ * Categorized bar chart with CSV and live polling
425
+ * @sample highcharts/data/livedata-csv
426
+ * Time based line chart with CSV and live polling
427
+ *
428
+ * @type {string}
429
+ * @apioption data.csvURL
430
+ */
431
+
432
+ /**
433
+ * A URL to a remote JSON dataset, structured as a row array.
434
+ * Will be fetched when the chart is created using Ajax.
435
+ *
436
+ * @sample highcharts/data/livedata-rows
437
+ * Rows with live polling
438
+ *
439
+ * @type {string}
440
+ * @apioption data.rowsURL
441
+ */
442
+
443
+ /**
444
+ * A URL to a remote JSON dataset, structured as a column array.
445
+ * Will be fetched when the chart is created using Ajax.
446
+ *
447
+ * @sample highcharts/data/livedata-columns
448
+ * Columns with live polling
449
+ *
450
+ * @type {string}
451
+ * @apioption data.columnsURL
452
+ */
453
+
454
+ /**
455
+ * Sets the refresh rate for data polling when importing remote dataset by
456
+ * setting [data.csvURL](data.csvURL), [data.rowsURL](data.rowsURL),
457
+ * [data.columnsURL](data.columnsURL), or
458
+ * [data.googleSpreadsheetKey](data.googleSpreadsheetKey).
459
+ *
460
+ * Note that polling must be enabled by setting
461
+ * [data.enablePolling](data.enablePolling) to true.
462
+ *
463
+ * The value is the number of seconds between pollings.
464
+ * It cannot be set to less than 1 second.
465
+ *
466
+ * @sample highcharts/demo/live-data
467
+ * Live data with user set refresh rate
468
+ *
469
+ * @default 1
470
+ * @type {number}
471
+ * @apioption data.dataRefreshRate
472
+ */
473
+
474
+ /**
475
+ * Enables automatic refetching of remote datasets every _n_ seconds (defined by
476
+ * setting [data.dataRefreshRate](data.dataRefreshRate)).
477
+ *
478
+ * Only works when either [data.csvURL](data.csvURL),
479
+ * [data.rowsURL](data.rowsURL), [data.columnsURL](data.columnsURL), or
480
+ * [data.googleSpreadsheetKey](data.googleSpreadsheetKey).
481
+ *
482
+ * @sample highcharts/demo/live-data
483
+ * Live data
484
+ * @sample highcharts/data/livedata-columns
485
+ * Categorized bar chart with CSV and live polling
486
+ *
487
+ * @type {boolean}
488
+ * @default false
489
+ * @apioption data.enablePolling
490
+ */
491
+
492
+ /**
493
+ * The Data class
494
+ *
495
+ * @requires module:modules/data
496
+ *
497
+ * @class
498
+ * @name Highcharts.Data
499
+ *
500
+ * @param {Highcharts.DataOptions} dataOptions
501
+ *
502
+ * @param {Highcharts.Options} [chartOptions]
503
+ *
504
+ * @param {Highcharts.Chart} [chart]
505
+ */
506
+ var Data = function (dataOptions, chartOptions, chart) {
507
+ this.init(dataOptions, chartOptions, chart);
508
+ };
509
+
510
+ // Set the prototype properties
511
+ Highcharts.extend(Data.prototype, {
512
+
513
+ /**
514
+ * Initialize the Data object with the given options
515
+ *
516
+ * @private
517
+ * @function Highcharts.Data#init
518
+ *
519
+ * @param {Highcharts.DataOptions} options
520
+ *
521
+ * @param {Highcharts.Options} [chartOptions]
522
+ *
523
+ * @param {Highcharts.Chart} [chart]
524
+ */
525
+ init: function (options, chartOptions, chart) {
526
+
527
+ var decimalPoint = options.decimalPoint,
528
+ hasData;
529
+
530
+ if (chartOptions) {
531
+ this.chartOptions = chartOptions;
532
+ }
533
+ if (chart) {
534
+ this.chart = chart;
535
+ }
536
+
537
+ if (decimalPoint !== '.' && decimalPoint !== ',') {
538
+ decimalPoint = undefined;
539
+ }
540
+
541
+ this.options = options;
542
+ this.columns = (
543
+ options.columns ||
544
+ this.rowsToColumns(options.rows) ||
545
+ []
546
+ );
547
+
548
+ this.firstRowAsNames = pick(
549
+ options.firstRowAsNames,
550
+ this.firstRowAsNames,
551
+ true
552
+ );
553
+
554
+ this.decimalRegex = (
555
+ decimalPoint &&
556
+ new RegExp('^(-?[0-9]+)' + decimalPoint + '([0-9]+)$') // eslint-disable-line security/detect-non-literal-regexp
557
+ );
558
+
559
+ // This is a two-dimensional array holding the raw, trimmed string
560
+ // values with the same organisation as the columns array. It makes it
561
+ // possible for example to revert from interpreted timestamps to
562
+ // string-based categories.
563
+ this.rawColumns = [];
564
+
565
+ // No need to parse or interpret anything
566
+ if (this.columns.length) {
567
+ this.dataFound();
568
+ hasData = true;
569
+ }
570
+
571
+ if (!hasData) {
572
+ // Fetch live data
573
+ hasData = this.fetchLiveData();
574
+ }
575
+
576
+ if (!hasData) {
577
+ // Parse a CSV string if options.csv is given. The parseCSV function
578
+ // returns a columns array, if it has no length, we have no data
579
+ hasData = Boolean(this.parseCSV().length);
580
+ }
581
+
582
+ if (!hasData) {
583
+ // Parse a HTML table if options.table is given
584
+ hasData = Boolean(this.parseTable().length);
585
+ }
586
+
587
+ if (!hasData) {
588
+ // Parse a Google Spreadsheet
589
+ hasData = this.parseGoogleSpreadsheet();
590
+ }
591
+
592
+ if (!hasData && options.afterComplete) {
593
+ options.afterComplete();
594
+ }
595
+ },
596
+
597
+ /**
598
+ * Get the column distribution. For example, a line series takes a single
599
+ * column for Y values. A range series takes two columns for low and high
600
+ * values respectively, and an OHLC series takes four columns.
601
+ *
602
+ * @function Highcharts.Data#getColumnDistribution
603
+ */
604
+ getColumnDistribution: function () {
605
+ var chartOptions = this.chartOptions,
606
+ options = this.options,
607
+ xColumns = [],
608
+ getValueCount = function (type) {
609
+ return (
610
+ Highcharts.seriesTypes[type || 'line'].prototype
611
+ .pointArrayMap ||
612
+ [0]
613
+ ).length;
614
+ },
615
+ getPointArrayMap = function (type) {
616
+ return Highcharts.seriesTypes[type || 'line']
617
+ .prototype.pointArrayMap;
618
+ },
619
+ globalType = (
620
+ chartOptions &&
621
+ chartOptions.chart &&
622
+ chartOptions.chart.type
623
+ ),
624
+ individualCounts = [],
625
+ seriesBuilders = [],
626
+ seriesIndex = 0,
627
+
628
+ // If no series mapping is defined, check if the series array is
629
+ // defined with types.
630
+ seriesMapping = (
631
+ (options && options.seriesMapping) ||
632
+ (
633
+ chartOptions &&
634
+ chartOptions.series &&
635
+ chartOptions.series.map(function () {
636
+ return { x: 0 };
637
+ })
638
+ ) ||
639
+ []
640
+ ),
641
+ i;
642
+
643
+ ((chartOptions && chartOptions.series) || []).forEach(
644
+ function (series) {
645
+ individualCounts.push(getValueCount(series.type || globalType));
646
+ }
647
+ );
648
+
649
+ // Collect the x-column indexes from seriesMapping
650
+ seriesMapping.forEach(function (mapping) {
651
+ xColumns.push(mapping.x || 0);
652
+ });
653
+
654
+ // If there are no defined series with x-columns, use the first column
655
+ // as x column
656
+ if (xColumns.length === 0) {
657
+ xColumns.push(0);
658
+ }
659
+
660
+ // Loop all seriesMappings and constructs SeriesBuilders from
661
+ // the mapping options.
662
+ seriesMapping.forEach(function (mapping) {
663
+ var builder = new SeriesBuilder(),
664
+ numberOfValueColumnsNeeded = individualCounts[seriesIndex] ||
665
+ getValueCount(globalType),
666
+ seriesArr = (chartOptions && chartOptions.series) || [],
667
+ series = seriesArr[seriesIndex] || {},
668
+ pointArrayMap = getPointArrayMap(series.type || globalType) ||
669
+ ['y'];
670
+
671
+ // Add an x reader from the x property or from an undefined column
672
+ // if the property is not set. It will then be auto populated later.
673
+ builder.addColumnReader(mapping.x, 'x');
674
+
675
+ // Add all column mappings
676
+ objectEach(mapping, function (val, name) {
677
+ if (name !== 'x') {
678
+ builder.addColumnReader(val, name);
679
+ }
680
+ });
681
+
682
+ // Add missing columns
683
+ for (i = 0; i < numberOfValueColumnsNeeded; i++) {
684
+ if (!builder.hasReader(pointArrayMap[i])) {
685
+ // Create and add a column reader for the next free column
686
+ // index
687
+ builder.addColumnReader(undefined, pointArrayMap[i]);
688
+ }
689
+ }
690
+
691
+ seriesBuilders.push(builder);
692
+ seriesIndex++;
693
+ });
694
+
695
+ var globalPointArrayMap = getPointArrayMap(globalType);
696
+
697
+ if (globalPointArrayMap === undefined) {
698
+ globalPointArrayMap = ['y'];
699
+ }
700
+
701
+ this.valueCount = {
702
+ global: getValueCount(globalType),
703
+ xColumns: xColumns,
704
+ individual: individualCounts,
705
+ seriesBuilders: seriesBuilders,
706
+ globalPointArrayMap: globalPointArrayMap
707
+ };
708
+ },
709
+
710
+ /**
711
+ * When the data is parsed into columns, either by CSV, table, GS or direct
712
+ * input, continue with other operations.
713
+ *
714
+ * @private
715
+ * @function Highcharts.Data#dataFound
716
+ */
717
+ dataFound: function () {
718
+ if (this.options.switchRowsAndColumns) {
719
+ this.columns = this.rowsToColumns(this.columns);
720
+ }
721
+
722
+ // Interpret the info about series and columns
723
+ this.getColumnDistribution();
724
+
725
+ // Interpret the values into right types
726
+ this.parseTypes();
727
+
728
+ // Handle columns if a handleColumns callback is given
729
+ if (this.parsed() !== false) {
730
+
731
+ // Complete if a complete callback is given
732
+ this.complete();
733
+ }
734
+
735
+ },
736
+
737
+ /**
738
+ * Parse a CSV input string
739
+ *
740
+ * @function Highcharts.Data#parseCSV
741
+ *
742
+ * @param {Highcharts.DataOptions} inOptions
743
+ *
744
+ * @return {Array<Array<*>>}
745
+ */
746
+ parseCSV: function (inOptions) {
747
+ var self = this,
748
+ options = inOptions || this.options,
749
+ csv = options.csv,
750
+ columns,
751
+ startRow = (
752
+ typeof options.startRow !== 'undefined' && options.startRow ?
753
+ options.startRow :
754
+ 0
755
+ ),
756
+ endRow = options.endRow || Number.MAX_VALUE,
757
+ startColumn = (
758
+ typeof options.startColumn !== 'undefined' &&
759
+ options.startColumn
760
+ ) ? options.startColumn : 0,
761
+ endColumn = options.endColumn || Number.MAX_VALUE,
762
+ itemDelimiter,
763
+ lines,
764
+ rowIt = 0,
765
+ // activeRowNo = 0,
766
+ dataTypes = [],
767
+ // We count potential delimiters in the prepass, and use the
768
+ // result as the basis of half-intelligent guesses.
769
+ potDelimiters = {
770
+ ',': 0,
771
+ ';': 0,
772
+ '\t': 0
773
+ };
774
+
775
+ columns = this.columns = [];
776
+
777
+ /*
778
+ This implementation is quite verbose. It will be shortened once
779
+ it's stable and passes all the test.
780
+
781
+ It's also not written with speed in mind, instead everything is
782
+ very seggregated, and there a several redundant loops.
783
+ This is to make it easier to stabilize the code initially.
784
+
785
+ We do a pre-pass on the first 4 rows to make some intelligent
786
+ guesses on the set. Guessed delimiters are in this pass counted.
787
+
788
+ Auto detecting delimiters
789
+ - If we meet a quoted string, the next symbol afterwards
790
+ (that's not \s, \t) is the delimiter
791
+ - If we meet a date, the next symbol afterwards is the delimiter
792
+
793
+ Date formats
794
+ - If we meet a column with date formats, check all of them to
795
+ see if one of the potential months crossing 12. If it does,
796
+ we now know the format
797
+
798
+ It would make things easier to guess the delimiter before
799
+ doing the actual parsing.
800
+
801
+ General rules:
802
+ - Quoting is allowed, e.g: "Col 1",123,321
803
+ - Quoting is optional, e.g.: Col1,123,321
804
+ - Doubble quoting is escaping, e.g. "Col ""Hello world""",123
805
+ - Spaces are considered part of the data: Col1 ,123
806
+ - New line is always the row delimiter
807
+ - Potential column delimiters are , ; \t
808
+ - First row may optionally contain headers
809
+ - The last row may or may not have a row delimiter
810
+ - Comments are optionally supported, in which case the comment
811
+ must start at the first column, and the rest of the line will
812
+ be ignored
813
+ */
814
+
815
+ // Parse a single row
816
+ function parseRow(columnStr, rowNumber, noAdd, callbacks) {
817
+ var i = 0,
818
+ c = '',
819
+ cl = '',
820
+ cn = '',
821
+ token = '',
822
+ actualColumn = 0,
823
+ column = 0;
824
+
825
+ function read(j) {
826
+ c = columnStr[j];
827
+ cl = columnStr[j - 1];
828
+ cn = columnStr[j + 1];
829
+ }
830
+
831
+ function pushType(type) {
832
+ if (dataTypes.length < column + 1) {
833
+ dataTypes.push([type]);
834
+ }
835
+ if (dataTypes[column][dataTypes[column].length - 1] !== type) {
836
+ dataTypes[column].push(type);
837
+ }
838
+ }
839
+
840
+ function push() {
841
+ if (startColumn > actualColumn || actualColumn > endColumn) {
842
+ // Skip this column, but increment the column count (#7272)
843
+ ++actualColumn;
844
+ token = '';
845
+ return;
846
+ }
847
+
848
+ if (!isNaN(parseFloat(token)) && isFinite(token)) {
849
+ token = parseFloat(token);
850
+ pushType('number');
851
+ } else if (!isNaN(Date.parse(token))) {
852
+ token = token.replace(/\//g, '-');
853
+ pushType('date');
854
+ } else {
855
+ pushType('string');
856
+ }
857
+
858
+ if (columns.length < column + 1) {
859
+ columns.push([]);
860
+ }
861
+
862
+ if (!noAdd) {
863
+ // Don't push - if there's a varrying amount of columns
864
+ // for each row, pushing will skew everything down n slots
865
+ columns[column][rowNumber] = token;
866
+ }
867
+
868
+ token = '';
869
+ ++column;
870
+ ++actualColumn;
871
+ }
872
+
873
+ if (!columnStr.trim().length) {
874
+ return;
875
+ }
876
+
877
+ if (columnStr.trim()[0] === '#') {
878
+ return;
879
+ }
880
+
881
+ for (; i < columnStr.length; i++) {
882
+ read(i);
883
+
884
+ // Quoted string
885
+ if (c === '#') {
886
+ // The rest of the row is a comment
887
+ push();
888
+ return;
889
+ }
890
+
891
+ if (c === '"') {
892
+ read(++i);
893
+
894
+ while (i < columnStr.length) {
895
+ if (c === '"' && cl !== '"' && cn !== '"') {
896
+ break;
897
+ }
898
+
899
+ if (c !== '"' || (c === '"' && cl !== '"')) {
900
+ token += c;
901
+ }
902
+
903
+ read(++i);
904
+ }
905
+
906
+ // Perform "plugin" handling
907
+ } else if (callbacks && callbacks[c]) {
908
+ if (callbacks[c](c, token)) {
909
+ push();
910
+ }
911
+
912
+ // Delimiter - push current token
913
+ } else if (c === itemDelimiter) {
914
+ push();
915
+
916
+ // Actual column data
917
+ } else {
918
+ token += c;
919
+ }
920
+ }
921
+
922
+ push();
923
+
924
+ }
925
+
926
+ // Attempt to guess the delimiter
927
+ // We do a separate parse pass here because we need
928
+ // to count potential delimiters softly without making any assumptions.
929
+ function guessDelimiter(lines) {
930
+ var points = 0,
931
+ commas = 0,
932
+ guessed = false;
933
+
934
+ lines.some(function (columnStr, i) {
935
+ var inStr = false,
936
+ c,
937
+ cn,
938
+ cl,
939
+ token = '';
940
+
941
+
942
+ // We should be able to detect dateformats within 13 rows
943
+ if (i > 13) {
944
+ return true;
945
+ }
946
+
947
+ for (var j = 0; j < columnStr.length; j++) {
948
+ c = columnStr[j];
949
+ cn = columnStr[j + 1];
950
+ cl = columnStr[j - 1];
951
+
952
+ if (c === '#') {
953
+ // Skip the rest of the line - it's a comment
954
+ return;
955
+ }
956
+
957
+ if (c === '"') {
958
+ if (inStr) {
959
+ if (cl !== '"' && cn !== '"') {
960
+ while (cn === ' ' && j < columnStr.length) {
961
+ cn = columnStr[++j];
962
+ }
963
+
964
+ // After parsing a string, the next non-blank
965
+ // should be a delimiter if the CSV is properly
966
+ // formed.
967
+
968
+ if (typeof potDelimiters[cn] !== 'undefined') {
969
+ potDelimiters[cn]++;
970
+ }
971
+
972
+ inStr = false;
973
+ }
974
+ } else {
975
+ inStr = true;
976
+ }
977
+ } else if (typeof potDelimiters[c] !== 'undefined') {
978
+
979
+ token = token.trim();
980
+
981
+ if (!isNaN(Date.parse(token))) {
982
+ potDelimiters[c]++;
983
+ } else if (isNaN(token) || !isFinite(token)) {
984
+ potDelimiters[c]++;
985
+ }
986
+
987
+ token = '';
988
+
989
+ } else {
990
+ token += c;
991
+ }
992
+
993
+ if (c === ',') {
994
+ commas++;
995
+ }
996
+
997
+ if (c === '.') {
998
+ points++;
999
+ }
1000
+ }
1001
+ });
1002
+
1003
+ // Count the potential delimiters.
1004
+ // This could be improved by checking if the number of delimiters
1005
+ // equals the number of columns - 1
1006
+
1007
+ if (potDelimiters[';'] > potDelimiters[',']) {
1008
+ guessed = ';';
1009
+ } else if (potDelimiters[','] > potDelimiters[';']) {
1010
+ guessed = ',';
1011
+ } else {
1012
+ // No good guess could be made..
1013
+ guessed = ',';
1014
+ }
1015
+
1016
+ // Try to deduce the decimal point if it's not explicitly set.
1017
+ // If both commas or points is > 0 there is likely an issue
1018
+ if (!options.decimalPoint) {
1019
+ if (points > commas) {
1020
+ options.decimalPoint = '.';
1021
+ } else {
1022
+ options.decimalPoint = ',';
1023
+ }
1024
+
1025
+ // Apply a new decimal regex based on the presumed decimal sep.
1026
+ self.decimalRegex = new RegExp( // eslint-disable-line security/detect-non-literal-regexp
1027
+ '^(-?[0-9]+)' +
1028
+ options.decimalPoint +
1029
+ '([0-9]+)$'
1030
+ );
1031
+ }
1032
+
1033
+ return guessed;
1034
+ }
1035
+
1036
+ /* Tries to guess the date format
1037
+ * - Check if either month candidate exceeds 12
1038
+ * - Check if year is missing (use current year)
1039
+ * - Check if a shortened year format is used (e.g. 1/1/99)
1040
+ * - If no guess can be made, the user must be prompted
1041
+ * data is the data to deduce a format based on
1042
+ */
1043
+ function deduceDateFormat(data, limit) {
1044
+ var format = 'YYYY/mm/dd',
1045
+ thing,
1046
+ guessedFormat,
1047
+ calculatedFormat,
1048
+ i = 0,
1049
+ madeDeduction = false,
1050
+ // candidates = {},
1051
+ stable = [],
1052
+ max = [],
1053
+ j;
1054
+
1055
+ if (!limit || limit > data.length) {
1056
+ limit = data.length;
1057
+ }
1058
+
1059
+ for (; i < limit; i++) {
1060
+ if (
1061
+ typeof data[i] !== 'undefined' &&
1062
+ data[i] && data[i].length
1063
+ ) {
1064
+ thing = data[i]
1065
+ .trim()
1066
+ .replace(/\//g, ' ')
1067
+ .replace(/\-/g, ' ')
1068
+ .replace(/\./g, ' ')
1069
+ .split(' ');
1070
+
1071
+ guessedFormat = [
1072
+ '',
1073
+ '',
1074
+ ''
1075
+ ];
1076
+
1077
+
1078
+ for (j = 0; j < thing.length; j++) {
1079
+ if (j < guessedFormat.length) {
1080
+ thing[j] = parseInt(thing[j], 10);
1081
+
1082
+ if (thing[j]) {
1083
+
1084
+ max[j] = (!max[j] || max[j] < thing[j]) ?
1085
+ thing[j] :
1086
+ max[j];
1087
+
1088
+ if (typeof stable[j] !== 'undefined') {
1089
+ if (stable[j] !== thing[j]) {
1090
+ stable[j] = false;
1091
+ }
1092
+ } else {
1093
+ stable[j] = thing[j];
1094
+ }
1095
+
1096
+ if (thing[j] > 31) {
1097
+ if (thing[j] < 100) {
1098
+ guessedFormat[j] = 'YY';
1099
+ } else {
1100
+ guessedFormat[j] = 'YYYY';
1101
+ }
1102
+ // madeDeduction = true;
1103
+ } else if (thing[j] > 12 && thing[j] <= 31) {
1104
+ guessedFormat[j] = 'dd';
1105
+ madeDeduction = true;
1106
+ } else if (!guessedFormat[j].length) {
1107
+ guessedFormat[j] = 'mm';
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ if (madeDeduction) {
1116
+
1117
+ // This handles a few edge cases with hard to guess dates
1118
+ for (j = 0; j < stable.length; j++) {
1119
+ if (stable[j] !== false) {
1120
+ if (
1121
+ max[j] > 12 &&
1122
+ guessedFormat[j] !== 'YY' &&
1123
+ guessedFormat[j] !== 'YYYY'
1124
+ ) {
1125
+ guessedFormat[j] = 'YY';
1126
+ }
1127
+ } else if (max[j] > 12 && guessedFormat[j] === 'mm') {
1128
+ guessedFormat[j] = 'dd';
1129
+ }
1130
+ }
1131
+
1132
+ // If the middle one is dd, and the last one is dd,
1133
+ // the last should likely be year.
1134
+ if (guessedFormat.length === 3 &&
1135
+ guessedFormat[1] === 'dd' &&
1136
+ guessedFormat[2] === 'dd') {
1137
+ guessedFormat[2] = 'YY';
1138
+ }
1139
+
1140
+ calculatedFormat = guessedFormat.join('/');
1141
+
1142
+ // If the caculated format is not valid, we need to present an
1143
+ // error.
1144
+
1145
+ if (
1146
+ !(options.dateFormats || self.dateFormats)[calculatedFormat]
1147
+ ) {
1148
+ // This should emit an event instead
1149
+ fireEvent('deduceDateFailed');
1150
+ return format;
1151
+ }
1152
+
1153
+ return calculatedFormat;
1154
+ }
1155
+
1156
+ return format;
1157
+ }
1158
+
1159
+ /* Figure out the best axis types for the data
1160
+ * - If the first column is a number, we're good
1161
+ * - If the first column is a date, set to date/time
1162
+ * - If the first column is a string, set to categories
1163
+ */
1164
+ function deduceAxisTypes() {
1165
+
1166
+ }
1167
+
1168
+ if (csv && options.beforeParse) {
1169
+ csv = options.beforeParse.call(this, csv);
1170
+ }
1171
+
1172
+ if (csv) {
1173
+
1174
+ lines = csv
1175
+ .replace(/\r\n/g, '\n') // Unix
1176
+ .replace(/\r/g, '\n') // Mac
1177
+ .split(options.lineDelimiter || '\n');
1178
+
1179
+ if (!startRow || startRow < 0) {
1180
+ startRow = 0;
1181
+ }
1182
+
1183
+ if (!endRow || endRow >= lines.length) {
1184
+ endRow = lines.length - 1;
1185
+ }
1186
+
1187
+ if (options.itemDelimiter) {
1188
+ itemDelimiter = options.itemDelimiter;
1189
+ } else {
1190
+ itemDelimiter = null;
1191
+ itemDelimiter = guessDelimiter(lines);
1192
+ }
1193
+
1194
+ var offset = 0;
1195
+
1196
+ for (rowIt = startRow; rowIt <= endRow; rowIt++) {
1197
+ if (lines[rowIt][0] === '#') {
1198
+ offset++;
1199
+ } else {
1200
+ parseRow(lines[rowIt], rowIt - startRow - offset);
1201
+ }
1202
+ }
1203
+
1204
+ // //Make sure that there's header columns for everything
1205
+ // columns.forEach(function (col) {
1206
+
1207
+ // });
1208
+
1209
+ deduceAxisTypes();
1210
+
1211
+ if ((!options.columnTypes || options.columnTypes.length === 0) &&
1212
+ dataTypes.length &&
1213
+ dataTypes[0].length &&
1214
+ dataTypes[0][1] === 'date' &&
1215
+ !options.dateFormat) {
1216
+ options.dateFormat = deduceDateFormat(columns[0]);
1217
+ }
1218
+
1219
+
1220
+ // lines.forEach(function (line, rowNo) {
1221
+ // var trimmed = self.trim(line),
1222
+ // isComment = trimmed.indexOf('#') === 0,
1223
+ // isBlank = trimmed === '',
1224
+ // items;
1225
+
1226
+ // if (
1227
+ // rowNo >= startRow &&
1228
+ // rowNo <= endRow &&
1229
+ // !isComment && !isBlank
1230
+ // ) {
1231
+ // items = line.split(itemDelimiter);
1232
+ // items.forEach(function (item, colNo) {
1233
+ // if (colNo >= startColumn && colNo <= endColumn) {
1234
+ // if (!columns[colNo - startColumn]) {
1235
+ // columns[colNo - startColumn] = [];
1236
+ // }
1237
+
1238
+ // columns[colNo - startColumn][activeRowNo] = item;
1239
+ // }
1240
+ // });
1241
+ // activeRowNo += 1;
1242
+ // }
1243
+ // });
1244
+ //
1245
+
1246
+ this.dataFound();
1247
+ }
1248
+
1249
+ return columns;
1250
+ },
1251
+
1252
+ /**
1253
+ * Parse a HTML table
1254
+ *
1255
+ * @function Highcharts.Data#parseTable
1256
+ *
1257
+ * @return {Array<Array<*>>}
1258
+ */
1259
+ parseTable: function () {
1260
+ var options = this.options,
1261
+ table = options.table,
1262
+ columns = this.columns,
1263
+ startRow = options.startRow || 0,
1264
+ endRow = options.endRow || Number.MAX_VALUE,
1265
+ startColumn = options.startColumn || 0,
1266
+ endColumn = options.endColumn || Number.MAX_VALUE;
1267
+
1268
+ if (table) {
1269
+
1270
+ if (typeof table === 'string') {
1271
+ table = doc.getElementById(table);
1272
+ }
1273
+
1274
+ [].forEach.call(
1275
+ table.getElementsByTagName('tr'),
1276
+ function (tr, rowNo) {
1277
+ if (rowNo >= startRow && rowNo <= endRow) {
1278
+ [].forEach.call(tr.children, function (item, colNo) {
1279
+ if (
1280
+ (
1281
+ item.tagName === 'TD' ||
1282
+ item.tagName === 'TH'
1283
+ ) &&
1284
+ colNo >= startColumn &&
1285
+ colNo <= endColumn
1286
+ ) {
1287
+ if (!columns[colNo - startColumn]) {
1288
+ columns[colNo - startColumn] = [];
1289
+ }
1290
+
1291
+ columns[colNo - startColumn][rowNo - startRow] =
1292
+ item.innerHTML;
1293
+ }
1294
+ });
1295
+ }
1296
+ }
1297
+ );
1298
+
1299
+ this.dataFound(); // continue
1300
+ }
1301
+ return columns;
1302
+ },
1303
+
1304
+
1305
+ /**
1306
+ * Fetch or refetch live data
1307
+ *
1308
+ * @function Highcharts.Data#fetchLiveData
1309
+ *
1310
+ * @return {string}
1311
+ * The first URL that was tried.
1312
+ */
1313
+ fetchLiveData: function () {
1314
+ var chart = this.chart,
1315
+ options = this.options,
1316
+ maxRetries = 3,
1317
+ currentRetries = 0,
1318
+ pollingEnabled = options.enablePolling,
1319
+ updateIntervalMs = (options.dataRefreshRate || 2) * 1000,
1320
+ originalOptions = merge(options);
1321
+
1322
+ if (!options ||
1323
+ (!options.csvURL && !options.rowsURL && !options.columnsURL)
1324
+ ) {
1325
+ return false;
1326
+ }
1327
+
1328
+ // Do not allow polling more than once a second
1329
+ if (updateIntervalMs < 1000) {
1330
+ updateIntervalMs = 1000;
1331
+ }
1332
+
1333
+ delete options.csvURL;
1334
+ delete options.rowsURL;
1335
+ delete options.columnsURL;
1336
+
1337
+ function performFetch(initialFetch) {
1338
+
1339
+ // Helper function for doing the data fetch + polling
1340
+ function request(url, done, tp) {
1341
+ if (!url || url.indexOf('http') !== 0) {
1342
+ if (url && options.error) {
1343
+ options.error('Invalid URL');
1344
+ }
1345
+ return false;
1346
+ }
1347
+
1348
+ if (initialFetch) {
1349
+ clearTimeout(chart.liveDataTimeout);
1350
+ chart.liveDataURL = url;
1351
+ }
1352
+
1353
+ function poll() {
1354
+ // Poll
1355
+ if (pollingEnabled && chart.liveDataURL === url) {
1356
+ // We need to stop doing this if the URL has changed
1357
+ chart.liveDataTimeout =
1358
+ setTimeout(performFetch, updateIntervalMs);
1359
+ }
1360
+ }
1361
+
1362
+ Highcharts.ajax({
1363
+ url: url,
1364
+ dataType: tp || 'json',
1365
+ success: function (res) {
1366
+ if (chart && chart.series) {
1367
+ done(res);
1368
+ }
1369
+
1370
+ poll();
1371
+
1372
+ },
1373
+ error: function (xhr, text) {
1374
+ if (++currentRetries < maxRetries) {
1375
+ poll();
1376
+ }
1377
+
1378
+ return options.error && options.error(text, xhr);
1379
+ }
1380
+ });
1381
+
1382
+ return true;
1383
+ }
1384
+
1385
+ if (!request(originalOptions.csvURL, function (res) {
1386
+ chart.update({
1387
+ data: {
1388
+ csv: res
1389
+ }
1390
+ });
1391
+ }, 'text')) {
1392
+ if (!request(originalOptions.rowsURL, function (res) {
1393
+ chart.update({
1394
+ data: {
1395
+ rows: res
1396
+ }
1397
+ });
1398
+ })) {
1399
+ request(originalOptions.columnsURL, function (res) {
1400
+ chart.update({
1401
+ data: {
1402
+ columns: res
1403
+ }
1404
+ });
1405
+ });
1406
+ }
1407
+ }
1408
+ }
1409
+
1410
+ performFetch(true);
1411
+
1412
+ return (options &&
1413
+ (options.csvURL || options.rowsURL || options.columnsURL)
1414
+ );
1415
+ },
1416
+
1417
+
1418
+ /**
1419
+ * Parse a Google spreadsheet.
1420
+ *
1421
+ * @function Highcharts.Data#parseGoogleSpreadsheet
1422
+ *
1423
+ * @return {boolean}
1424
+ * Always returns false, because it is an intermediate fetch.
1425
+ */
1426
+ parseGoogleSpreadsheet: function () {
1427
+ var data = this,
1428
+ options = this.options,
1429
+ googleSpreadsheetKey = options.googleSpreadsheetKey,
1430
+ chart = this.chart,
1431
+ // use sheet 1 as the default rather than od6
1432
+ // as the latter sometimes cause issues (it looks like it can
1433
+ // be renamed in some cases, ref. a fogbugz case).
1434
+ worksheet = options.googleSpreadsheetWorksheet || 1,
1435
+ startRow = options.startRow || 0,
1436
+ endRow = options.endRow || Number.MAX_VALUE,
1437
+ startColumn = options.startColumn || 0,
1438
+ endColumn = options.endColumn || Number.MAX_VALUE,
1439
+ refreshRate = (options.dataRefreshRate || 2) * 1000;
1440
+
1441
+ if (refreshRate < 4000) {
1442
+ refreshRate = 4000;
1443
+ }
1444
+
1445
+ /*
1446
+ * Fetch the actual spreadsheet using XMLHttpRequest
1447
+ */
1448
+ function fetchSheet(fn) {
1449
+ var url = [
1450
+ 'https://spreadsheets.google.com/feeds/cells',
1451
+ googleSpreadsheetKey,
1452
+ worksheet,
1453
+ 'public/values?alt=json'
1454
+ ].join('/');
1455
+
1456
+ Highcharts.ajax({
1457
+ url: url,
1458
+ dataType: 'json',
1459
+ success: function (json) {
1460
+ fn(json);
1461
+
1462
+ if (options.enablePolling) {
1463
+ setTimeout(function () {
1464
+ fetchSheet(fn);
1465
+ }, options.dataRefreshRate);
1466
+ }
1467
+ },
1468
+ error: function (xhr, text) {
1469
+ return options.error && options.error(text, xhr);
1470
+ }
1471
+ });
1472
+ }
1473
+
1474
+ if (googleSpreadsheetKey) {
1475
+
1476
+ delete options.googleSpreadsheetKey;
1477
+
1478
+ fetchSheet(function (json) {
1479
+ // Prepare the data from the spreadsheat
1480
+ var columns = [],
1481
+ cells = json.feed.entry,
1482
+ cell,
1483
+ cellCount = (cells || []).length,
1484
+ colCount = 0,
1485
+ rowCount = 0,
1486
+ val,
1487
+ gr,
1488
+ gc,
1489
+ cellInner,
1490
+ i;
1491
+
1492
+ if (!cells || cells.length === 0) {
1493
+ return false;
1494
+ }
1495
+
1496
+ // First, find the total number of columns and rows that
1497
+ // are actually filled with data
1498
+ for (i = 0; i < cellCount; i++) {
1499
+ cell = cells[i];
1500
+ colCount = Math.max(colCount, cell.gs$cell.col);
1501
+ rowCount = Math.max(rowCount, cell.gs$cell.row);
1502
+ }
1503
+
1504
+ // Set up arrays containing the column data
1505
+ for (i = 0; i < colCount; i++) {
1506
+ if (i >= startColumn && i <= endColumn) {
1507
+ // Create new columns with the length of either
1508
+ // end-start or rowCount
1509
+ columns[i - startColumn] = [];
1510
+ }
1511
+ }
1512
+
1513
+ // Loop over the cells and assign the value to the right
1514
+ // place in the column arrays
1515
+ for (i = 0; i < cellCount; i++) {
1516
+ cell = cells[i];
1517
+ gr = cell.gs$cell.row - 1; // rows start at 1
1518
+ gc = cell.gs$cell.col - 1; // columns start at 1
1519
+
1520
+ // If both row and col falls inside start and end set the
1521
+ // transposed cell value in the newly created columns
1522
+ if (gc >= startColumn && gc <= endColumn &&
1523
+ gr >= startRow && gr <= endRow) {
1524
+
1525
+ cellInner = cell.gs$cell || cell.content;
1526
+
1527
+ val = null;
1528
+
1529
+ if (cellInner.numericValue) {
1530
+ if (cellInner.$t.indexOf('/') >= 0 ||
1531
+ cellInner.$t.indexOf('-') >= 0) {
1532
+ // This is a date - for future reference.
1533
+ val = cellInner.$t;
1534
+ } else if (cellInner.$t.indexOf('%') > 0) {
1535
+ // Percentage
1536
+ val = parseFloat(cellInner.numericValue) * 100;
1537
+ } else {
1538
+ val = parseFloat(cellInner.numericValue);
1539
+ }
1540
+ } else if (cellInner.$t && cellInner.$t.length) {
1541
+ val = cellInner.$t;
1542
+ }
1543
+
1544
+ columns[gc - startColumn][gr - startRow] = val;
1545
+ }
1546
+ }
1547
+
1548
+ // Insert null for empty spreadsheet cells (#5298)
1549
+ columns.forEach(function (column) {
1550
+ for (i = 0; i < column.length; i++) {
1551
+ if (column[i] === undefined) {
1552
+ column[i] = null;
1553
+ }
1554
+ }
1555
+ });
1556
+
1557
+ if (chart && chart.series) {
1558
+ chart.update({
1559
+ data: {
1560
+ columns: columns
1561
+ }
1562
+ });
1563
+ } else { // #8245
1564
+ data.columns = columns;
1565
+ data.dataFound();
1566
+ }
1567
+ });
1568
+ }
1569
+
1570
+ // This is an intermediate fetch, so always return false.
1571
+ return false;
1572
+ },
1573
+
1574
+ /**
1575
+ * Trim a string from whitespaces.
1576
+ *
1577
+ * @function Highcharts.Data#trim
1578
+ *
1579
+ * @param {string} str
1580
+ * String to trim
1581
+ *
1582
+ * @param {boolean} [inside=false]
1583
+ * Remove all spaces between numbers.
1584
+ *
1585
+ * @return {string}
1586
+ * Trimed string
1587
+ */
1588
+ trim: function (str, inside) {
1589
+ if (typeof str === 'string') {
1590
+ str = str.replace(/^\s+|\s+$/g, '');
1591
+
1592
+ // Clear white space insdie the string, like thousands separators
1593
+ if (inside && /^[0-9\s]+$/.test(str)) {
1594
+ str = str.replace(/\s/g, '');
1595
+ }
1596
+
1597
+ if (this.decimalRegex) {
1598
+ str = str.replace(this.decimalRegex, '$1.$2');
1599
+ }
1600
+ }
1601
+ return str;
1602
+ },
1603
+
1604
+ /**
1605
+ * Parse numeric cells in to number types and date types in to true dates.
1606
+ *
1607
+ * @function Highcharts.Data#parseTypes
1608
+ */
1609
+ parseTypes: function () {
1610
+ var columns = this.columns,
1611
+ col = columns.length;
1612
+
1613
+ while (col--) {
1614
+ this.parseColumn(columns[col], col);
1615
+ }
1616
+
1617
+ },
1618
+
1619
+ /**
1620
+ * Parse a single column. Set properties like .isDatetime and .isNumeric.
1621
+ *
1622
+ * @function Highcharts.Data#parseColumn
1623
+ *
1624
+ * @param {Array<*>} column
1625
+ * Column to parse
1626
+ *
1627
+ * @param {number} col
1628
+ * Column index
1629
+ */
1630
+ parseColumn: function (column, col) {
1631
+ var rawColumns = this.rawColumns,
1632
+ columns = this.columns,
1633
+ row = column.length,
1634
+ val,
1635
+ floatVal,
1636
+ trimVal,
1637
+ trimInsideVal,
1638
+ firstRowAsNames = this.firstRowAsNames,
1639
+ isXColumn = this.valueCount.xColumns.indexOf(col) !== -1,
1640
+ dateVal,
1641
+ backup = [],
1642
+ diff,
1643
+ chartOptions = this.chartOptions,
1644
+ descending,
1645
+ columnTypes = this.options.columnTypes || [],
1646
+ columnType = columnTypes[col],
1647
+ forceCategory = isXColumn && ((
1648
+ chartOptions &&
1649
+ chartOptions.xAxis &&
1650
+ splat(chartOptions.xAxis)[0].type === 'category'
1651
+ ) || columnType === 'string');
1652
+
1653
+ if (!rawColumns[col]) {
1654
+ rawColumns[col] = [];
1655
+ }
1656
+ while (row--) {
1657
+ val = backup[row] || column[row];
1658
+
1659
+ trimVal = this.trim(val);
1660
+ trimInsideVal = this.trim(val, true);
1661
+ floatVal = parseFloat(trimInsideVal);
1662
+
1663
+ // Set it the first time
1664
+ if (rawColumns[col][row] === undefined) {
1665
+ rawColumns[col][row] = trimVal;
1666
+ }
1667
+
1668
+ // Disable number or date parsing by setting the X axis type to
1669
+ // category
1670
+ if (forceCategory || (row === 0 && firstRowAsNames)) {
1671
+ column[row] = '' + trimVal;
1672
+
1673
+ } else if (+trimInsideVal === floatVal) { // is numeric
1674
+
1675
+ column[row] = floatVal;
1676
+
1677
+ // If the number is greater than milliseconds in a year, assume
1678
+ // datetime
1679
+ if (
1680
+ floatVal > 365 * 24 * 3600 * 1000 &&
1681
+ columnType !== 'float'
1682
+ ) {
1683
+ column.isDatetime = true;
1684
+ } else {
1685
+ column.isNumeric = true;
1686
+ }
1687
+
1688
+ if (column[row + 1] !== undefined) {
1689
+ descending = floatVal > column[row + 1];
1690
+ }
1691
+
1692
+ // String, continue to determine if it is a date string or really a
1693
+ // string
1694
+ } else {
1695
+ if (trimVal && trimVal.length) {
1696
+ dateVal = this.parseDate(val);
1697
+ }
1698
+
1699
+ // Only allow parsing of dates if this column is an x-column
1700
+ if (isXColumn && isNumber(dateVal) && columnType !== 'float') {
1701
+ backup[row] = val;
1702
+ column[row] = dateVal;
1703
+ column.isDatetime = true;
1704
+
1705
+ // Check if the dates are uniformly descending or ascending.
1706
+ // If they are not, chances are that they are a different
1707
+ // time format, so check for alternative.
1708
+ if (column[row + 1] !== undefined) {
1709
+ diff = dateVal > column[row + 1];
1710
+ if (diff !== descending && descending !== undefined) {
1711
+ if (this.alternativeFormat) {
1712
+ this.dateFormat = this.alternativeFormat;
1713
+ row = column.length;
1714
+ this.alternativeFormat =
1715
+ this.dateFormats[this.dateFormat]
1716
+ .alternative;
1717
+ } else {
1718
+ column.unsorted = true;
1719
+ }
1720
+ }
1721
+ descending = diff;
1722
+ }
1723
+
1724
+ } else { // string
1725
+ column[row] = trimVal === '' ? null : trimVal;
1726
+ if (row !== 0 && (column.isDatetime || column.isNumeric)) {
1727
+ column.mixed = true;
1728
+ }
1729
+ }
1730
+ }
1731
+ }
1732
+
1733
+ // If strings are intermixed with numbers or dates in a parsed column,
1734
+ // it is an indication that parsing went wrong or the data was not
1735
+ // intended to display as numbers or dates and parsing is too
1736
+ // aggressive. Fall back to categories. Demonstrated in the
1737
+ // highcharts/demo/column-drilldown sample.
1738
+ if (isXColumn && column.mixed) {
1739
+ columns[col] = rawColumns[col];
1740
+ }
1741
+
1742
+ // If the 0 column is date or number and descending, reverse all
1743
+ // columns.
1744
+ if (isXColumn && descending && this.options.sort) {
1745
+ for (col = 0; col < columns.length; col++) {
1746
+ columns[col].reverse();
1747
+ if (firstRowAsNames) {
1748
+ columns[col].unshift(columns[col].pop());
1749
+ }
1750
+ }
1751
+ }
1752
+ },
1753
+
1754
+ /**
1755
+ * A collection of available date formats, extendable from the outside to
1756
+ * support custom date formats.
1757
+ *
1758
+ * @name Highcharts.Data#dateFormats
1759
+ * @type {Highcharts.Dictionary<Highcharts.DataDateFormatObject>}
1760
+ */
1761
+ dateFormats: {
1762
+ 'YYYY/mm/dd': {
1763
+ regex: /^([0-9]{4})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{1,2})$/,
1764
+ parser: function (match) {
1765
+ return Date.UTC(+match[1], match[2] - 1, +match[3]);
1766
+ }
1767
+ },
1768
+ 'dd/mm/YYYY': {
1769
+ regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
1770
+ parser: function (match) {
1771
+ return Date.UTC(+match[3], match[2] - 1, +match[1]);
1772
+ },
1773
+ alternative: 'mm/dd/YYYY' // different format with the same regex
1774
+ },
1775
+ 'mm/dd/YYYY': {
1776
+ regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
1777
+ parser: function (match) {
1778
+ return Date.UTC(+match[3], match[1] - 1, +match[2]);
1779
+ }
1780
+ },
1781
+ 'dd/mm/YY': {
1782
+ regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
1783
+ parser: function (match) {
1784
+ var year = +match[3],
1785
+ d = new Date();
1786
+
1787
+ if (year > (d.getFullYear() - 2000)) {
1788
+ year += 1900;
1789
+ } else {
1790
+ year += 2000;
1791
+ }
1792
+
1793
+ return Date.UTC(year, match[2] - 1, +match[1]);
1794
+ },
1795
+ alternative: 'mm/dd/YY' // different format with the same regex
1796
+ },
1797
+ 'mm/dd/YY': {
1798
+ regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
1799
+ parser: function (match) {
1800
+ return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]);
1801
+ }
1802
+ }
1803
+ },
1804
+
1805
+ /**
1806
+ * Parse a date and return it as a number. Overridable through
1807
+ * `options.parseDate`.
1808
+ *
1809
+ * @function Highcharts.Data#parseDate
1810
+ *
1811
+ * @param {string} val
1812
+ *
1813
+ * @return {global.Date}
1814
+ */
1815
+ parseDate: function (val) {
1816
+ var parseDate = this.options.parseDate,
1817
+ ret,
1818
+ key,
1819
+ format,
1820
+ dateFormat = this.options.dateFormat || this.dateFormat,
1821
+ match;
1822
+
1823
+ if (parseDate) {
1824
+ ret = parseDate(val);
1825
+
1826
+ } else if (typeof val === 'string') {
1827
+ // Auto-detect the date format the first time
1828
+ if (!dateFormat) {
1829
+ for (key in this.dateFormats) {
1830
+ format = this.dateFormats[key];
1831
+ match = val.match(format.regex);
1832
+ if (match) {
1833
+ this.dateFormat = dateFormat = key;
1834
+ this.alternativeFormat = format.alternative;
1835
+ ret = format.parser(match);
1836
+ break;
1837
+ }
1838
+ }
1839
+ // Next time, use the one previously found
1840
+ } else {
1841
+ format = this.dateFormats[dateFormat];
1842
+
1843
+
1844
+ if (!format) {
1845
+ // The selected format is invalid
1846
+ format = this.dateFormats['YYYY/mm/dd'];
1847
+ }
1848
+
1849
+ match = val.match(format.regex);
1850
+ if (match) {
1851
+ ret = format.parser(match);
1852
+ }
1853
+
1854
+ }
1855
+ // Fall back to Date.parse
1856
+ if (!match) {
1857
+ match = Date.parse(val);
1858
+ // External tools like Date.js and MooTools extend Date object
1859
+ // and returns a date.
1860
+ if (
1861
+ typeof match === 'object' &&
1862
+ match !== null &&
1863
+ match.getTime
1864
+ ) {
1865
+ ret = match.getTime() - match.getTimezoneOffset() * 60000;
1866
+
1867
+ // Timestamp
1868
+ } else if (isNumber(match)) {
1869
+ ret = match - (new Date(match)).getTimezoneOffset() * 60000;
1870
+ }
1871
+ }
1872
+ }
1873
+ return ret;
1874
+ },
1875
+
1876
+ /**
1877
+ * Reorganize rows into columns.
1878
+ *
1879
+ * @function Highcharts.Data#rowsToColumns
1880
+ *
1881
+ * @param {Array<Array<*>>} rows
1882
+ *
1883
+ * @return {Array<Array<*>>}
1884
+ */
1885
+ rowsToColumns: function (rows) {
1886
+ var row,
1887
+ rowsLength,
1888
+ col,
1889
+ colsLength,
1890
+ columns;
1891
+
1892
+ if (rows) {
1893
+ columns = [];
1894
+ rowsLength = rows.length;
1895
+ for (row = 0; row < rowsLength; row++) {
1896
+ colsLength = rows[row].length;
1897
+ for (col = 0; col < colsLength; col++) {
1898
+ if (!columns[col]) {
1899
+ columns[col] = [];
1900
+ }
1901
+ columns[col][row] = rows[row][col];
1902
+ }
1903
+ }
1904
+ }
1905
+ return columns;
1906
+ },
1907
+
1908
+ /**
1909
+ * A hook for working directly on the parsed columns
1910
+ *
1911
+ * @function Highcharts.Data#parsed
1912
+ *
1913
+ * @return {*}
1914
+ */
1915
+ parsed: function () {
1916
+ if (this.options.parsed) {
1917
+ return this.options.parsed.call(this, this.columns);
1918
+ }
1919
+ },
1920
+
1921
+ /**
1922
+ * @private
1923
+ * @function Highcharts.Data#getFreeIndexes
1924
+ */
1925
+ getFreeIndexes: function (numberOfColumns, seriesBuilders) {
1926
+ var s,
1927
+ i,
1928
+ freeIndexes = [],
1929
+ freeIndexValues = [],
1930
+ referencedIndexes;
1931
+
1932
+ // Add all columns as free
1933
+ for (i = 0; i < numberOfColumns; i = i + 1) {
1934
+ freeIndexes.push(true);
1935
+ }
1936
+
1937
+ // Loop all defined builders and remove their referenced columns
1938
+ for (s = 0; s < seriesBuilders.length; s = s + 1) {
1939
+ referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes();
1940
+
1941
+ for (i = 0; i < referencedIndexes.length; i = i + 1) {
1942
+ freeIndexes[referencedIndexes[i]] = false;
1943
+ }
1944
+ }
1945
+
1946
+ // Collect the values for the free indexes
1947
+ for (i = 0; i < freeIndexes.length; i = i + 1) {
1948
+ if (freeIndexes[i]) {
1949
+ freeIndexValues.push(i);
1950
+ }
1951
+ }
1952
+
1953
+ return freeIndexValues;
1954
+ },
1955
+
1956
+ /**
1957
+ * If a complete callback function is provided in the options, interpret the
1958
+ * columns into a Highcharts options object.
1959
+ *
1960
+ * @function Highcharts.Data#complete
1961
+ */
1962
+ complete: function () {
1963
+
1964
+ var columns = this.columns,
1965
+ xColumns = [],
1966
+ type,
1967
+ options = this.options,
1968
+ series,
1969
+ data,
1970
+ i,
1971
+ j,
1972
+ r,
1973
+ seriesIndex,
1974
+ chartOptions,
1975
+ allSeriesBuilders = [],
1976
+ builder,
1977
+ freeIndexes,
1978
+ typeCol,
1979
+ index;
1980
+
1981
+ xColumns.length = columns.length;
1982
+ if (options.complete || options.afterComplete) {
1983
+
1984
+ // Get the names and shift the top row
1985
+ if (this.firstRowAsNames) {
1986
+ for (i = 0; i < columns.length; i++) {
1987
+ columns[i].name = columns[i].shift();
1988
+ }
1989
+ }
1990
+
1991
+ // Use the next columns for series
1992
+ series = [];
1993
+ freeIndexes = this.getFreeIndexes(
1994
+ columns.length,
1995
+ this.valueCount.seriesBuilders
1996
+ );
1997
+
1998
+ // Populate defined series
1999
+ for (
2000
+ seriesIndex = 0;
2001
+ seriesIndex < this.valueCount.seriesBuilders.length;
2002
+ seriesIndex++
2003
+ ) {
2004
+ builder = this.valueCount.seriesBuilders[seriesIndex];
2005
+
2006
+ // If the builder can be populated with remaining columns, then
2007
+ // add it to allBuilders
2008
+ if (builder.populateColumns(freeIndexes)) {
2009
+ allSeriesBuilders.push(builder);
2010
+ }
2011
+ }
2012
+
2013
+ // Populate dynamic series
2014
+ while (freeIndexes.length > 0) {
2015
+ builder = new SeriesBuilder();
2016
+ builder.addColumnReader(0, 'x');
2017
+
2018
+ // Mark index as used (not free)
2019
+ index = freeIndexes.indexOf(0);
2020
+ if (index !== -1) {
2021
+ freeIndexes.splice(index, 1);
2022
+ }
2023
+
2024
+ for (i = 0; i < this.valueCount.global; i++) {
2025
+ // Create and add a column reader for the next free column
2026
+ // index
2027
+ builder.addColumnReader(
2028
+ undefined,
2029
+ this.valueCount.globalPointArrayMap[i]
2030
+ );
2031
+ }
2032
+
2033
+ // If the builder can be populated with remaining columns, then
2034
+ // add it to allBuilders
2035
+ if (builder.populateColumns(freeIndexes)) {
2036
+ allSeriesBuilders.push(builder);
2037
+ }
2038
+ }
2039
+
2040
+ // Get the data-type from the first series x column
2041
+ if (
2042
+ allSeriesBuilders.length > 0 &&
2043
+ allSeriesBuilders[0].readers.length > 0
2044
+ ) {
2045
+ typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex];
2046
+ if (typeCol !== undefined) {
2047
+ if (typeCol.isDatetime) {
2048
+ type = 'datetime';
2049
+ } else if (!typeCol.isNumeric) {
2050
+ type = 'category';
2051
+ }
2052
+ }
2053
+ }
2054
+ // Axis type is category, then the "x" column should be called
2055
+ // "name"
2056
+ if (type === 'category') {
2057
+ for (
2058
+ seriesIndex = 0;
2059
+ seriesIndex < allSeriesBuilders.length;
2060
+ seriesIndex++
2061
+ ) {
2062
+ builder = allSeriesBuilders[seriesIndex];
2063
+ for (r = 0; r < builder.readers.length; r++) {
2064
+ if (builder.readers[r].configName === 'x') {
2065
+ builder.readers[r].configName = 'name';
2066
+ }
2067
+ }
2068
+ }
2069
+ }
2070
+
2071
+ // Read data for all builders
2072
+ for (
2073
+ seriesIndex = 0;
2074
+ seriesIndex < allSeriesBuilders.length;
2075
+ seriesIndex++
2076
+ ) {
2077
+ builder = allSeriesBuilders[seriesIndex];
2078
+
2079
+ // Iterate down the cells of each column and add data to the
2080
+ // series
2081
+ data = [];
2082
+ for (j = 0; j < columns[0].length; j++) {
2083
+ data[j] = builder.read(columns, j);
2084
+ }
2085
+
2086
+ // Add the series
2087
+ series[seriesIndex] = {
2088
+ data: data
2089
+ };
2090
+ if (builder.name) {
2091
+ series[seriesIndex].name = builder.name;
2092
+ }
2093
+ if (type === 'category') {
2094
+ series[seriesIndex].turboThreshold = 0;
2095
+ }
2096
+ }
2097
+
2098
+
2099
+ // Do the callback
2100
+ chartOptions = {
2101
+ series: series
2102
+ };
2103
+ if (type) {
2104
+ chartOptions.xAxis = {
2105
+ type: type
2106
+ };
2107
+ if (type === 'category') {
2108
+ chartOptions.xAxis.uniqueNames = false;
2109
+ }
2110
+ }
2111
+
2112
+ if (options.complete) {
2113
+ options.complete(chartOptions);
2114
+ }
2115
+
2116
+ // The afterComplete hook is used internally to avoid conflict with
2117
+ // the externally available complete option.
2118
+ if (options.afterComplete) {
2119
+ options.afterComplete(chartOptions);
2120
+ }
2121
+ }
2122
+
2123
+ },
2124
+
2125
+ /**
2126
+ * Updates the chart with new data options.
2127
+ *
2128
+ * @function Highcharts.Data#update
2129
+ *
2130
+ * @param {Highcharts.DataOptions} options
2131
+ *
2132
+ * @param {boolean} [redraw=true]
2133
+ */
2134
+ update: function (options, redraw) {
2135
+ var chart = this.chart;
2136
+
2137
+ if (options) {
2138
+ // Set the complete handler
2139
+ options.afterComplete = function (dataOptions) {
2140
+ // Avoid setting axis options unless the type changes. Running
2141
+ // Axis.update will cause the whole structure to be destroyed
2142
+ // and rebuilt, and animation is lost.
2143
+ if (
2144
+ dataOptions.xAxis &&
2145
+ chart.xAxis[0] &&
2146
+ dataOptions.xAxis.type === chart.xAxis[0].options.type
2147
+ ) {
2148
+ delete dataOptions.xAxis;
2149
+ }
2150
+
2151
+ chart.update(dataOptions, redraw, true);
2152
+ };
2153
+ // Apply it
2154
+ merge(true, this.options, options);
2155
+ this.init(this.options);
2156
+ }
2157
+ }
2158
+ });
2159
+
2160
+ // Register the Data prototype and data function on Highcharts
2161
+ Highcharts.Data = Data;
2162
+
2163
+ /**
2164
+ * Creates a data object to parse data for a chart.
2165
+ *
2166
+ * @function Highcharts.data
2167
+ *
2168
+ * @param {Highcharts.DataOptions} dataOptions
2169
+ *
2170
+ * @param {Highcharts.Options} [chartOptions]
2171
+ *
2172
+ * @param {Highcharts.Chart} [chart]
2173
+ *
2174
+ * @return {Highcharts.Data}
2175
+ */
2176
+ Highcharts.data = function (dataOptions, chartOptions, chart) {
2177
+ return new Data(dataOptions, chartOptions, chart);
2178
+ };
2179
+
2180
+ // Extend Chart.init so that the Chart constructor accepts a new configuration
2181
+ // option group, data.
2182
+ addEvent(
2183
+ Chart,
2184
+ 'init',
2185
+ function (e) {
2186
+ var chart = this,
2187
+ userOptions = e.args[0],
2188
+ callback = e.args[1];
2189
+
2190
+ if (userOptions && userOptions.data && !chart.hasDataDef) {
2191
+ chart.hasDataDef = true;
2192
+ /**
2193
+ * The data parser for this chart.
2194
+ *
2195
+ * @name Highcharts.Chart#data
2196
+ * @type {Highcharts.Data|undefined}
2197
+ */
2198
+ chart.data = new Data(Highcharts.extend(userOptions.data, {
2199
+
2200
+ afterComplete: function (dataOptions) {
2201
+ var i, series;
2202
+
2203
+ // Merge series configs
2204
+ if (userOptions.hasOwnProperty('series')) {
2205
+ if (typeof userOptions.series === 'object') {
2206
+ i = Math.max(
2207
+ userOptions.series.length,
2208
+ dataOptions && dataOptions.series ?
2209
+ dataOptions.series.length :
2210
+ 0
2211
+ );
2212
+ while (i--) {
2213
+ series = userOptions.series[i] || {};
2214
+ userOptions.series[i] = merge(
2215
+ series,
2216
+ dataOptions && dataOptions.series ?
2217
+ dataOptions.series[i] :
2218
+ {}
2219
+ );
2220
+ }
2221
+ } else { // Allow merging in dataOptions.series (#2856)
2222
+ delete userOptions.series;
2223
+ }
2224
+ }
2225
+
2226
+ // Do the merge
2227
+ userOptions = merge(dataOptions, userOptions);
2228
+
2229
+ // Run chart.init again
2230
+ chart.init(userOptions, callback);
2231
+ }
2232
+ }), userOptions, chart);
2233
+
2234
+ e.preventDefault();
2235
+ }
2236
+ }
2237
+ );
2238
+
2239
+ /**
2240
+ * Creates a new SeriesBuilder. A SeriesBuilder consists of a number
2241
+ * of ColumnReaders that reads columns and give them a name.
2242
+ * Ex: A series builder can be constructed to read column 3 as 'x' and
2243
+ * column 7 and 8 as 'y1' and 'y2'.
2244
+ * The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}
2245
+ *
2246
+ * The name of the builder is taken from the second column. In the above
2247
+ * example it would be the column with index 7.
2248
+ *
2249
+ * @private
2250
+ * @class
2251
+ * @name SeriesBuilder
2252
+ */
2253
+ SeriesBuilder = function () {
2254
+ this.readers = [];
2255
+ this.pointIsArray = true;
2256
+ };
2257
+
2258
+ /**
2259
+ * Populates readers with column indexes. A reader can be added without
2260
+ * a specific index and for those readers the index is taken sequentially
2261
+ * from the free columns (this is handled by the ColumnCursor instance).
2262
+ *
2263
+ * @function SeriesBuilder#populateColumns
2264
+ *
2265
+ * @param {Array<number>} freeIndexes
2266
+ *
2267
+ * @returns {boolean}
2268
+ */
2269
+ SeriesBuilder.prototype.populateColumns = function (freeIndexes) {
2270
+ var builder = this,
2271
+ enoughColumns = true;
2272
+
2273
+ // Loop each reader and give it an index if its missing.
2274
+ // The freeIndexes.shift() will return undefined if there
2275
+ // are no more columns.
2276
+ builder.readers.forEach(function (reader) {
2277
+ if (reader.columnIndex === undefined) {
2278
+ reader.columnIndex = freeIndexes.shift();
2279
+ }
2280
+ });
2281
+
2282
+ // Now, all readers should have columns mapped. If not
2283
+ // then return false to signal that this series should
2284
+ // not be added.
2285
+ builder.readers.forEach(function (reader) {
2286
+ if (reader.columnIndex === undefined) {
2287
+ enoughColumns = false;
2288
+ }
2289
+ });
2290
+
2291
+ return enoughColumns;
2292
+ };
2293
+
2294
+ /**
2295
+ * Reads a row from the dataset and returns a point or array depending
2296
+ * on the names of the readers.
2297
+ *
2298
+ * @function SeriesBuilder#read
2299
+ *
2300
+ * @param {Array<Array<*>>} columns
2301
+ *
2302
+ * @param {number} rowIndex
2303
+ *
2304
+ * @returns {Array<*>|*}
2305
+ */
2306
+ SeriesBuilder.prototype.read = function (columns, rowIndex) {
2307
+ var builder = this,
2308
+ pointIsArray = builder.pointIsArray,
2309
+ point = pointIsArray ? [] : {},
2310
+ columnIndexes;
2311
+
2312
+ // Loop each reader and ask it to read its value.
2313
+ // Then, build an array or point based on the readers names.
2314
+ builder.readers.forEach(function (reader) {
2315
+ var value = columns[reader.columnIndex][rowIndex];
2316
+
2317
+ if (pointIsArray) {
2318
+ point.push(value);
2319
+ } else {
2320
+ if (reader.configName.indexOf('.') > 0) {
2321
+ // Handle nested property names
2322
+ Highcharts.Point.prototype.setNestedProperty(
2323
+ point, value, reader.configName
2324
+ );
2325
+ } else {
2326
+ point[reader.configName] = value;
2327
+ }
2328
+ }
2329
+ });
2330
+
2331
+ // The name comes from the first column (excluding the x column)
2332
+ if (this.name === undefined && builder.readers.length >= 2) {
2333
+ columnIndexes = builder.getReferencedColumnIndexes();
2334
+ if (columnIndexes.length >= 2) {
2335
+ // remove the first one (x col)
2336
+ columnIndexes.shift();
2337
+
2338
+ // Sort the remaining
2339
+ columnIndexes.sort(function (a, b) {
2340
+ return a - b;
2341
+ });
2342
+
2343
+ // Now use the lowest index as name column
2344
+ this.name = columns[columnIndexes.shift()].name;
2345
+ }
2346
+ }
2347
+
2348
+ return point;
2349
+ };
2350
+
2351
+ /**
2352
+ * Creates and adds ColumnReader from the given columnIndex and configName.
2353
+ * ColumnIndex can be undefined and in that case the reader will be given
2354
+ * an index when columns are populated.
2355
+ *
2356
+ * @function SeriesBuilder#addColumnReader
2357
+ *
2358
+ * @param {number} columnIndex
2359
+ *
2360
+ * @param {string} configName
2361
+ */
2362
+ SeriesBuilder.prototype.addColumnReader = function (columnIndex, configName) {
2363
+ this.readers.push({
2364
+ columnIndex: columnIndex,
2365
+ configName: configName
2366
+ });
2367
+
2368
+ if (
2369
+ !(configName === 'x' || configName === 'y' || configName === undefined)
2370
+ ) {
2371
+ this.pointIsArray = false;
2372
+ }
2373
+ };
2374
+
2375
+ /**
2376
+ * Returns an array of column indexes that the builder will use when
2377
+ * reading data.
2378
+ *
2379
+ * @function SeriesBuilder#getReferencedColumnIndexes
2380
+ *
2381
+ * @returns {Array<number>}
2382
+ */
2383
+ SeriesBuilder.prototype.getReferencedColumnIndexes = function () {
2384
+ var i,
2385
+ referencedColumnIndexes = [],
2386
+ columnReader;
2387
+
2388
+ for (i = 0; i < this.readers.length; i = i + 1) {
2389
+ columnReader = this.readers[i];
2390
+ if (columnReader.columnIndex !== undefined) {
2391
+ referencedColumnIndexes.push(columnReader.columnIndex);
2392
+ }
2393
+ }
2394
+
2395
+ return referencedColumnIndexes;
2396
+ };
2397
+
2398
+ /**
2399
+ * Returns true if the builder has a reader for the given configName.
2400
+ *
2401
+ * @function SeriesBuider#hasReader
2402
+ *
2403
+ * @param {string} configName
2404
+ *
2405
+ * @returns {boolean}
2406
+ */
2407
+ SeriesBuilder.prototype.hasReader = function (configName) {
2408
+ var i, columnReader;
2409
+
2410
+ for (i = 0; i < this.readers.length; i = i + 1) {
2411
+ columnReader = this.readers[i];
2412
+ if (columnReader.configName === configName) {
2413
+ return true;
2414
+ }
2415
+ }
2416
+ // Else return undefined
2417
+ };