investHome5.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. time: '',
  6. timer: '',
  7. }
  8. },
  9. created () {
  10. this.time = formatDate()
  11. this.timer = setInterval(() => {
  12. this.time = formatDate()
  13. })
  14. },
  15. beforeDestroy () {
  16. if (this.timer) {
  17. clearInterval(this.timer);
  18. }
  19. },
  20. mounted () {
  21. setTimeout(() => {
  22. this.initChart1()
  23. this.initChart2()
  24. this.initChart3()
  25. this.initChart4()
  26. this.initChart5()
  27. })
  28. },
  29. methods: {
  30. initChart1 () {
  31. let myChart = echarts.init(this.$refs['echart1'])
  32. let option = {
  33. tooltip: {
  34. formatter: data => {
  35. return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿 <br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿`
  36. },
  37. trigger: 'axis',
  38. // axisPointer: {
  39. // type: 'cross',
  40. // },
  41. },
  42. grid: {
  43. top: '16%',
  44. right:'3%',
  45. left: '5%',
  46. bottom: '15%',
  47. },
  48. legend: {
  49. data: ["预算额", "已签合同额",'产值认定额','结算额','结算额'],
  50. x:'center',
  51. y:'10px',
  52. textStyle: {
  53. color: 'rgba(250,250,250,0.6)',
  54. },
  55. },
  56. xAxis: {
  57. data: title.map(item=>item.name),
  58. axisLine: {
  59. show: true, //隐藏X轴轴线
  60. lineStyle: {
  61. color: '#005094',
  62. width: 1,
  63. },
  64. },
  65. axisTick: {
  66. show: false, //隐藏X轴刻度
  67. },
  68. axisLabel: {
  69. show: true,
  70. rotate: 40,
  71. textStyle: {
  72. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  73. },
  74. },
  75. },
  76. yAxis: [
  77. {
  78. type: 'value',
  79. name: '亿元',
  80. nameTextStyle: {
  81. color: 'rgba(255,255,255,0.6)',
  82. },
  83. splitLine: {
  84. show: true,
  85. lineStyle: {
  86. color: '#68b4dd66',
  87. type: 'dashed',
  88. },
  89. },
  90. axisLine: {
  91. show: true,
  92. lineStyle: {
  93. color: '#3D7495',
  94. },
  95. },
  96. axisLabel: {
  97. show: true,
  98. textStyle: {
  99. color: 'rgba(250,250,250,0.6)',
  100. },
  101. },
  102. },
  103. ],
  104. series: [
  105. {
  106. name: '预算额',
  107. type: 'bar',
  108. barWidth: 5,
  109. itemStyle: {
  110. normal: {
  111. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  112. {
  113. offset: 0,
  114. color: '#71D5FF',
  115. },
  116. {
  117. offset: 1,
  118. color: '#082550',
  119. },
  120. ]),
  121. },
  122. },
  123. data: title.map(item=>item.value),
  124. },
  125. {
  126. name: '已签合同额',
  127. type: 'bar',
  128. barWidth: 5,
  129. itemStyle: {
  130. normal: {
  131. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  132. {
  133. offset: 0,
  134. color: '#4D6FF6',
  135. },
  136. {
  137. offset: 1,
  138. color: '#082550',
  139. },
  140. ]),
  141. },
  142. },
  143. data: title.map(item=>item.value2),
  144. },
  145. {
  146. name: '产值认定额',
  147. type: 'bar',
  148. barWidth: 5,
  149. itemStyle: {
  150. normal: {
  151. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  152. {
  153. offset: 0,
  154. color: '#877CFC',
  155. },
  156. {
  157. offset: 1,
  158. color: '#082550',
  159. },
  160. ]),
  161. },
  162. },
  163. data: title.map(item=>item.value2),
  164. },
  165. {
  166. name: '结算额',
  167. type: 'bar',
  168. barWidth: 5,
  169. itemStyle: {
  170. normal: {
  171. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  172. {
  173. offset: 0,
  174. color: '#52BF80',
  175. },
  176. {
  177. offset: 1,
  178. color: '#082550',
  179. },
  180. ]),
  181. },
  182. },
  183. data: title.map(item=>item.value2),
  184. },
  185. {
  186. name: '付款额',
  187. type: 'bar',
  188. barWidth: 5,
  189. itemStyle: {
  190. normal: {
  191. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  192. {
  193. offset: 0,
  194. color: '#CADD62',
  195. },
  196. {
  197. offset: 1,
  198. color: '#082550',
  199. },
  200. ]),
  201. },
  202. },
  203. data: title.map(item=>item.value2),
  204. },
  205. ],
  206. }
  207. myChart.setOption(option)
  208. tools.loopShowTooltip(myChart, option, {
  209. nterval: 2000,
  210. loopSeries: true,
  211. })
  212. },
  213. initChart2 () {
  214. const dataBJ = [
  215. [1, 55, 9, 56, 0.46, 18, 6, '良'],
  216. [2, 25, 11, 21, 0.65, 34, 9, '优'],
  217. [3, 56, 7, 63, 0.3, 14, 5, '良'],
  218. [4, 33, 7, 29, 0.33, 16, 6, '优'],
  219. [5, 42, 24, 44, 0.76, 40, 16, '优'],
  220. [6, 82, 58, 90, 1.77, 68, 33, '良'],
  221. [7, 74, 49, 77, 1.46, 48, 27, '良'],
  222. [8, 78, 55, 80, 1.29, 59, 29, '良'],
  223. [9, 267, 216, 280, 4.8, 108, 64, '重度污染'],
  224. [10, 185, 127, 216, 2.52, 61, 27, '中度污染'],
  225. [11, 39, 19, 38, 0.57, 31, 15, '优'],
  226. [12, 41, 11, 40, 0.43, 21, 7, '优'],
  227. [13, 64, 38, 74, 1.04, 46, 22, '良'],
  228. [14, 108, 79, 120, 1.7, 75, 41, '轻度污染'],
  229. [15, 108, 63, 116, 1.48, 44, 26, '轻度污染'],
  230. [16, 33, 6, 29, 0.34, 13, 5, '优'],
  231. [17, 94, 66, 110, 1.54, 62, 31, '良'],
  232. [18, 186, 142, 192, 3.88, 93, 79, '中度污染'],
  233. [19, 57, 31, 54, 0.96, 32, 14, '良'],
  234. [20, 22, 8, 17, 0.48, 23, 10, '优'],
  235. [21, 39, 15, 36, 0.61, 29, 13, '优'],
  236. [22, 94, 69, 114, 2.08, 73, 39, '良'],
  237. [23, 99, 73, 110, 2.43, 76, 48, '良'],
  238. [24, 31, 12, 30, 0.5, 32, 16, '优'],
  239. [25, 42, 27, 43, 1, 53, 22, '优'],
  240. [26, 154, 117, 157, 3.05, 92, 58, '中度污染'],
  241. [27, 234, 185, 230, 4.09, 123, 69, '重度污染'],
  242. [28, 160, 120, 186, 2.77, 91, 50, '中度污染'],
  243. [29, 134, 96, 165, 2.76, 83, 41, '轻度污染'],
  244. [30, 52, 24, 60, 1.03, 50, 21, '良'],
  245. [31, 46, 5, 49, 0.28, 10, 6, '优']
  246. ];
  247. const dataGZ = [
  248. [1, 26, 37, 27, 1.163, 27, 13, '优'],
  249. [2, 85, 62, 71, 1.195, 60, 8, '良'],
  250. [3, 78, 38, 74, 1.363, 37, 7, '良'],
  251. [4, 21, 21, 36, 0.634, 40, 9, '优'],
  252. [5, 41, 42, 46, 0.915, 81, 13, '优'],
  253. [6, 56, 52, 69, 1.067, 92, 16, '良'],
  254. [7, 64, 30, 28, 0.924, 51, 2, '良'],
  255. [8, 55, 48, 74, 1.236, 75, 26, '良'],
  256. [9, 76, 85, 113, 1.237, 114, 27, '良'],
  257. [10, 91, 81, 104, 1.041, 56, 40, '良'],
  258. [11, 84, 39, 60, 0.964, 25, 11, '良'],
  259. [12, 64, 51, 101, 0.862, 58, 23, '良'],
  260. [13, 70, 69, 120, 1.198, 65, 36, '良'],
  261. [14, 77, 105, 178, 2.549, 64, 16, '良'],
  262. [15, 109, 68, 87, 0.996, 74, 29, '轻度污染'],
  263. [16, 73, 68, 97, 0.905, 51, 34, '良'],
  264. [17, 54, 27, 47, 0.592, 53, 12, '良'],
  265. [18, 51, 61, 97, 0.811, 65, 19, '良'],
  266. [19, 91, 71, 121, 1.374, 43, 18, '良'],
  267. [20, 73, 102, 182, 2.787, 44, 19, '良'],
  268. [21, 73, 50, 76, 0.717, 31, 20, '良'],
  269. [22, 84, 94, 140, 2.238, 68, 18, '良'],
  270. [23, 93, 77, 104, 1.165, 53, 7, '良'],
  271. [24, 99, 130, 227, 3.97, 55, 15, '良'],
  272. [25, 146, 84, 139, 1.094, 40, 17, '轻度污染'],
  273. [26, 113, 108, 137, 1.481, 48, 15, '轻度污染'],
  274. [27, 81, 48, 62, 1.619, 26, 3, '良'],
  275. [28, 56, 48, 68, 1.336, 37, 9, '良'],
  276. [29, 82, 92, 174, 3.29, 0, 13, '良'],
  277. [30, 106, 116, 188, 3.628, 101, 16, '轻度污染'],
  278. [31, 118, 50, 0, 1.383, 76, 11, '轻度污染']
  279. ];
  280. const dataSH = [
  281. [1, 91, 45, 125, 0.82, 34, 23, '良'],
  282. [2, 65, 27, 78, 0.86, 45, 29, '良'],
  283. [3, 83, 60, 84, 1.09, 73, 27, '良'],
  284. [4, 109, 81, 121, 1.28, 68, 51, '轻度污染'],
  285. [5, 106, 77, 114, 1.07, 55, 51, '轻度污染'],
  286. [6, 109, 81, 121, 1.28, 68, 51, '轻度污染'],
  287. [7, 106, 77, 114, 1.07, 55, 51, '轻度污染'],
  288. [8, 89, 65, 78, 0.86, 51, 26, '良'],
  289. [9, 53, 33, 47, 0.64, 50, 17, '良'],
  290. [10, 80, 55, 80, 1.01, 75, 24, '良'],
  291. [11, 117, 81, 124, 1.03, 45, 24, '轻度污染'],
  292. [12, 99, 71, 142, 1.1, 62, 42, '良'],
  293. [13, 95, 69, 130, 1.28, 74, 50, '良'],
  294. [14, 116, 87, 131, 1.47, 84, 40, '轻度污染'],
  295. [15, 108, 80, 121, 1.3, 85, 37, '轻度污染'],
  296. [16, 134, 83, 167, 1.16, 57, 43, '轻度污染'],
  297. [17, 79, 43, 107, 1.05, 59, 37, '良'],
  298. [18, 71, 46, 89, 0.86, 64, 25, '良'],
  299. [19, 97, 71, 113, 1.17, 88, 31, '良'],
  300. [20, 84, 57, 91, 0.85, 55, 31, '良'],
  301. [21, 87, 63, 101, 0.9, 56, 41, '良'],
  302. [22, 104, 77, 119, 1.09, 73, 48, '轻度污染'],
  303. [23, 87, 62, 100, 1, 72, 28, '良'],
  304. [24, 168, 128, 172, 1.49, 97, 56, '中度污染'],
  305. [25, 65, 45, 51, 0.74, 39, 17, '良'],
  306. [26, 39, 24, 38, 0.61, 47, 17, '优'],
  307. [27, 39, 24, 39, 0.59, 50, 19, '优'],
  308. [28, 93, 68, 96, 1.05, 79, 29, '良'],
  309. [29, 188, 143, 197, 1.66, 99, 51, '中度污染'],
  310. [30, 174, 131, 174, 1.55, 108, 50, '中度污染'],
  311. [31, 187, 143, 201, 1.39, 89, 53, '中度污染']
  312. ];
  313. const itemStyle = {
  314. // opacity: 0.8,
  315. shadowBlur: 10,
  316. shadowOffsetX: 0,
  317. shadowOffsetY: 0,
  318. shadowColor: 'rgba(0,0,0,0.3)'
  319. };
  320. let myChart = echarts.init(this.$refs['echart2'])
  321. let option = {
  322. color: ['#80F1BE', '#fec42c', '#dd4444'],
  323. title: {
  324. textStyle: {
  325. color: '#69C0FF',
  326. fontSize: 16,
  327. fontWeight: 500
  328. },
  329. top: '10',
  330. left: '10'
  331. },
  332. legend: {
  333. top: 10,
  334. data: ['正偏差', '容差', '负偏差'],
  335. textStyle: {
  336. fontSize: 12,
  337. color:'#fff'
  338. }
  339. },
  340. textStyle: {
  341. color: '#fff',
  342. },
  343. tooltip: {
  344. show:false,
  345. trigger: "axis",
  346. formatter: function (params) {
  347. var tip = params[0].axisValue + '<br/>' + params[0].marker + params[0].data[1] + ':' + params[0].data[2] + '个,' + params[0].data[3] + '亿元' + '<br/>' + params[1].marker + params[1].data[1] + ':' + params[1].data[2] + '个,' + params[1].data[3] + '亿元';
  348. return tip
  349. },
  350. axisPointer: {
  351. lineStyle: {
  352. type: 'dashed',
  353. width: 2,
  354. color: 'rgba(255,255,255,0.6)'
  355. },
  356. animation: true
  357. }
  358. },
  359. grid: {
  360. top: '25%',
  361. right: '5%',
  362. left: '6%',
  363. bottom: '15%',
  364. },
  365. yAxis: {
  366. name:'亿元',
  367. // data: ['备案', '特别监管'],
  368. splitLine: {
  369. show: true,
  370. lineStyle: {
  371. color: '#68b4dd66',
  372. type: 'dashed',
  373. },
  374. },
  375. axisLine: {
  376. show: false
  377. },
  378. axisLabel: {
  379. show: true,
  380. formatter: '{value}',
  381. textStyle: {
  382. color: 'rgba(250,250,250,0.6)',
  383. },
  384. },
  385. nameTextStyle: {
  386. color: '#ebf8ac',
  387. fontSize: 16,
  388. },
  389. },
  390. xAxis: {
  391. // data: ['项目储备', '项目立项', '可研论证', '投资决策'],
  392. axisLine: {
  393. show: true, //隐藏X轴轴线
  394. lineStyle: {
  395. color: '#005094',
  396. width: 1,
  397. },
  398. },
  399. axisTick: {
  400. show: false, //隐藏X轴刻度
  401. },
  402. axisLabel: {
  403. show: true,
  404. textStyle: {
  405. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  406. fontSize: 12,
  407. },
  408. },
  409. },
  410. series: [
  411. {
  412. name: '正偏差',
  413. type: 'scatter',
  414. itemStyle: itemStyle,
  415. data: dataBJ,
  416. },
  417. {
  418. name: '容差',
  419. type: 'scatter',
  420. itemStyle: itemStyle,
  421. data: dataSH
  422. },
  423. {
  424. name: '负偏差',
  425. type: 'scatter',
  426. itemStyle: itemStyle,
  427. data: dataGZ
  428. }
  429. // {
  430. // name: '特别监管',
  431. // type: 'scatter',
  432. // symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  433. // symbolSize: function (data) {
  434. // return Math.sqrt(data[2]) * 3;
  435. // },
  436. // label: {
  437. // emphasis: {
  438. // show: true,
  439. // formatter: function (param) {
  440. // return param.data[2];
  441. // },
  442. // position: 'top'
  443. // }
  444. // },
  445. // itemStyle: {
  446. // normal: {
  447. // color: '#40A9FF'
  448. // }
  449. // },
  450. // data: [
  451. // ['项目储备', '特别监管', 14, 12.05],
  452. // ['项目立项', '特别监管', 2, 1.25],
  453. // ['可研论证', '特别监管', 10, 32.69],
  454. // ['投资决策', '特别监管', 15, 28.53],
  455. // ]
  456. // },
  457. // {
  458. // name: '备案',
  459. // type: 'scatter',
  460. // symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  461. // symbolSize: function (data) {
  462. // return Math.sqrt(data[2]) * 3;
  463. // },
  464. // label: {
  465. // emphasis: {
  466. // show: true,
  467. // formatter: function (param) {
  468. // return param.data[2];
  469. // },
  470. // position: 'top'
  471. // }
  472. // },
  473. // itemStyle: {
  474. // normal: {
  475. // color: '#45DAD1'
  476. // }
  477. // },
  478. // data: [
  479. // ['项目储备', '备案', 27, 23.86],
  480. // ['项目立项', '备案', 1, 1.05],
  481. // ['可研论证', '备案', 14, 18.46],
  482. // ['投资决策', '备案', 40, 38.86],
  483. // ]
  484. // },
  485. ]
  486. }
  487. myChart.setOption(option)
  488. tools.loopShowTooltip(myChart, option, {
  489. nterval: 2000,
  490. loopSeries: true,
  491. })
  492. },
  493. initChart3 () {
  494. let myChart = echarts.init(this.$refs['echart3'])
  495. let option = {
  496. tooltip: {
  497. formatter: data => {
  498. return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿 <br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿`
  499. },
  500. trigger: 'axis',
  501. // axisPointer: {
  502. // type: 'cross',
  503. // },
  504. },
  505. grid: {
  506. top: '16%',
  507. right:'3%',
  508. left: '10%',
  509. bottom: '25%',
  510. },
  511. legend: {
  512. data: ["高风险", "中风险",'低风险'],
  513. x:'center',
  514. y:'10px',
  515. textStyle: {
  516. color: 'rgba(250,250,250,0.6)',
  517. },
  518. },
  519. xAxis: {
  520. data: title.map(item=>item.name),
  521. axisLine: {
  522. show: true, //隐藏X轴轴线
  523. lineStyle: {
  524. color: '#005094',
  525. width: 1,
  526. },
  527. },
  528. axisTick: {
  529. show: false, //隐藏X轴刻度
  530. },
  531. axisLabel: {
  532. show: true,
  533. rotate: 40,
  534. textStyle: {
  535. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  536. },
  537. },
  538. },
  539. yAxis: [
  540. {
  541. type: 'value',
  542. name: '亿元',
  543. nameTextStyle: {
  544. color: 'rgba(255,255,255,0.6)',
  545. },
  546. splitLine: {
  547. show: true,
  548. lineStyle: {
  549. color: '#68b4dd66',
  550. type: 'dashed',
  551. },
  552. },
  553. axisLine: {
  554. show: true,
  555. lineStyle: {
  556. color: '#3D7495',
  557. },
  558. },
  559. axisLabel: {
  560. show: true,
  561. textStyle: {
  562. color: 'rgba(250,250,250,0.6)',
  563. },
  564. },
  565. },
  566. ],
  567. series: [
  568. {
  569. name: '高风险',
  570. type: 'bar',
  571. barWidth: 5,
  572. itemStyle: {
  573. normal: {
  574. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  575. {
  576. offset: 0,
  577. color: '#69c0ff',
  578. },
  579. {
  580. offset: 1,
  581. color: '#082550',
  582. },
  583. ]),
  584. },
  585. },
  586. data: echart3.map(item=>item.value),
  587. },
  588. {
  589. name: '中风险',
  590. type: 'bar',
  591. barWidth: 5,
  592. itemStyle: {
  593. normal: {
  594. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  595. {
  596. offset: 0,
  597. color: '#957DFF',
  598. },
  599. {
  600. offset: 1,
  601. color: '#082550',
  602. },
  603. ]),
  604. },
  605. },
  606. data: echart3.map(item=>item.value2),
  607. },
  608. {
  609. name: '低风险',
  610. type: 'bar',
  611. barWidth: 5,
  612. itemStyle: {
  613. normal: {
  614. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  615. {
  616. offset: 0,
  617. color: '#957DFF',
  618. },
  619. {
  620. offset: 1,
  621. color: '#082550',
  622. },
  623. ]),
  624. },
  625. },
  626. data: echart3.map(item=>item.value3),
  627. },
  628. ],
  629. }
  630. myChart.setOption(option)
  631. tools.loopShowTooltip(myChart, option, {
  632. nterval: 2000,
  633. loopSeries: true,
  634. })
  635. },
  636. initChart4 () {
  637. let myChart = echarts.init(this.$refs['echart4'])
  638. option = {
  639. title: {
  640. text: ''
  641. },
  642. legend: {
  643. data: ['类型1', '类型2', '类型3', '类型4', '类型5'],
  644. textStyle: {
  645. color: '#9DB9EB',
  646. },
  647. },
  648. splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  649. show: true,
  650. areaStyle: { // 分隔区域的样式设置。
  651. color: ['yellow'],
  652. // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
  653. }
  654. },
  655. radar: {
  656. // shape: 'circle',
  657. center: ['50%', '60%'],
  658. radius: 40,
  659. indicator: [
  660. { name: '类型1', max: 100000 },
  661. { name: '类型2', max: 100000 },
  662. { name: '类型3', max: 100000 },
  663. { name: '类型4', max: 100000 },
  664. { name: '类型5', max: 100000 },
  665. ],
  666. axisLine: { // 设置雷达图中间射线的颜色
  667. lineStyle: {
  668. color: '#c0c0c0',
  669. },
  670. },
  671. splitLine: { //网格颜色设置
  672. show: true,
  673. lineStyle: {
  674. width: 1,
  675. color: '#1e83e4',
  676. },
  677. },
  678. splitArea: { //设置图表颜色,show的值为true
  679. show: false,
  680. areaStyle: {
  681. // color:"#c1ddf8", //一般设置方式
  682. //设置渐变背景色 new echarts.graphic.LinearGradient(a,b,c,d,arr)
  683. //a ,b,c,d值可为0,1 a:1表示arr中的颜色右到左;c:1 arr中的颜色左到右
  684. //b:1表示arr中的颜色下到上;d:1表示arr中的颜色上到下
  685. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  686. { offset: 0, color: '#c1ddf8' }, // 0% 处的颜色
  687. { offset: 1, color: '#1e83e4' }// 100% 处的颜色
  688. ], false)
  689. }
  690. }
  691. },
  692. series: [
  693. {
  694. name: '',
  695. type: 'radar',
  696. symbol: 'circle', // 单个数值点的样式,还可以取值'rect','angle'等
  697. symbolSize: 0, // 数值点的大小
  698. data: [
  699. {
  700. value: echart4[0],
  701. name: '类型1',
  702. itemStyle: { //该数值区域样式设置
  703. normal: {
  704. color: '#2CC6FF', //背景颜色,还需设置areaStyle
  705. lineStyle: {
  706. color: '#2CC6FF', //边框颜色
  707. },
  708. },
  709. },
  710. label: { //显示value中具体的数值
  711. normal: {
  712. show: false,
  713. textStyle: { //更改数值样式
  714. color: '#43EDE3'
  715. }
  716. },
  717. },
  718. areaStyle: { //设置区域背景颜色透明度
  719. normal: {
  720. width: 1,
  721. opacity: 0.8,
  722. },
  723. },
  724. },
  725. {
  726. value: echart4[1],
  727. name: '类型2',
  728. itemStyle: { //该数值区域样式设置
  729. normal: {
  730. color: '#D87AFF', //背景颜色,还需设置areaStyle
  731. lineStyle: {
  732. color: '#2CC6FF', //边框颜色
  733. },
  734. },
  735. },
  736. label: { //显示value中具体的数值
  737. normal: {
  738. show: false,
  739. textStyle: { //更改数值样式
  740. color: '#43EDE3'
  741. }
  742. },
  743. },
  744. areaStyle: { //设置区域背景颜色透明度
  745. normal: {
  746. width: 1,
  747. opacity: 0.8,
  748. },
  749. },
  750. }
  751. ]
  752. }
  753. ]
  754. };
  755. tools.loopShowTooltip(myChart, option, {
  756. interval: 2000,
  757. loopSeries: true,
  758. });
  759. myChart.setOption(option)
  760. },
  761. initChart5 () {
  762. let myChart = echarts.init(this.$refs['echart5'])
  763. let option = {
  764. tooltip: {
  765. formatter: data => {
  766. return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿 <br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿`
  767. },
  768. trigger: 'axis',
  769. // axisPointer: {
  770. // type: 'cross',
  771. // },
  772. },
  773. grid: {
  774. top: '16%',
  775. right:'3%',
  776. left: '3%',
  777. bottom: '25%',
  778. },
  779. legend: {
  780. data: ["预算额", "合同额","结算额","支付额"],
  781. x:'center',
  782. y:'10px',
  783. textStyle: {
  784. color: 'rgba(250,250,250,0.6)',
  785. },
  786. },
  787. xAxis: {
  788. data: title.map(item=>item.name),
  789. axisLine: {
  790. show: true, //隐藏X轴轴线
  791. lineStyle: {
  792. color: '#005094',
  793. width: 1,
  794. },
  795. },
  796. axisTick: {
  797. show: false, //隐藏X轴刻度
  798. },
  799. axisLabel: {
  800. show: true,
  801. rotate: 40,
  802. textStyle: {
  803. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  804. },
  805. },
  806. },
  807. yAxis: [
  808. {
  809. type: 'value',
  810. name: '亿元',
  811. nameTextStyle: {
  812. color: 'rgba(255,255,255,0.6)',
  813. },
  814. splitLine: {
  815. show: true,
  816. lineStyle: {
  817. color: '#68b4dd66',
  818. type: 'dashed',
  819. },
  820. },
  821. axisLine: {
  822. show: true,
  823. lineStyle: {
  824. color: '#3D7495',
  825. },
  826. },
  827. axisLabel: {
  828. show: true,
  829. textStyle: {
  830. color: 'rgba(250,250,250,0.6)',
  831. },
  832. },
  833. },
  834. ],
  835. series: [
  836. {
  837. name: '预算额',
  838. type: 'bar',
  839. barWidth: 10,
  840. itemStyle: {
  841. normal: {
  842. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  843. {
  844. offset: 0,
  845. color: '#69c0ff',
  846. },
  847. {
  848. offset: 1,
  849. color: '#082550',
  850. },
  851. ]),
  852. },
  853. },
  854. data: title.map(item=>item.value),
  855. },
  856. {
  857. name: '合同额',
  858. type: 'bar',
  859. barWidth: 10,
  860. itemStyle: {
  861. normal: {
  862. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  863. {
  864. offset: 0,
  865. color: '#957DFF',
  866. },
  867. {
  868. offset: 1,
  869. color: '#082550',
  870. },
  871. ]),
  872. },
  873. },
  874. data:title.map(item=>item.value2),
  875. },
  876. {
  877. name: '结算额',
  878. type: 'bar',
  879. barWidth: 10,
  880. itemStyle: {
  881. normal: {
  882. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  883. {
  884. offset: 0,
  885. color: '#957DFF',
  886. },
  887. {
  888. offset: 1,
  889. color: '#082550',
  890. },
  891. ]),
  892. },
  893. },
  894. data:title.map(item=>item.value3),
  895. },
  896. {
  897. name: '支付额',
  898. type: 'bar',
  899. barWidth: 10,
  900. itemStyle: {
  901. normal: {
  902. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  903. {
  904. offset: 0,
  905. color: '#957DFF',
  906. },
  907. {
  908. offset: 1,
  909. color: '#082550',
  910. },
  911. ]),
  912. },
  913. },
  914. data:title.map(item=>item.value4),
  915. },
  916. ],
  917. }
  918. myChart.setOption(option)
  919. tools.loopShowTooltip(myChart, option, {
  920. nterval: 2000,
  921. loopSeries: true,
  922. })
  923. },
  924. },
  925. })