basic.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <title>CandleStick Chart</title>
  8. <link href="../../assets/styles.css" rel="stylesheet" />
  9. <style>
  10. #chart {
  11. max-width: 650px;
  12. margin: 35px auto;
  13. }
  14. </style>
  15. <script>
  16. window.Promise ||
  17. document.write(
  18. '<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
  19. )
  20. window.Promise ||
  21. document.write(
  22. '<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
  23. )
  24. window.Promise ||
  25. document.write(
  26. '<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
  27. )
  28. </script>
  29. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  30. <script src="../../assets/ohlc.js"></script>
  31. </head>
  32. <body>
  33. <div id="chart"></div>
  34. <script>
  35. var options = {
  36. series: [{
  37. data: [{
  38. x: new Date(1538778600000),
  39. y: [6629.81, 6650.5, 6623.04, 6633.33]
  40. },
  41. {
  42. x: new Date(1538780400000),
  43. y: [6632.01, 6643.59, 6620, 6630.11]
  44. },
  45. {
  46. x: new Date(1538782200000),
  47. y: [6630.71, 6648.95, 6623.34, 6635.65]
  48. },
  49. {
  50. x: new Date(1538784000000),
  51. y: [6635.65, 6651, 6629.67, 6638.24]
  52. },
  53. {
  54. x: new Date(1538785800000),
  55. y: [6638.24, 6640, 6620, 6624.47]
  56. },
  57. {
  58. x: new Date(1538787600000),
  59. y: [6624.53, 6636.03, 6621.68, 6624.31]
  60. },
  61. {
  62. x: new Date(1538789400000),
  63. y: [6624.61, 6632.2, 6617, 6626.02]
  64. },
  65. {
  66. x: new Date(1538791200000),
  67. y: [6627, 6627.62, 6584.22, 6603.02]
  68. },
  69. {
  70. x: new Date(1538793000000),
  71. y: [6605, 6608.03, 6598.95, 6604.01]
  72. },
  73. {
  74. x: new Date(1538794800000),
  75. y: [6604.5, 6614.4, 6602.26, 6608.02]
  76. },
  77. {
  78. x: new Date(1538796600000),
  79. y: [6608.02, 6610.68, 6601.99, 6608.91]
  80. },
  81. {
  82. x: new Date(1538798400000),
  83. y: [6608.91, 6618.99, 6608.01, 6612]
  84. },
  85. {
  86. x: new Date(1538800200000),
  87. y: [6612, 6615.13, 6605.09, 6612]
  88. },
  89. {
  90. x: new Date(1538802000000),
  91. y: [6612, 6624.12, 6608.43, 6622.95]
  92. },
  93. {
  94. x: new Date(1538803800000),
  95. y: [6623.91, 6623.91, 6615, 6615.67]
  96. },
  97. {
  98. x: new Date(1538805600000),
  99. y: [6618.69, 6618.74, 6610, 6610.4]
  100. },
  101. {
  102. x: new Date(1538807400000),
  103. y: [6611, 6622.78, 6610.4, 6614.9]
  104. },
  105. {
  106. x: new Date(1538809200000),
  107. y: [6614.9, 6626.2, 6613.33, 6623.45]
  108. },
  109. {
  110. x: new Date(1538811000000),
  111. y: [6623.48, 6627, 6618.38, 6620.35]
  112. },
  113. {
  114. x: new Date(1538812800000),
  115. y: [6619.43, 6620.35, 6610.05, 6615.53]
  116. },
  117. {
  118. x: new Date(1538814600000),
  119. y: [6615.53, 6617.93, 6610, 6615.19]
  120. },
  121. {
  122. x: new Date(1538816400000),
  123. y: [6615.19, 6621.6, 6608.2, 6620]
  124. },
  125. {
  126. x: new Date(1538818200000),
  127. y: [6619.54, 6625.17, 6614.15, 6620]
  128. },
  129. {
  130. x: new Date(1538820000000),
  131. y: [6620.33, 6634.15, 6617.24, 6624.61]
  132. },
  133. {
  134. x: new Date(1538821800000),
  135. y: [6625.95, 6626, 6611.66, 6617.58]
  136. },
  137. {
  138. x: new Date(1538823600000),
  139. y: [6619, 6625.97, 6595.27, 6598.86]
  140. },
  141. {
  142. x: new Date(1538825400000),
  143. y: [6598.86, 6598.88, 6570, 6587.16]
  144. },
  145. {
  146. x: new Date(1538827200000),
  147. y: [6588.86, 6600, 6580, 6593.4]
  148. },
  149. {
  150. x: new Date(1538829000000),
  151. y: [6593.99, 6598.89, 6585, 6587.81]
  152. },
  153. {
  154. x: new Date(1538830800000),
  155. y: [6587.81, 6592.73, 6567.14, 6578]
  156. },
  157. {
  158. x: new Date(1538832600000),
  159. y: [6578.35, 6581.72, 6567.39, 6579]
  160. },
  161. {
  162. x: new Date(1538834400000),
  163. y: [6579.38, 6580.92, 6566.77, 6575.96]
  164. },
  165. {
  166. x: new Date(1538836200000),
  167. y: [6575.96, 6589, 6571.77, 6588.92]
  168. },
  169. {
  170. x: new Date(1538838000000),
  171. y: [6588.92, 6594, 6577.55, 6589.22]
  172. },
  173. {
  174. x: new Date(1538839800000),
  175. y: [6589.3, 6598.89, 6589.1, 6596.08]
  176. },
  177. {
  178. x: new Date(1538841600000),
  179. y: [6597.5, 6600, 6588.39, 6596.25]
  180. },
  181. {
  182. x: new Date(1538843400000),
  183. y: [6598.03, 6600, 6588.73, 6595.97]
  184. },
  185. {
  186. x: new Date(1538845200000),
  187. y: [6595.97, 6602.01, 6588.17, 6602]
  188. },
  189. {
  190. x: new Date(1538847000000),
  191. y: [6602, 6607, 6596.51, 6599.95]
  192. },
  193. {
  194. x: new Date(1538848800000),
  195. y: [6600.63, 6601.21, 6590.39, 6591.02]
  196. },
  197. {
  198. x: new Date(1538850600000),
  199. y: [6591.02, 6603.08, 6591, 6591]
  200. },
  201. {
  202. x: new Date(1538852400000),
  203. y: [6591, 6601.32, 6585, 6592]
  204. },
  205. {
  206. x: new Date(1538854200000),
  207. y: [6593.13, 6596.01, 6590, 6593.34]
  208. },
  209. {
  210. x: new Date(1538856000000),
  211. y: [6593.34, 6604.76, 6582.63, 6593.86]
  212. },
  213. {
  214. x: new Date(1538857800000),
  215. y: [6593.86, 6604.28, 6586.57, 6600.01]
  216. },
  217. {
  218. x: new Date(1538859600000),
  219. y: [6601.81, 6603.21, 6592.78, 6596.25]
  220. },
  221. {
  222. x: new Date(1538861400000),
  223. y: [6596.25, 6604.2, 6590, 6602.99]
  224. },
  225. {
  226. x: new Date(1538863200000),
  227. y: [6602.99, 6606, 6584.99, 6587.81]
  228. },
  229. {
  230. x: new Date(1538865000000),
  231. y: [6587.81, 6595, 6583.27, 6591.96]
  232. },
  233. {
  234. x: new Date(1538866800000),
  235. y: [6591.97, 6596.07, 6585, 6588.39]
  236. },
  237. {
  238. x: new Date(1538868600000),
  239. y: [6587.6, 6598.21, 6587.6, 6594.27]
  240. },
  241. {
  242. x: new Date(1538870400000),
  243. y: [6596.44, 6601, 6590, 6596.55]
  244. },
  245. {
  246. x: new Date(1538872200000),
  247. y: [6598.91, 6605, 6596.61, 6600.02]
  248. },
  249. {
  250. x: new Date(1538874000000),
  251. y: [6600.55, 6605, 6589.14, 6593.01]
  252. },
  253. {
  254. x: new Date(1538875800000),
  255. y: [6593.15, 6605, 6592, 6603.06]
  256. },
  257. {
  258. x: new Date(1538877600000),
  259. y: [6603.07, 6604.5, 6599.09, 6603.89]
  260. },
  261. {
  262. x: new Date(1538879400000),
  263. y: [6604.44, 6604.44, 6600, 6603.5]
  264. },
  265. {
  266. x: new Date(1538881200000),
  267. y: [6603.5, 6603.99, 6597.5, 6603.86]
  268. },
  269. {
  270. x: new Date(1538883000000),
  271. y: [6603.85, 6605, 6600, 6604.07]
  272. },
  273. {
  274. x: new Date(1538884800000),
  275. y: [6604.98, 6606, 6604.07, 6606]
  276. },
  277. ]
  278. }],
  279. chart: {
  280. type: 'candlestick',
  281. height: 350
  282. },
  283. title: {
  284. text: 'CandleStick Chart',
  285. align: 'left'
  286. },
  287. xaxis: {
  288. type: 'datetime'
  289. },
  290. yaxis: {
  291. tooltip: {
  292. enabled: true
  293. }
  294. }
  295. };
  296. var chart = new ApexCharts(document.querySelector("#chart"), options);
  297. chart.render();
  298. </script>
  299. </body>
  300. </html>