ordinary.html 3.5 KB

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