dataRange.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. <style type="text/css">
  26. .CodeMirror {
  27. height: 550px;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <!-- Fixed navbar -->
  33. <div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
  34. <div class="container-fluid">
  35. <div class="row-fluid example">
  36. <div id="sidebar-code" class="col-md-4">
  37. <div class="well sidebar-nav">
  38. <div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
  39. <textarea id="code" name="code">
  40. dataRangeStyle = [
  41. // 0
  42. {
  43. min: 0,
  44. max: 2000,
  45. formatter : function(v, v2){
  46. if (v2 < 1000) { return '低于' + v2}
  47. else if (v > 1000) { return '高于' + v}
  48. else { return '中' }
  49. }
  50. },
  51. // 1
  52. {
  53. orient: 'horizontal', // 'vertical'
  54. min: 0,
  55. max: 2000,
  56. formatter : '{value} 到 {value2}'
  57. },
  58. // 2
  59. {
  60. text:['高','低'], // 文本,默认为数值文本
  61. min: 0,
  62. max: 2000
  63. },
  64. // 3
  65. {
  66. orient: 'horizontal', // 'vertical'
  67. text:['高','低'], // 文本,默认为数值文本
  68. min: 0,
  69. max: 2000
  70. },
  71. // 4
  72. {
  73. splitNumber: 0,
  74. min: 0,
  75. max: 2000
  76. },
  77. // 5
  78. {
  79. orient: 'horizontal', // 'vertical'
  80. splitNumber: 0,
  81. min: 0,
  82. max: 2000
  83. },
  84. // 6
  85. {
  86. splitNumber: 0,
  87. text:['高','低'], // 文本,默认为数值文本
  88. min: 0,
  89. max: 2000
  90. },
  91. // 7
  92. {
  93. orient: 'horizontal', // 'vertical'
  94. splitNumber: 0,
  95. text:['高','低'], // 文本,默认为数值文本
  96. min: 0,
  97. max: 2000
  98. },
  99. // 8
  100. {
  101. calculable : true,
  102. min: 0,
  103. max: 2000,
  104. formatter : function(v) {
  105. if (v > 1500) {return v + ' (高)'}
  106. else if (v < 500) {return v + ' (低)'}
  107. else {return v + ' (中)'};
  108. }
  109. },
  110. // 9
  111. {
  112. orient: 'horizontal', // 'vertical'
  113. calculable : true,
  114. min: 0,
  115. max: 2000
  116. },
  117. // 10
  118. {
  119. color:['red','yellow'], //颜色
  120. text:['高','低'], // 文本,默认为数值文本
  121. calculable : true,
  122. min: 0,
  123. max: 2000
  124. },
  125. // 11
  126. {
  127. orient: 'horizontal', // 'vertical'
  128. color:['red','yellow'], //颜色
  129. text:['高','低'], // 文本,默认为数值文本
  130. calculable : true,
  131. min: 0,
  132. max: 2000
  133. }
  134. ]
  135. var cur = curIndex++%dataRangeStyle.length;
  136. option = {
  137. title:{
  138. text: '当前样式序号:' + cur,
  139. subtext: 'NO.' + cur
  140. },
  141. dataRange: dataRangeStyle[cur],
  142. series : [
  143. {
  144. name: '',
  145. type: 'map',
  146. data:[]
  147. }
  148. ]
  149. };
  150. </textarea>
  151. </div><!--/.well -->
  152. </div><!--/span-->
  153. <div id="graphic" class="col-md-8">
  154. <div id="main" class="main" style="height: 530px;"></div>
  155. <div>
  156. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  157. <span class="text-primary">切换主题</span>
  158. <select id="theme-select"></select>
  159. <span id='wrong-message' style="color:red"></span>
  160. </div>
  161. </div><!--/span-->
  162. </div><!--/row-->
  163. </div><!--/.fluid-container-->
  164. <footer id="footer"></footer>
  165. <!-- Le javascript
  166. ================================================== -->
  167. <!-- Placed at the end of the document so the pages load faster -->
  168. <script src="../asset/js/jquery.min.js"></script>
  169. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  170. <script src="../asset/js/bootstrap.min.js"></script>
  171. <script type="text/javascript">
  172. var curIndex = 0;
  173. </script>
  174. <script src="../asset/js/echartsExample.js"></script>
  175. <script>
  176. function focusGraphic() {
  177. domCode.className = 'col-md-4 ani';
  178. domGraphic.className = 'col-md-8 ani';
  179. refresh();
  180. }
  181. </script>
  182. </body>
  183. </html>