bar-polar-stack.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <script src="lib/esl.js"></script>
  5. <script src="lib/config.js"></script>
  6. <meta name="viewport" content="width=device-width, initial-scale=1" />
  7. </head>
  8. <body>
  9. <style>
  10. html, body, #main {
  11. width: 100%;
  12. height: 100%;
  13. margin: 0;
  14. }
  15. #main {
  16. background: #fff;
  17. }
  18. </style>
  19. <div id="main"></div>
  20. <script>
  21. require([
  22. 'echarts'
  23. // 'echarts/chart/bar',
  24. // 'echarts/component/legend',
  25. // 'echarts/component/polar',
  26. // 'zrender/vml/vml'
  27. ], function (echarts) {
  28. var chart = echarts.init(document.getElementById('main'));
  29. chart.setOption({
  30. angleAxis: {
  31. },
  32. radiusAxis: {
  33. type: 'category',
  34. data: ['周一', '周二', '周三', '周四'],
  35. z: 10
  36. },
  37. polar: {
  38. },
  39. series: [{
  40. type: 'bar',
  41. data: [1, 2, 3, 4],
  42. coordinateSystem: 'polar',
  43. name: 'A',
  44. stack: 'a'
  45. }, {
  46. type: 'bar',
  47. data: [2, 4, 6, 8],
  48. coordinateSystem: 'polar',
  49. name: 'B',
  50. stack: 'a'
  51. }, {
  52. type: 'bar',
  53. data: [1, 2, 3, 4],
  54. coordinateSystem: 'polar',
  55. name: 'C',
  56. stack: 'a'
  57. }],
  58. legend: {
  59. show: true,
  60. data: ['A', 'B', 'C']
  61. }
  62. });
  63. chart.on('click', function (params) {
  64. console.log(params);
  65. });
  66. window.onresize = chart.resize;
  67. });
  68. </script>
  69. </body>
  70. </html>