bar.js 12 KB

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