humanTh.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. var myChart_human = echarts.init(document.getElementById('jrbm'));
  2. option_human = {
  3. tooltip: {
  4. trigger: 'axis',
  5. axisPointer: {
  6. type: 'shadow'
  7. }
  8. },
  9. grid: {
  10. top:'10%',
  11. left: '10%',
  12. right: '10%',
  13. bottom: '10%',
  14. containLabel: true
  15. },
  16. xAxis: {
  17. axisLine:{
  18. show:false
  19. },
  20. axisLabel:{
  21. show:false
  22. },
  23. splitLine:{
  24. show:false
  25. },
  26. },
  27. yAxis: {
  28. type: 'category',
  29. data: ['住建局','法院','卫健委','公积金', '民政局','不动产','文旅局'],
  30. axisLine:{
  31. lineStyle:{
  32. color:'#00cdef'
  33. }
  34. },
  35. axisTick:{
  36. show:false
  37. },
  38. },
  39. series : [
  40. {
  41. type:'bar',
  42. barWidth:10,
  43. itemStyle: { //上方显示数值
  44. normal: {
  45. label: {
  46. show: true, //开启显示
  47. position: 'insideLeft', //在上方显示
  48. textStyle: { //数值样式
  49. color: 'white',
  50. fontSize: 11
  51. }
  52. }
  53. }
  54. },
  55. data:[
  56. {
  57. value:10,
  58. itemStyle:{
  59. color:new echarts.graphic.LinearGradient
  60. (
  61. 1, 0, 0, 1,
  62. [
  63. {offset: 0, color: '#00feff'},
  64. {offset: 0.5, color: '#00feff'},
  65. {offset: 0.8, color: '#0066cc'},
  66. {offset: 1, color: '#0066cc'}
  67. ]
  68. )
  69. }
  70. },
  71. {
  72. value:20,
  73. itemStyle:{color:new echarts.graphic.LinearGradient
  74. (
  75. 1, 0, 0, 1,
  76. [
  77. {offset: 0, color: '#00ffb9'},
  78. {offset: 0.5, color: '#26ddbe'},
  79. {offset: 0.8, color: '#2ebc95'},
  80. {offset: 1, color: '#2ebc95'}
  81. ]
  82. )
  83. }
  84. },
  85. {
  86. value:9,
  87. itemStyle:{
  88. color:new echarts.graphic.LinearGradient
  89. (
  90. 1, 0, 0, 1,
  91. [
  92. {offset: 0, color: '#fff442'},
  93. {offset: 0.5, color: '#ffc300'},
  94. {offset: 0.8, color: '#e4c52a'},
  95. {offset: 1, color: '#ef8217'}
  96. ]
  97. )
  98. }
  99. },
  100. {
  101. value:8,
  102. itemStyle:{
  103. color:new echarts.graphic.LinearGradient
  104. (
  105. 1, 0, 0, 1,
  106. [
  107. {offset: 0, color: '#ff9900'},
  108. {offset: 0.5, color: '#ff9900'},
  109. {offset: 0.8, color: '#cc6600'},
  110. {offset: 1, color: '#cc6600'}
  111. ]
  112. )
  113. }
  114. },
  115. {
  116. value:7,
  117. itemStyle:{
  118. color:new echarts.graphic.LinearGradient
  119. (
  120. 1, 0, 0, 1,
  121. [
  122. {offset: 0, color: '#ff0000'},
  123. {offset: 0.5, color: '#ff0000'},
  124. {offset: 0.8, color: '#7f0000'},
  125. {offset: 1, color: '#7f0000'}
  126. ]
  127. )
  128. }
  129. },
  130. {
  131. value:6,
  132. itemStyle:{
  133. color:new echarts.graphic.LinearGradient
  134. (
  135. 1, 0, 0, 1,
  136. [
  137. {offset: 0, color: '#00feff'},
  138. {offset: 0.5, color: '#00feff'},
  139. {offset: 0.8, color: '#0066cc'},
  140. {offset: 1, color: '#0066cc'}
  141. ]
  142. )
  143. }
  144. },
  145. {
  146. value:5,
  147. itemStyle:{color:new echarts.graphic.LinearGradient
  148. (
  149. 1, 0, 0, 1,
  150. [
  151. {offset: 0, color: '#00ffb9'},
  152. {offset: 0.5, color: '#26ddbe'},
  153. {offset: 0.8, color: '#2ebc95'},
  154. {offset: 1, color: '#2ebc95'}
  155. ]
  156. )
  157. }
  158. },
  159. {
  160. value:4,
  161. itemStyle:{
  162. color:new echarts.graphic.LinearGradient
  163. (
  164. 1, 0, 0, 1,
  165. [
  166. {offset: 0, color: '#fff442'},
  167. {offset: 0.5, color: '#ffc300'},
  168. {offset: 0.8, color: '#e4c52a'},
  169. {offset: 1, color: '#ef8217'}
  170. ]
  171. )
  172. }
  173. },
  174. {
  175. value:3,
  176. itemStyle:{
  177. color:new echarts.graphic.LinearGradient
  178. (
  179. 1, 0, 0, 1,
  180. [
  181. {offset: 0, color: '#ff9900'},
  182. {offset: 0.5, color: '#ff9900'},
  183. {offset: 0.8, color: '#cc6600'},
  184. {offset: 1, color: '#cc6600'}
  185. ]
  186. )
  187. }
  188. },
  189. ]
  190. }
  191. ]
  192. };
  193. myChart_human.setOption(option_human);