polarLine.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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/line',
  19. 'echarts/component/legend',
  20. 'echarts/component/polar',
  21. 'echarts/component/tooltip',
  22. 'echarts/component/markPoint',
  23. 'echarts/component/markLine'
  24. ], function (echarts) {
  25. var chart = echarts.init(document.getElementById('main'), null, {
  26. renderer: 'canvas'
  27. });
  28. var xAxisData = [];
  29. var data1 = [];
  30. var data2 = [];
  31. var data3 = [];
  32. for (var i = 0; i < 10; i++) {
  33. xAxisData.push('类目' + i);
  34. data1.push((Math.random() * 2 + 1).toFixed(3));
  35. data3.push((Math.random() + 0.5).toFixed(3));
  36. data2.push((Math.random() + 0.5).toFixed(3));
  37. }
  38. chart.setOption({
  39. legend: {
  40. data: ['line', 'line2', 'line3']
  41. },
  42. tooltip: {
  43. trigger: 'axis',
  44. axisPointer: {
  45. type: 'shadow'
  46. }
  47. },
  48. polar: {},
  49. angleAxis: {
  50. // data: ['类目1', '类目2', '类目3', '类目4', '类目5',]
  51. data: xAxisData
  52. },
  53. radiusAxis: {
  54. },
  55. series: [{
  56. coordinateSystem: 'polar',
  57. name: 'line',
  58. stack: 'all',
  59. type: 'line',
  60. symbolSize: 10,
  61. itemStyle: {
  62. normal: {
  63. areaStyle: {}
  64. }
  65. },
  66. markPoint: {
  67. data: [{
  68. type: 'max'
  69. }]
  70. },
  71. data: data1
  72. }, {
  73. coordinateSystem: 'polar',
  74. name: 'line2',
  75. stack: 'all',
  76. type: 'line',
  77. symbolSize: 10,
  78. itemStyle: {
  79. normal: {
  80. areaStyle: {}
  81. }
  82. },
  83. markLine: {
  84. data: [[{
  85. type: 'max'
  86. }, {
  87. type: 'min'
  88. }]]
  89. },
  90. data: data2
  91. }, {
  92. coordinateSystem: 'polar',
  93. name: 'line3',
  94. stack: 'all',
  95. type: 'line',
  96. symbolSize: 10,
  97. itemStyle: {
  98. normal: {
  99. areaStyle: {}
  100. }
  101. },
  102. data: data3
  103. }]
  104. });
  105. })
  106. </script>
  107. </body>
  108. </html>