Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. app.title = '堆叠条形图';
  2.  
  3. option = {
  4. tooltip : {
  5. trigger: 'axis',
  6. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  7. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  8. }
  9. },
  10. legend: {
  11. data: ['day1', 'day2','day3', 'month1','month2','month3','month4', 'year1', 'year2']
  12. },
  13. grid: {
  14. left: '3%',
  15. right: '4%',
  16. bottom: '3%',
  17. containLabel: true
  18. },
  19. xAxis: {
  20. type: 'category',
  21. data: ['1','2','3']
  22. },
  23. yAxis: {
  24. type: 'value'
  25. },
  26. series: [
  27. {
  28. name: 'year1',
  29. type: 'bar',
  30. stack: 'year',
  31. label: {
  32. normal: {
  33. show: true,
  34. position: 'insideRight'
  35. }
  36. },
  37. data: [320, 302, 301]
  38. },
  39. {
  40. name: 'year2',
  41. type: 'bar',
  42. stack: 'year',
  43. label: {
  44. normal: {
  45. show: true,
  46. position: 'insideRight'
  47. }
  48. },
  49. data: [320, 302, 301]
  50. },
  51. {
  52. name: 'day1',
  53. type: 'bar',
  54. stack: 'day',
  55. label: {
  56. normal: {
  57. show: true,
  58. position: 'insideRight'
  59. }
  60. },
  61. data: [320, 302, 301]
  62. },
  63. {
  64. name: 'month1',
  65. type: 'bar',
  66. stack: 'month',
  67. label: {
  68. normal: {
  69. show: true,
  70. position: 'insideRight'
  71. }
  72. },
  73. data: [303, 302, 301]
  74. },
  75. {
  76. name: 'month2',
  77. type: 'bar',
  78. stack: 'month',
  79. label: {
  80. normal: {
  81. show: true,
  82. position: 'insideRight'
  83. }
  84. },
  85. data: [303, 302, 301]
  86. },
  87. {
  88. name: 'month3',
  89. type: 'bar',
  90. stack: 'month',
  91. label: {
  92. normal: {
  93. show: true,
  94. position: 'insideRight'
  95. }
  96. },
  97. data: [303, 302, 301]
  98. },
  99. {
  100. name: 'month4',
  101. type: 'bar',
  102. stack: 'month',
  103. label: {
  104. normal: {
  105. show: true,
  106. position: 'insideRight'
  107. }
  108. },
  109. data: [503, 702, 101]
  110. },
  111. {
  112. name: 'day2',
  113. type: 'bar',
  114. stack: 'day',
  115. label: {
  116. normal: {
  117. show: true,
  118. position: 'insideRight'
  119. }
  120. },
  121. data: [120, 132, 101]
  122. },
  123. {
  124. name: 'day3',
  125. type: 'bar',
  126. stack: 'day',
  127. label: {
  128. normal: {
  129. show: true,
  130. position: 'insideRight'
  131. }
  132. },
  133. data: [220, 182, 191]
  134. }
  135. ]
  136. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement