investHome5.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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. let myChart = echarts.init(this.$refs['echart2'])
  215. let option = {
  216. title: {
  217. text: '固定资产',
  218. textStyle: {
  219. color: '#69C0FF',
  220. fontSize: 16,
  221. fontWeight: 500
  222. },
  223. top: '10',
  224. left: '10'
  225. },
  226. textStyle: {
  227. color: '#fff',
  228. },
  229. tooltip: {
  230. trigger: "axis",
  231. formatter: function (params) {
  232. 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] + '亿元';
  233. return tip
  234. },
  235. axisPointer: {
  236. lineStyle: {
  237. type: 'dashed',
  238. width: 2,
  239. color: 'rgba(255,255,255,0.6)'
  240. },
  241. animation: true
  242. }
  243. },
  244. grid: {
  245. top: '25%',
  246. right: '5%',
  247. left: '15%',
  248. bottom: '15%',
  249. },
  250. yAxis: {
  251. type:'value',
  252. splitLine: {
  253. show: true,
  254. lineStyle: {
  255. color: '#68b4dd66',
  256. type: 'dashed',
  257. },
  258. },
  259. axisLine: {
  260. show: false
  261. },
  262. axisLabel: {
  263. show: true,
  264. formatter: '{value}',
  265. textStyle: {
  266. color: 'rgba(250,250,250,0.6)',
  267. },
  268. },
  269. nameTextStyle: {
  270. color: '#ebf8ac',
  271. fontSize: 16,
  272. },
  273. },
  274. xAxis: {
  275. type:'value',
  276. axisLine: {
  277. show: true, //隐藏X轴轴线
  278. lineStyle: {
  279. color: '#005094',
  280. width: 1,
  281. },
  282. },
  283. axisTick: {
  284. show: false, //隐藏X轴刻度
  285. },
  286. axisLabel: {
  287. show: true,
  288. textStyle: {
  289. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  290. fontSize: 12,
  291. },
  292. },
  293. },
  294. series: [
  295. // {
  296. // name: '特别监管',
  297. // type: 'scatter',
  298. // symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  299. // symbolSize: function (data) {
  300. // return Math.sqrt(data[2]) * 3;
  301. // },
  302. // label: {
  303. // emphasis: {
  304. // show: true,
  305. // formatter: function (param) {
  306. // return param.data[2];
  307. // },
  308. // position: 'top'
  309. // }
  310. // },
  311. // itemStyle: {
  312. // normal: {
  313. // color: '#40A9FF'
  314. // }
  315. // },
  316. // data: [
  317. // ['项目储备', '特别监管', 14, 12.05],
  318. // ['项目立项', '特别监管', 2, 1.25],
  319. // ['可研论证', '特别监管', 10, 32.69],
  320. // ['投资决策', '特别监管', 15, 28.53],
  321. // ]
  322. // },
  323. // {
  324. // name: '备案',
  325. // type: 'scatter',
  326. // symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  327. // symbolSize: function (data) {
  328. // return Math.sqrt(data[2]) * 3;
  329. // },
  330. // label: {
  331. // emphasis: {
  332. // show: true,
  333. // formatter: function (param) {
  334. // return param.data[2];
  335. // },
  336. // position: 'top'
  337. // }
  338. // },
  339. // itemStyle: {
  340. // normal: {
  341. // color: '#45DAD1'
  342. // }
  343. // },
  344. // data: [
  345. // ['项目储备', '备案', 27, 23.86],
  346. // ['项目立项', '备案', 1, 1.05],
  347. // ['可研论证', '备案', 14, 18.46],
  348. // ['投资决策', '备案', 40, 38.86],
  349. // ]
  350. // },
  351. ]
  352. }
  353. myChart.setOption(option)
  354. tools.loopShowTooltip(myChart, option, {
  355. nterval: 2000,
  356. loopSeries: true,
  357. })
  358. },
  359. initChart3 () {
  360. let myChart = echarts.init(this.$refs['echart3'])
  361. let option = {
  362. tooltip: {
  363. formatter: data => {
  364. 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}亿`
  365. },
  366. trigger: 'axis',
  367. // axisPointer: {
  368. // type: 'cross',
  369. // },
  370. },
  371. grid: {
  372. top: '16%',
  373. right:'3%',
  374. left: '10%',
  375. bottom: '25%',
  376. },
  377. legend: {
  378. data: ["高风险", "中风险",'低风险'],
  379. x:'center',
  380. y:'10px',
  381. textStyle: {
  382. color: 'rgba(250,250,250,0.6)',
  383. },
  384. },
  385. xAxis: {
  386. data: title.map(item=>item.name),
  387. axisLine: {
  388. show: true, //隐藏X轴轴线
  389. lineStyle: {
  390. color: '#005094',
  391. width: 1,
  392. },
  393. },
  394. axisTick: {
  395. show: false, //隐藏X轴刻度
  396. },
  397. axisLabel: {
  398. show: true,
  399. rotate: 40,
  400. textStyle: {
  401. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  402. },
  403. },
  404. },
  405. yAxis: [
  406. {
  407. type: 'value',
  408. name: '亿元',
  409. nameTextStyle: {
  410. color: 'rgba(255,255,255,0.6)',
  411. },
  412. splitLine: {
  413. show: true,
  414. lineStyle: {
  415. color: '#68b4dd66',
  416. type: 'dashed',
  417. },
  418. },
  419. axisLine: {
  420. show: true,
  421. lineStyle: {
  422. color: '#3D7495',
  423. },
  424. },
  425. axisLabel: {
  426. show: true,
  427. textStyle: {
  428. color: 'rgba(250,250,250,0.6)',
  429. },
  430. },
  431. },
  432. ],
  433. series: [
  434. {
  435. name: '高风险',
  436. type: 'bar',
  437. barWidth: 5,
  438. itemStyle: {
  439. normal: {
  440. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  441. {
  442. offset: 0,
  443. color: '#69c0ff',
  444. },
  445. {
  446. offset: 1,
  447. color: '#082550',
  448. },
  449. ]),
  450. },
  451. },
  452. data: echart3.map(item=>item.value),
  453. },
  454. {
  455. name: '中风险',
  456. type: 'bar',
  457. barWidth: 5,
  458. itemStyle: {
  459. normal: {
  460. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  461. {
  462. offset: 0,
  463. color: '#957DFF',
  464. },
  465. {
  466. offset: 1,
  467. color: '#082550',
  468. },
  469. ]),
  470. },
  471. },
  472. data: echart3.map(item=>item.value2),
  473. },
  474. {
  475. name: '低风险',
  476. type: 'bar',
  477. barWidth: 5,
  478. itemStyle: {
  479. normal: {
  480. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  481. {
  482. offset: 0,
  483. color: '#957DFF',
  484. },
  485. {
  486. offset: 1,
  487. color: '#082550',
  488. },
  489. ]),
  490. },
  491. },
  492. data: echart3.map(item=>item.value3),
  493. },
  494. ],
  495. }
  496. myChart.setOption(option)
  497. tools.loopShowTooltip(myChart, option, {
  498. nterval: 2000,
  499. loopSeries: true,
  500. })
  501. },
  502. initChart4 () {
  503. let myChart = echarts.init(this.$refs['echart4'])
  504. option = {
  505. title: {
  506. text: ''
  507. },
  508. legend: {
  509. data: ['类型1', '类型2', '类型3', '类型4', '类型5'],
  510. textStyle: {
  511. color: '#9DB9EB',
  512. },
  513. },
  514. splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  515. show: true,
  516. areaStyle: { // 分隔区域的样式设置。
  517. color: ['yellow'],
  518. // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
  519. }
  520. },
  521. radar: {
  522. // shape: 'circle',
  523. center: ['50%', '60%'],
  524. radius: 40,
  525. indicator: [
  526. { name: '类型1', max: 100000 },
  527. { name: '类型2', max: 100000 },
  528. { name: '类型3', max: 100000 },
  529. { name: '类型4', max: 100000 },
  530. { name: '类型5', max: 100000 },
  531. ],
  532. axisLine: { // 设置雷达图中间射线的颜色
  533. lineStyle: {
  534. color: '#c0c0c0',
  535. },
  536. },
  537. splitLine: { //网格颜色设置
  538. show: true,
  539. lineStyle: {
  540. width: 1,
  541. color: '#1e83e4',
  542. },
  543. },
  544. splitArea: { //设置图表颜色,show的值为true
  545. show: false,
  546. areaStyle: {
  547. // color:"#c1ddf8", //一般设置方式
  548. //设置渐变背景色 new echarts.graphic.LinearGradient(a,b,c,d,arr)
  549. //a ,b,c,d值可为0,1 a:1表示arr中的颜色右到左;c:1 arr中的颜色左到右
  550. //b:1表示arr中的颜色下到上;d:1表示arr中的颜色上到下
  551. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  552. { offset: 0, color: '#c1ddf8' }, // 0% 处的颜色
  553. { offset: 1, color: '#1e83e4' }// 100% 处的颜色
  554. ], false)
  555. }
  556. }
  557. },
  558. series: [
  559. {
  560. name: '',
  561. type: 'radar',
  562. symbol: 'circle', // 单个数值点的样式,还可以取值'rect','angle'等
  563. symbolSize: 0, // 数值点的大小
  564. data: [
  565. {
  566. value: echart4[0],
  567. name: '类型1',
  568. itemStyle: { //该数值区域样式设置
  569. normal: {
  570. color: '#2CC6FF', //背景颜色,还需设置areaStyle
  571. lineStyle: {
  572. color: '#2CC6FF', //边框颜色
  573. },
  574. },
  575. },
  576. label: { //显示value中具体的数值
  577. normal: {
  578. show: false,
  579. textStyle: { //更改数值样式
  580. color: '#43EDE3'
  581. }
  582. },
  583. },
  584. areaStyle: { //设置区域背景颜色透明度
  585. normal: {
  586. width: 1,
  587. opacity: 0.8,
  588. },
  589. },
  590. },
  591. {
  592. value: echart4[1],
  593. name: '类型2',
  594. itemStyle: { //该数值区域样式设置
  595. normal: {
  596. color: '#D87AFF', //背景颜色,还需设置areaStyle
  597. lineStyle: {
  598. color: '#2CC6FF', //边框颜色
  599. },
  600. },
  601. },
  602. label: { //显示value中具体的数值
  603. normal: {
  604. show: false,
  605. textStyle: { //更改数值样式
  606. color: '#43EDE3'
  607. }
  608. },
  609. },
  610. areaStyle: { //设置区域背景颜色透明度
  611. normal: {
  612. width: 1,
  613. opacity: 0.8,
  614. },
  615. },
  616. }
  617. ]
  618. }
  619. ]
  620. };
  621. tools.loopShowTooltip(myChart, option, {
  622. interval: 2000,
  623. loopSeries: true,
  624. });
  625. myChart.setOption(option)
  626. },
  627. initChart5 () {
  628. let myChart = echarts.init(this.$refs['echart5'])
  629. let option = {
  630. tooltip: {
  631. formatter: data => {
  632. 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}亿`
  633. },
  634. trigger: 'axis',
  635. // axisPointer: {
  636. // type: 'cross',
  637. // },
  638. },
  639. grid: {
  640. top: '16%',
  641. right:'3%',
  642. left: '3%',
  643. bottom: '25%',
  644. },
  645. legend: {
  646. data: ["预算额", "合同额","结算额","支付额"],
  647. x:'center',
  648. y:'10px',
  649. textStyle: {
  650. color: 'rgba(250,250,250,0.6)',
  651. },
  652. },
  653. xAxis: {
  654. data: title.map(item=>item.name),
  655. axisLine: {
  656. show: true, //隐藏X轴轴线
  657. lineStyle: {
  658. color: '#005094',
  659. width: 1,
  660. },
  661. },
  662. axisTick: {
  663. show: false, //隐藏X轴刻度
  664. },
  665. axisLabel: {
  666. show: true,
  667. rotate: 40,
  668. textStyle: {
  669. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  670. },
  671. },
  672. },
  673. yAxis: [
  674. {
  675. type: 'value',
  676. name: '亿元',
  677. nameTextStyle: {
  678. color: 'rgba(255,255,255,0.6)',
  679. },
  680. splitLine: {
  681. show: true,
  682. lineStyle: {
  683. color: '#68b4dd66',
  684. type: 'dashed',
  685. },
  686. },
  687. axisLine: {
  688. show: true,
  689. lineStyle: {
  690. color: '#3D7495',
  691. },
  692. },
  693. axisLabel: {
  694. show: true,
  695. textStyle: {
  696. color: 'rgba(250,250,250,0.6)',
  697. },
  698. },
  699. },
  700. ],
  701. series: [
  702. {
  703. name: '预算额',
  704. type: 'bar',
  705. barWidth: 10,
  706. itemStyle: {
  707. normal: {
  708. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  709. {
  710. offset: 0,
  711. color: '#69c0ff',
  712. },
  713. {
  714. offset: 1,
  715. color: '#082550',
  716. },
  717. ]),
  718. },
  719. },
  720. data: title.map(item=>item.value),
  721. },
  722. {
  723. name: '合同额',
  724. type: 'bar',
  725. barWidth: 10,
  726. itemStyle: {
  727. normal: {
  728. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  729. {
  730. offset: 0,
  731. color: '#957DFF',
  732. },
  733. {
  734. offset: 1,
  735. color: '#082550',
  736. },
  737. ]),
  738. },
  739. },
  740. data:title.map(item=>item.value2),
  741. },
  742. {
  743. name: '结算额',
  744. type: 'bar',
  745. barWidth: 10,
  746. itemStyle: {
  747. normal: {
  748. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  749. {
  750. offset: 0,
  751. color: '#957DFF',
  752. },
  753. {
  754. offset: 1,
  755. color: '#082550',
  756. },
  757. ]),
  758. },
  759. },
  760. data:title.map(item=>item.value3),
  761. },
  762. {
  763. name: '支付额',
  764. type: 'bar',
  765. barWidth: 10,
  766. itemStyle: {
  767. normal: {
  768. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  769. {
  770. offset: 0,
  771. color: '#957DFF',
  772. },
  773. {
  774. offset: 1,
  775. color: '#082550',
  776. },
  777. ]),
  778. },
  779. },
  780. data:title.map(item=>item.value4),
  781. },
  782. ],
  783. }
  784. myChart.setOption(option)
  785. tools.loopShowTooltip(myChart, option, {
  786. nterval: 2000,
  787. loopSeries: true,
  788. })
  789. },
  790. },
  791. })