radar.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <script src="lib/esl.js"></script>
  5. <script src="lib/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/tooltip'
  21. ], function (echarts) {
  22. var chart = echarts.init(document.getElementById('main'));
  23. chart.setOption({
  24. aria: {
  25. show: true
  26. },
  27. tooltip: {},
  28. legend: {
  29. data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
  30. },
  31. radar: {
  32. name: {
  33. formatter:'【{value}】',
  34. color:'#72ACD1'
  35. },
  36. triggerEvent: true,
  37. // shape: 'circle',
  38. indicator: [
  39. { text: '销售(sales)', max: 6500},
  40. { text: '管理(Administration)', max: 16000},
  41. { text: '信息技术(Information Techology)', max: 30000},
  42. { text: '客服(Customer Support)', max: 38000},
  43. { text: '研发(Development)', max: 52000},
  44. { text: '市场(Marketing)', max: 25000}
  45. ]
  46. },
  47. series: [{
  48. name: '预算 vs 开销(Budget vs spending)',
  49. type: 'radar',
  50. label: {
  51. normal: {
  52. show: true
  53. }
  54. },
  55. // areaStyle: {normal: {}},
  56. data : [
  57. {
  58. value : [4300, 10000, 28000, 35000, 50000, 19000],
  59. name : '预算分配(Allocated Budget)'
  60. },
  61. {
  62. value : [5000, 14000, 28000, 31000, 42000, 21000],
  63. name : '实际开销(Actual Spending)'
  64. }
  65. ]
  66. }]
  67. });
  68. chart.on('click', function (params) {
  69. console.log(params)
  70. })
  71. });
  72. </script>
  73. </body>
  74. </html>