radar.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. },
  39. legend: {
  40. x : 'left',
  41. data:['图一','图二','图三']
  42. },
  43. toolbox: {
  44. show : true,
  45. feature : {
  46. mark : {show: true},
  47. dataView : {show: true, readOnly: false},
  48. restore : {show: true},
  49. saveAsImage : {show: true}
  50. }
  51. },
  52. calculable: true,
  53. polar : [
  54. {
  55. indicator : [
  56. { text : '指标一' },
  57. { text : '指标二' },
  58. { text : '指标三' },
  59. { text : '指标四' },
  60. { text : '指标五' }
  61. ],
  62. center : ['25%',210],
  63. radius : 150,
  64. startAngle: 90,
  65. splitNumber: 8,
  66. name : {
  67. formatter:'【{value}】',
  68. textStyle: {color:'red'}
  69. },
  70. scale: true,
  71. type: 'circle',
  72. axisLine: { // 坐标轴线
  73. show: true, // 默认显示,属性show控制显示与否
  74. lineStyle: { // 属性lineStyle控制线条样式
  75. color: 'green',
  76. width: 2,
  77. type: 'solid'
  78. }
  79. },
  80. axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
  81. show: true,
  82. // formatter: null,
  83. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  84. color: '#ccc'
  85. }
  86. },
  87. splitArea : {
  88. show : true,
  89. areaStyle : {
  90. color: ['rgba(250,0,250,0.3)','rgba(0,200,200,0.3)']
  91. }
  92. },
  93. splitLine : {
  94. show : true,
  95. lineStyle : {
  96. width : 2,
  97. color : 'yellow'
  98. }
  99. }
  100. },
  101. {
  102. indicator : [
  103. { text : '语文', max : 150 },
  104. { text : '数学', max : 150 },
  105. { text : '英语', max : 150 },
  106. { text : '物理', max : 120 },
  107. { text : '化学', max : 108 },
  108. { text : '生物', max : 72 }
  109. ],
  110. center : ['75%', 210],
  111. radius : 150
  112. }
  113. ],
  114. series : [
  115. {
  116. name: '雷达图',
  117. type: 'radar',
  118. itemStyle: {
  119. emphasis: {
  120. // color: 各异,
  121. lineStyle: {
  122. width: 4
  123. }
  124. }
  125. },
  126. data : [
  127. {
  128. value : [100, 8, 0.40, -80, 2000],
  129. name : '图一',
  130. symbol: 'star5',
  131. symbolSize: 4, // 可计算特性参数,空数据拖拽提示图形大小
  132. itemStyle: {
  133. normal: {
  134. lineStyle: {
  135. type: 'dashed'
  136. }
  137. }
  138. }
  139. },
  140. {
  141. value : [10, 3, 0.20, -100, 1000],
  142. name : '图二',
  143. itemStyle: {
  144. normal: {
  145. areaStyle: {
  146. type: 'default'
  147. }
  148. }
  149. }
  150. },
  151. {
  152. value : [20, 3, 0.3, -13.5, 3000],
  153. name : '图三',
  154. symbol: 'none', // 拐点图形类型,非标准参数
  155. itemStyle: {
  156. normal: {
  157. lineStyle: {
  158. type: 'dotted'
  159. }
  160. }
  161. }
  162. }
  163. ]
  164. },
  165. {
  166. name: '成绩单',
  167. type: 'radar',
  168. polarIndex : 1,
  169. itemStyle: {
  170. normal: {
  171. areaStyle: {
  172. type: 'default'
  173. }
  174. }
  175. },
  176. data : [
  177. {
  178. value : [120, 118, 130, 100, 99, 70],
  179. name : '张三',
  180. itemStyle: {
  181. normal: {
  182. color: function(params) {
  183. var value = params.data
  184. return isNaN(value)
  185. ? undefined
  186. : (value >= 120 ? 'green' : 'red')
  187. },
  188. label: {
  189. show: true,
  190. formatter:function(params) {
  191. return params.value;
  192. }
  193. },
  194. areaStyle: {
  195. color: (function (){
  196. var zrColor = require('zrender/tool/color');
  197. var x = document.getElementById('main').offsetWidth - 250;
  198. return zrColor.getRadialGradient(
  199. x, 210, 0, x, 200, 150,
  200. [[0, 'rgba(255,255,0,0.3)'],[1, 'rgba(255,0,0,0.5)']]
  201. )
  202. })()
  203. }
  204. }
  205. }
  206. },
  207. {
  208. value : [90, 113, 140, 30, 70, 60],
  209. name : '李四',
  210. itemStyle: {
  211. normal: {
  212. lineStyle: {
  213. type: 'dashed'
  214. }
  215. }
  216. }
  217. }
  218. ],
  219. markPoint : {
  220. symbol: 'emptyHeart',
  221. data : [
  222. {name : '打酱油的标注', value : 100, x:'50%', y:'15%', symbolSize:32}
  223. ]
  224. }
  225. }
  226. ]
  227. };
  228. </textarea>
  229. </div><!--/.well -->
  230. </div><!--/span-->
  231. <div id="graphic" class="col-md-8">
  232. <div id="main" class="main"></div>
  233. <div>
  234. <button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
  235. <span class="text-primary">切换主题</span>
  236. <select id="theme-select"></select>
  237. <span id='wrong-message' style="color:red"></span>
  238. </div>
  239. </div><!--/span-->
  240. </div><!--/row-->
  241. </div><!--/.fluid-container-->
  242. <footer id="footer"></footer>
  243. <!-- Le javascript
  244. ================================================== -->
  245. <!-- Placed at the end of the document so the pages load faster -->
  246. <script src="../asset/js/jquery.min.js"></script>
  247. <script type="text/javascript" src="../asset/js/echartsHome.js"></script>
  248. <script src="../asset/js/bootstrap.min.js"></script>
  249. <script src="../asset/js/echartsExample.js"></script>
  250. </body>
  251. </html>