ordinary.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. <title>kline-demo</title>
  7. <link rel="stylesheet" href="/Public/Static/css/kline.css">
  8. <style>
  9. #chart_container {
  10. margin: 0 auto;
  11. width: 100%;
  12. height: 544px;
  13. position: relative;
  14. }
  15. #interval_tool_bar.dark .interval-item{
  16. background-color: #E4E4E4 ;
  17. color:black;
  18. border: none;
  19. }
  20. #interval_tool_bar.dark .interval-item.active, #interval_tool_bar.dark .interval-item:hover{
  21. background: #FADB84 ;
  22. }
  23. .changInterval {
  24. margin-bottom: 10px;
  25. }
  26. .interval-item{
  27. margin-right: 10px;
  28. padding: 4px 10px;
  29. outline: none;
  30. transition: all .25s;
  31. border: 1px solid #f5f5f5;
  32. cursor: pointer;
  33. vertical-align: top;
  34. background-color: #fff;
  35. border-radius: 5px;
  36. }
  37. .active{
  38. background-color: #f5f5f5;
  39. border:1px solid #FCD535;
  40. border-radius: 5px;
  41. }
  42. .loding{
  43. position: absolute;
  44. width: 100%;
  45. height: 100%;
  46. z-index: 999;
  47. /*display: flex;*/
  48. align-items: center;
  49. justify-content: center;
  50. display: none;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <div class="changInterval">
  56. <span class="interval-item" style="border:none:font-size:14px;">{:L("时间")}</span>
  57. <button type="button" class="interval-item active" onclick="changInterval('m1',this)">1 M</button>
  58. <button type="button" class="interval-item" onclick="changInterval('m5',this)">5 M</button>
  59. <button type="button" class="interval-item" onclick="changInterval('m15',this)">15 M</button>
  60. <button type="button" class="interval-item" onclick="changInterval('m30',this)">30 M</button>
  61. <button type="button" class="interval-item" onclick="changInterval('m60',this)">60 M</button>
  62. <button type="button" class="interval-item" onclick="changInterval('h4',this)">4 H</button>
  63. <button type="button" class="interval-item" onclick="changInterval('d1',this)">1 Day</button>
  64. <!-- <button type="button" class="interval-item" onclick="changInterval('w1',this)">1 Week</button>-->
  65. </div>
  66. <div id="chart_container">
  67. <div class="loding" data-type="0">
  68. <img src="/Public/Static/img/loading.gif" alt="" />
  69. </div>
  70. </div>
  71. <div id="chart_container1" style="display:none"></div>
  72. </body>
  73. <script>
  74. window.SYMBOL = "{$market}"
  75. window.fenshi = "Time sharing"
  76. window.fen = "M"
  77. window.xiaoshi = "H"
  78. window.tian = "Day"
  79. window.zhou = "Week"
  80. window.kai = " S"
  81. window.gao = " High"
  82. window.di = " Low"
  83. window.shou = " Collect"
  84. window.labels=["Time:"," S:"," Collect:"," High:"," Low:","Finished:"]
  85. window.plots=[{
  86. key: "ma5",
  87. title: "MA5: ",
  88. type: "line"
  89. }, {
  90. key: "ma10",
  91. title: "MA10: ",
  92. type: "line"
  93. }, {
  94. key: "ma30",
  95. title: "MA30: ",
  96. type: "line"
  97. }, {
  98. key: "ma60",
  99. title: "MA60: ",
  100. type: "line"
  101. }]
  102. window.title="MA20: "
  103. window.title1="VOLUME: "
  104. // console.log("btcusdt")
  105. </script>
  106. <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
  107. <script type="text/javascript" src="/Public/Static/js/kline.min.js"></script>
  108. <script type="text/javascript" src="/Public/Static/js/pako.min.js"></script>
  109. <script type="text/javascript" src="/Public/Static/js/klinecharts.min.js"></script>
  110. <script type="text/javascript" src="/Public/Static/js/ws-deedfeeds.js"></script>
  111. <script>
  112. function initOnReady() {
  113. loading()
  114. window.init_offset = 10
  115. VyKline.bootstrap({
  116. container: document.getElementById('chart_container1'), // 容器
  117. deedfeeds: window.deedfeeds, // 数据反馈对象
  118. showIntervalToolbar: true,
  119. defaultInterval: 'm1',
  120. interval: [ 'm1','m5','m15','m30','m60','h4','d1', 'w1'],
  121. theme: 'light',
  122. customChart: {
  123. init_offset_x: window.init_offset,
  124. default_rise_color: '#49C043',
  125. default_fall_color: '#CC1414',
  126. },
  127. // customLoadingEl: customLoading,
  128. onTimeIntervalChanged: interval => {
  129. console.log("window.deedfeeds", interval);
  130. }
  131. })
  132. // window.deedfeeds.intervalChanged('m5')
  133. vyChart.switchChartType('KLINE')
  134. console.info(window.deedfeeds)
  135. }
  136. window.addEventListener('DOMContentLoaded', initOnReady, false);
  137. </script>
  138. </html>