loading.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="ECharts">
  8. <meta name="author" content="kener.linfeng@gmail.com">
  9. <title>ECharts · Example</title>
  10. <link rel="shortcut icon" href="../asset/ico/favicon.png">
  11. <link href="../asset/css/font-awesome.min.css" rel="stylesheet">
  12. <link href="../asset/css/bootstrap.css" rel="stylesheet">
  13. <link href="../asset/css/carousel.css" rel="stylesheet">
  14. <link href="../asset/css/echartsHome.css" rel="stylesheet">
  15. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  16. <!--[if lt IE 9]>
  17. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  18. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  19. <![endif]-->
  20. <script src="./www/js/echarts.js"></script>
  21. <script src="../asset/js/codemirror.js"></script>
  22. <script src="../asset/js/javascript.js"></script>
  23. <link href="../asset/css/codemirror.css" rel="stylesheet">
  24. <link href="../asset/css/monokai.css" rel="stylesheet">
  25. </head>
  26. <body>
  27. <!-- Fixed navbar -->
  28. <div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
  29. <div class="container-fluid">
  30. <div class="row-fluid example">
  31. <div id="sidebar-code" class="col-md-4">
  32. <div class="well sidebar-nav">
  33. <div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  34. <textarea id="code" name="code">
  35. effectIndex = ++effectIndex % effect.length;
  36. myChart.showLoading({
  37. text : effect[effectIndex],
  38. effect : effect[effectIndex],
  39. textStyle : {
  40. fontSize : 20
  41. }
  42. });
  43. option = {
  44. tooltip : {
  45. trigger: 'axis'
  46. },
  47. toolbox: {
  48. show : true,
  49. feature : {
  50. mark : {show: true},
  51. dataView : {show: true, readOnly: false},
  52. magicType : {show: true, type: ['line', 'bar']},
  53. restore : {show: true},
  54. saveAsImage : {show: true}
  55. }
  56. },
  57. legend: {
  58. data:['蒸发量','降水量']
  59. },
  60. xAxis : [
  61. {
  62. type : 'category',
  63. data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
  64. }
  65. ],
  66. yAxis : [
  67. {
  68. type : 'value'
  69. }
  70. ],
  71. series : [
  72. {
  73. name:'蒸发量',
  74. type: effectIndex % 2 == 0 ? 'bar' : 'line',
  75. data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
  76. },
  77. {
  78. name:'降水量',
  79. type: effectIndex % 2 == 0 ? 'bar' : 'line',
  80. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  81. }
  82. ]
  83. };
  84. clearTimeout(loadingTicket);
  85. loadingTicket = setTimeout(function (){
  86. myChart.hideLoading();
  87. myChart.setOption(option);
  88. },2200);
  89. </textarea>
  90. </div><!--/.well -->
  91. </div><!--/span-->
  92. <div id="graphic" class="col-md-8">
  93. <div id="main" class="main"></div>
  94. <div>
  95. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">Loading</button>
  96. <span class="text-primary">切换主题</span>
  97. <select id="theme-select"></select>
  98. <span id='wrong-message' style="color:red"></span>
  99. </div>
  100. </div><!--/span-->
  101. </div><!--/row-->
  102. </div><!--/.fluid-container-->
  103. <footer id="footer"></footer>
  104. <!-- Le javascript
  105. ================================================== -->
  106. <!-- Placed at the end of the document so the pages load faster -->
  107. <script src="../asset/js/jquery.min.js"></script>
  108. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  109. <script src="../asset/js/bootstrap.min.js"></script>
  110. <script src="../asset/js/echartsExample.js"></script>
  111. <script type="text/javascript">
  112. var loadingTicket;
  113. var effectIndex = -1;
  114. var effect = ['spin' , 'bar' , 'ring' , 'whirling' , 'dynamicLine' , 'bubble'];
  115. function refresh(isBtnRefresh){
  116. //(new function (editor.doc.getValue()))();
  117. if (myChart && myChart.dispose) {
  118. myChart.dispose();
  119. }
  120. myChart = echarts.init(domMain, curTheme);
  121. (new Function (editor.doc.getValue()))();
  122. domMessage.innerHTML = '';
  123. }
  124. </script>
  125. </body>
  126. </html>