radar4.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <script src="esl.js"></script>
  5. <script src="config.js"></script>
  6. </head>
  7. <body>
  8. <style>
  9. html, body, #main {
  10. width: 100%;
  11. height: 100%;
  12. }
  13. </style>
  14. <div id="main"></div>
  15. <script>
  16. require([
  17. 'echarts',
  18. 'echarts/chart/radar',
  19. 'echarts/component/legend',
  20. 'echarts/component/grid',
  21. 'echarts/component/tooltip'
  22. ], function (echarts) {
  23. var chart = echarts.init(document.getElementById('main'));
  24. chart.setOption({
  25. tooltip : {
  26. trigger: 'item'
  27. },
  28. legend: {
  29. x : 'left',
  30. data:['图一','图二','图三']
  31. },
  32. polar : [
  33. {
  34. indicator : [
  35. { text : '指标一' },
  36. { text : '指标二' },
  37. { text : '指标三' },
  38. { text : '指标四' },
  39. { text : '指标五' }
  40. ],
  41. center : ['25%',210],
  42. radius : 150,
  43. startAngle: 90,
  44. splitNumber: 8,
  45. name : {
  46. formatter:'【{value}】',
  47. textStyle: {color:'red'}
  48. },
  49. scale: true
  50. },
  51. {
  52. indicator : [
  53. { text : '语文', max : 150, nameTextStyle: {
  54. color:'#000000',fontSize:5
  55. }},
  56. { text : '数学', max : 150, axisLine: {
  57. lineStyle: {
  58. color: 'red'
  59. }
  60. } },
  61. { text : '英语', max : 150, axisLine: {
  62. lineStyle: {
  63. color: 'red'
  64. }
  65. } },
  66. { text : '物理', max : 120, axisLine: {
  67. lineStyle: {
  68. color: 'red'
  69. }
  70. } },
  71. { text : '化学', max : 108, axisLine: {
  72. lineStyle: {
  73. color: 'red'
  74. }
  75. } },
  76. { text : '生物', max : 72, axisLine: {
  77. lineStyle: {
  78. color: 'red'
  79. }
  80. } }
  81. ],
  82. center : ['75%', 210],
  83. radius : 150
  84. }
  85. ],
  86. series : [
  87. {
  88. name: '雷达图',
  89. type: 'radar',
  90. itemStyle: {
  91. emphasis: {
  92. // color: 各异,
  93. lineStyle: {
  94. width: 4
  95. }
  96. }
  97. },
  98. data : [
  99. {
  100. value : [100, 8, 0.40, -80, 2000],
  101. name : '图一',
  102. symbol: 'star5',
  103. symbolSize: 4,
  104. itemStyle: {
  105. normal: {
  106. lineStyle: {
  107. type: 'dashed'
  108. }
  109. }
  110. }
  111. },
  112. {
  113. value : [10, 3, 0.20, -100, 1000],
  114. name : '图二',
  115. itemStyle: {
  116. normal: {
  117. areaStyle: {
  118. type: 'default'
  119. }
  120. }
  121. }
  122. },
  123. {
  124. value : [20, 3, 0.3, -13.5, 3000],
  125. name : '图三',
  126. symbol: 'none', // 拐点图形类型,非标准参数
  127. itemStyle: {
  128. normal: {
  129. lineStyle: {
  130. type: 'dotted'
  131. }
  132. }
  133. }
  134. }
  135. ]
  136. },
  137. {
  138. name: '成绩单',
  139. type: 'radar',
  140. polarIndex : 1,
  141. itemStyle: {
  142. normal: {
  143. areaStyle: {
  144. type: 'default'
  145. }
  146. }
  147. },
  148. data: [
  149. {
  150. value: [120, 118, 130, 100, 99, 70],
  151. name: '张三',
  152. itemStyle: {
  153. normal: {
  154. label: {
  155. show: true,
  156. formatter:function(params) {
  157. return params.value;
  158. }
  159. }
  160. }
  161. }
  162. },
  163. {
  164. value : [90, 113, 140, 30, 70, 60],
  165. name : '李四',
  166. itemStyle: {
  167. normal: {
  168. lineStyle: {
  169. type: 'dashed'
  170. }
  171. }
  172. }
  173. }
  174. ]
  175. }
  176. ]
  177. });
  178. });
  179. </script>
  180. </body>
  181. </html>