825283abc39c1c2080231567130c8d8a.php 3.5 KB

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