scatter.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. option = {
  36. tooltip : {
  37. trigger: 'axis',
  38. axisPointer:{
  39. show: true,
  40. type : 'cross',
  41. lineStyle: {
  42. type : 'dashed',
  43. width : 1
  44. }
  45. }
  46. },
  47. legend: {
  48. data:['scatter1','scatter2']
  49. },
  50. toolbox: {
  51. show : true,
  52. feature : {
  53. mark : {show: true},
  54. dataView : {show: true, readOnly: false},
  55. restore : {show: true},
  56. saveAsImage : {show: true}
  57. }
  58. },
  59. calculable : true,
  60. xAxis : [
  61. {
  62. type : 'value'
  63. }
  64. ],
  65. yAxis : [
  66. {
  67. type : 'value'
  68. }
  69. ],
  70. series : [
  71. {
  72. name:'scatter1',
  73. type:'scatter',
  74. symbol: 'emptyCircle', //'circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond'
  75. symbolSize: function (value){
  76. if (value[0] < 2) {
  77. return 2;
  78. }
  79. else if (value[0] < 8) {
  80. return Math.round(value[2] * 3);
  81. }
  82. else {
  83. return 20;
  84. }
  85. },
  86. itemStyle: {
  87. normal: {
  88. color: 'lightblue',
  89. borderWidth: 4,
  90. label : {show: true}
  91. },
  92. emphasis: {
  93. color: 'lightgreen',
  94. }
  95. },
  96. data: (function () {
  97. var d = [];
  98. var len = 20;
  99. while (len--) {
  100. d.push([
  101. (Math.random()*10).toFixed(2) - 0,
  102. (Math.random()*10).toFixed(2) - 0,
  103. (Math.random()*10).toFixed(2) - 0
  104. ]);
  105. }
  106. return d;
  107. })(),
  108. markPoint : {
  109. data : [
  110. {type : 'max', name: 'y最大值'},
  111. {type : 'min', name: 'y最小值'},
  112. {type : 'max', name: 'x最大值', valueIndex : 0, symbol:'arrow',itemStyle:{normal:{borderColor:'red'}}},
  113. {type : 'min', name: 'x最小值', valueIndex : 0, symbol:'arrow',itemStyle:{normal:{borderColor:'red'}}}
  114. ]
  115. },
  116. markLine : {
  117. data : [
  118. {type : 'average', name: 'y平均值'},
  119. {type : 'average', name: 'x平均值', valueIndex : 0, itemStyle:{normal:{borderColor:'red'}}}
  120. ]
  121. }
  122. },
  123. {
  124. name:'scatter2',
  125. type:'scatter',
  126. symbol: 'image://../asset/ico/favicon.png', // 系列级个性化拐点图形
  127. symbolSize: function (value){
  128. return Math.round(value[2] * 3);
  129. },
  130. itemStyle: {
  131. emphasis : {
  132. label : {show: true}
  133. }
  134. },
  135. data: (function () {
  136. var d = [];
  137. var len = 20;
  138. while (len--) {
  139. d.push([
  140. (Math.random()*10).toFixed(2) - 0,
  141. (Math.random()*10).toFixed(2) - 0,
  142. (Math.random()*10).toFixed(2) - 0
  143. ]);
  144. }
  145. d.push({
  146. value : [5,5,1000],
  147. itemStyle: {
  148. normal: {
  149. borderWidth: 8,
  150. color: 'orange'
  151. },
  152. emphasis: {
  153. borderWidth: 10,
  154. color: '#ff4500'
  155. }
  156. },
  157. symbol: 'emptyTriangle',
  158. symbolRotate:90,
  159. symbolSize:30
  160. })
  161. return d;
  162. })(),
  163. markPoint : {
  164. symbol: 'emptyCircle',
  165. itemStyle:{
  166. normal:{label:{position:'top'}}
  167. },
  168. data : [
  169. {name : '有个东西', value : 1000, xAxis: 5, yAxis: 5, symbolSize:80}
  170. ]
  171. }
  172. }
  173. ]
  174. };
  175. </textarea>
  176. </div><!--/.well -->
  177. </div><!--/span-->
  178. <div id="graphic" class="col-md-8">
  179. <div id="main" class="main"></div>
  180. <div>
  181. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  182. <span class="text-primary">切换主题</span>
  183. <select id="theme-select"></select>
  184. <span id='wrong-message' style="color:red"></span>
  185. </div>
  186. </div><!--/span-->
  187. </div><!--/row-->
  188. </div><!--/.fluid-container-->
  189. <footer id="footer"></footer>
  190. <!-- Le javascript
  191. ================================================== -->
  192. <!-- Placed at the end of the document so the pages load faster -->
  193. <script src="../asset/js/jquery.min.js"></script>
  194. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  195. <script src="../asset/js/bootstrap.min.js"></script>
  196. <script src="../asset/js/echartsExample.js"></script>
  197. </body>
  198. </html>