e8b73eaf6efd399e8c2725be240998763b5c5f60.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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="javascript:;" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  34. <textarea id="code" name="code">
  35. option = {
  36. tooltip : {
  37. trigger: 'axis'
  38. },
  39. toolbox: {
  40. show : true,
  41. feature : {
  42. mark : {show: true},
  43. dataView : {show: true, readOnly: false},
  44. restore : {show: true},
  45. saveAsImage : {show: true}
  46. }
  47. },
  48. dataRange: {
  49. min: 0,
  50. max: 100,
  51. orient: 'horizontal',
  52. y: 'top',
  53. //text:['高','低'], // 文本,默认为数值文本
  54. color:['lightgreen','yellow'],
  55. splitNumber: 5
  56. },
  57. xAxis : [
  58. {
  59. type : 'category',
  60. boundaryGap : false,
  61. data : function (){
  62. var list = [];
  63. for (var i = 1; i <= 30; i++) {
  64. list.push('2013-03-' + i);
  65. }
  66. return list;
  67. }()
  68. },
  69. {
  70. type : 'value',
  71. scale : true,
  72. splitNumber: 29,
  73. axisLabel: {show:false},
  74. splitLine: {show:false}
  75. }
  76. ],
  77. yAxis : [
  78. {
  79. type : 'value'
  80. },
  81. {
  82. type : 'value'
  83. }
  84. ],
  85. animation: false,
  86. series : [
  87. {
  88. name:'散点',
  89. type:'scatter',
  90. tooltip : {
  91. trigger: 'item',
  92. formatter : function (params) {
  93. return '2013-03-' + params.value[0] + '<br/>'
  94. + params.seriesName + ' : '
  95. + params.value[1] + ', '
  96. + params.value[2];
  97. }
  98. },
  99. yAxisIndex:1,
  100. xAxisIndex:1,
  101. symbol: 'circle',
  102. symbolSize: function (value){
  103. return Math.round(value[2]/10);
  104. },
  105. data: (function () {
  106. var d = [];
  107. var len = 200;
  108. var value;
  109. while (len--) {
  110. d.push([
  111. Math.round(Math.random()*29) + 1,
  112. (Math.random()*30).toFixed(2) - 0,
  113. (Math.random()*100).toFixed(2) - 0
  114. ]);
  115. }
  116. return d;
  117. })()
  118. },
  119. {
  120. name:'折线',
  121. type:'line',
  122. data:function (){
  123. var list = [];
  124. for (var i = 1; i <= 30; i++) {
  125. list.push(Math.round(Math.random()* 30));
  126. }
  127. return list;
  128. }()
  129. }
  130. ]
  131. };
  132. </textarea>
  133. </div><!--/.well -->
  134. </div><!--/span-->
  135. <div id="graphic" class="col-md-8">
  136. <div id="main" class="main"></div>
  137. <div>
  138. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  139. <span class="text-primary">切换主题</span>
  140. <select id="theme-select"></select>
  141. <span id='wrong-message' style="color:red"></span>
  142. </div>
  143. </div><!--/span-->
  144. </div><!--/row-->
  145. </div><!--/.fluid-container-->
  146. <footer id="footer"></footer>
  147. <!-- Le javascript
  148. ================================================== -->
  149. <!-- Placed at the end of the document so the pages load faster -->
  150. <script src="../asset/js/jquery.min.js"></script>
  151. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  152. <script src="../asset/js/bootstrap.min.js"></script>
  153. <script src="../asset/js/echartsExample.js"></script>
  154. </body>
  155. </html>