bar2.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. (function () {
  2. var chart1 = echarts.init(document.getElementById('bbchart1'));
  3. var chart2 = echarts.init(document.getElementById('bbchart2'));
  4. var chart3 = echarts.init(document.getElementById('bbchart3'));
  5. var chart4 = echarts.init(document.getElementById('bbchart4'));
  6. var chart5 = echarts.init(document.getElementById('bbchart5'));
  7. var option = [{
  8. title: {
  9. textStyle: {
  10. color: '#2b8fff',
  11. fontSize: 14,
  12. fontWeight: 'bold'
  13. }
  14. },
  15. tooltip: {},
  16. legend: {
  17. show: false
  18. },
  19. xAxis: {
  20. data: ["18", "20", "24", "30", "35", "25", "38", "40"],
  21. axisLabel: {
  22. show: false,
  23. // X 轴标签
  24. // rotate: 30,
  25. fontSize: 10
  26. },
  27. // 坐标轴线相关设置设置
  28. axisLine: {
  29. show: false,
  30. lineStyle: {
  31. color: '#1eb0dc'
  32. }
  33. },
  34. axisTick: {
  35. show: false
  36. }
  37. },
  38. yAxis: {
  39. show: false,
  40. type: 'value',
  41. axisLine: {
  42. show: false,
  43. lineStyle: {
  44. color: '#1eb0dc'
  45. }
  46. },
  47. axisTick: {
  48. show: false
  49. }
  50. },
  51. grid: {
  52. left: '2%',
  53. right: '10%',
  54. bottom: '0%',
  55. top: '30%',
  56. containLabel: true
  57. },
  58. series: [{
  59. name: '浅蓝',
  60. type: 'bar',
  61. data: [10, 30, 20, 15, 30, 10, 20, 30],
  62. itemStyle: {
  63. color: '#19ffe9'
  64. },
  65. barCategoryGap: '30%',
  66. barWidth: 15,
  67. label: {
  68. show: false,
  69. position: 'top',
  70. fontSize: 10,
  71. color: '#19ffe9'
  72. }
  73. }],
  74. textStyle: {
  75. color: "#1eb0dc"
  76. }
  77. },
  78. // bar2
  79. {
  80. title: {
  81. textStyle: {
  82. color: '#2b8fff',
  83. fontSize: 14,
  84. fontWeight: 'bold'
  85. }
  86. },
  87. tooltip: {},
  88. legend: {
  89. show: false
  90. },
  91. xAxis: {
  92. data: ["18", "20", "24", "30", "35", "25", "38", "40"],
  93. axisLabel: {
  94. show: false,
  95. // X 轴标签
  96. // rotate: 30,
  97. fontSize: 10
  98. },
  99. // 坐标轴线相关设置设置
  100. axisLine: {
  101. show: false,
  102. lineStyle: {
  103. color: '#1eb0dc'
  104. }
  105. },
  106. axisTick: {
  107. show: false
  108. }
  109. },
  110. yAxis: {
  111. show: false,
  112. type: 'value',
  113. axisLine: {
  114. show: false,
  115. lineStyle: {
  116. color: '#1eb0dc'
  117. }
  118. },
  119. axisTick: {
  120. show: false
  121. }
  122. },
  123. grid: {
  124. left: '2%',
  125. right: '10%',
  126. bottom: '0%',
  127. top: '30%',
  128. containLabel: true
  129. },
  130. series: [{
  131. name: '浅蓝',
  132. type: 'bar',
  133. data: [10, 30, 20, 15, 30, 10, 20, 30],
  134. itemStyle: {
  135. color: '#19ffe9'
  136. },
  137. barCategoryGap: '30%',
  138. barWidth: 15,
  139. label: {
  140. show: false,
  141. position: 'top',
  142. fontSize: 10,
  143. color: '#19ffe9'
  144. }
  145. }],
  146. textStyle: {
  147. color: "#1eb0dc"
  148. }
  149. },
  150. // bar3
  151. {
  152. title: {
  153. textStyle: {
  154. color: '#2b8fff',
  155. fontSize: 14,
  156. fontWeight: 'bold'
  157. }
  158. },
  159. tooltip: {},
  160. legend: {
  161. show: false
  162. },
  163. xAxis: {
  164. data: ["18", "20", "24", "30", "35", "25", "38", "40"],
  165. axisLabel: {
  166. show: false,
  167. // X 轴标签
  168. // rotate: 30,
  169. fontSize: 10
  170. },
  171. // 坐标轴线相关设置设置
  172. axisLine: {
  173. show: false,
  174. lineStyle: {
  175. color: '#1eb0dc'
  176. }
  177. },
  178. axisTick: {
  179. show: false
  180. }
  181. },
  182. yAxis: {
  183. show: false,
  184. type: 'value',
  185. axisLine: {
  186. show: false,
  187. lineStyle: {
  188. color: '#1eb0dc'
  189. }
  190. },
  191. axisTick: {
  192. show: false
  193. }
  194. },
  195. grid: {
  196. left: '2%',
  197. right: '10%',
  198. bottom: '0%',
  199. top: '30%',
  200. containLabel: true
  201. },
  202. series: [{
  203. name: '浅蓝',
  204. type: 'bar',
  205. data: [10, 30, 20, 15, 30, 10, 20, 30],
  206. itemStyle: {
  207. color: '#19ffe9'
  208. },
  209. barCategoryGap: '30%',
  210. barWidth: 15,
  211. label: {
  212. show: false,
  213. position: 'top',
  214. fontSize: 10,
  215. color: '#19ffe9'
  216. }
  217. }],
  218. textStyle: {
  219. color: "#1eb0dc"
  220. }
  221. },
  222. // bar4
  223. {
  224. title: {
  225. textStyle: {
  226. color: '#2b8fff',
  227. fontSize: 14,
  228. fontWeight: 'bold'
  229. }
  230. },
  231. tooltip: {},
  232. legend: {
  233. show: false
  234. },
  235. xAxis: {
  236. data: ["18", "20", "24", "30", "35", "25", "38", "40"],
  237. axisLabel: {
  238. show: false,
  239. // X 轴标签
  240. // rotate: 30,
  241. fontSize: 10
  242. },
  243. // 坐标轴线相关设置设置
  244. axisLine: {
  245. show: false,
  246. lineStyle: {
  247. color: '#1eb0dc'
  248. }
  249. },
  250. axisTick: {
  251. show: false
  252. }
  253. },
  254. yAxis: {
  255. show: false,
  256. type: 'value',
  257. axisLine: {
  258. show: false,
  259. lineStyle: {
  260. color: '#1eb0dc'
  261. }
  262. },
  263. axisTick: {
  264. show: false
  265. }
  266. },
  267. grid: {
  268. left: '2%',
  269. right: '10%',
  270. bottom: '0%',
  271. top: '30%',
  272. containLabel: true
  273. },
  274. series: [{
  275. name: '浅蓝',
  276. type: 'bar',
  277. data: [10, 30, 20, 15, 30, 10, 20, 30],
  278. itemStyle: {
  279. color: '#19ffe9'
  280. },
  281. barCategoryGap: '30%',
  282. barWidth: 15,
  283. label: {
  284. show: false,
  285. position: 'top',
  286. fontSize: 10,
  287. color: '#19ffe9'
  288. }
  289. }],
  290. textStyle: {
  291. color: "#1eb0dc"
  292. }
  293. },
  294. // bar5
  295. {
  296. title: {
  297. textStyle: {
  298. color: '#2b8fff',
  299. fontSize: 14,
  300. fontWeight: 'bold'
  301. }
  302. },
  303. tooltip: {},
  304. legend: {
  305. show: false
  306. },
  307. xAxis: {
  308. data: ["18", "20", "24", "30", "35", "25", "38", "40"],
  309. axisLabel: {
  310. show: false,
  311. // X 轴标签
  312. // rotate: 30,
  313. fontSize: 10
  314. },
  315. // 坐标轴线相关设置设置
  316. axisLine: {
  317. show: false,
  318. lineStyle: {
  319. color: '#1eb0dc'
  320. }
  321. },
  322. axisTick: {
  323. show: false
  324. }
  325. },
  326. yAxis: {
  327. show: false,
  328. type: 'value',
  329. axisLine: {
  330. show: false,
  331. lineStyle: {
  332. color: '#1eb0dc'
  333. }
  334. },
  335. axisTick: {
  336. show: false
  337. }
  338. },
  339. grid: {
  340. left: '2%',
  341. right: '10%',
  342. bottom: '0%',
  343. top: '30%',
  344. containLabel: true
  345. },
  346. series: [{
  347. name: '浅蓝',
  348. type: 'bar',
  349. data: [10, 30, 20, 15, 30, 10, 20, 30],
  350. itemStyle: {
  351. color: '#19ffe9'
  352. },
  353. barCategoryGap: '30%',
  354. barWidth: 15,
  355. label: {
  356. show: false,
  357. position: 'top',
  358. fontSize: 10,
  359. color: '#19ffe9'
  360. }
  361. }],
  362. textStyle: {
  363. color: "#1eb0dc"
  364. }
  365. },
  366. ]
  367. chart1.setOption(option[0])
  368. chart2.setOption(option[1])
  369. chart3.setOption(option[2])
  370. chart4.setOption(option[3])
  371. chart5.setOption(option[4])
  372. window.addEventListener('resize', function () {
  373. chart1.resize();
  374. chart2.resize();
  375. chart3.resize();
  376. chart4.resize();
  377. chart5.resize();
  378. })
  379. })()