investHome5.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. echart1Fd: true,
  6. echart2Fd: true,
  7. echart3Fd: true,
  8. echarts1Time: 16000,
  9. titleList: [
  10. { name: '初步设计', type: 1, number: '106' },
  11. { name: '', type: 1, number: '' },
  12. { name: '详细设计', type: 1, number: '103' },
  13. { name: '', type: 1, number: '' },
  14. { name: '施工', type: 1, number: '62' },
  15. { name: '', type: 1, number: '' },
  16. { name: '完工', type: 1, number: '35' },
  17. { name: '', type: 1, number: '' },
  18. { name: '验收', type: 2, number: '42' },
  19. { name: '', type: 1, number: '' },
  20. { name: '结算', type: 1, number: '33' }
  21. ],
  22. centerLeftList: [
  23. { name: '正偏差', value: '160', value2: '500' },
  24. { name: '容差内', value: '28', value2: '264' },
  25. { name: '负偏差', value: '103', value2: '182' }
  26. ],
  27. time: '',
  28. timer: '',
  29. }
  30. },
  31. created () {
  32. this.time = formatDate()
  33. this.timer = setInterval(() => {
  34. this.time = formatDate()
  35. })
  36. },
  37. beforeDestroy () {
  38. if (this.timer) {
  39. clearInterval(this.timer);
  40. }
  41. },
  42. mounted () {
  43. setTimeout(() => {
  44. this.initChart1()
  45. this.initChart2()
  46. this.initChart3()
  47. this.initChart4()
  48. this.initChart5()
  49. })
  50. },
  51. methods: {
  52. initChart1 () {
  53. let that = this
  54. let myChart = echarts.init(this.$refs['echart1'])
  55. myChart.on('showTip', (params) => {
  56. // 如果是7或者15并且满足防抖则切换
  57. if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart1Fd) {
  58. that.echart1Fd = false
  59. setTimeout(() => {
  60. option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
  61. option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
  62. myChart.setOption(option);
  63. // 防止勿刷新做的防抖
  64. setTimeout(() => {
  65. that.echart1Fd = true
  66. }, 2000)
  67. }, 1900);
  68. // 如果是17表示到了最后一个,那么重新来一遍
  69. } else if (params.dataIndex == 17 && that.echart1Fd) {
  70. that.echart1Fd = false
  71. setTimeout(() => {
  72. option.dataZoom[0].endValue = 0
  73. option.dataZoom[0].startValue = 5
  74. myChart.setOption(option);
  75. // 防止勿刷新做的防抖
  76. setTimeout(() => {
  77. that.echart1Fd = true
  78. }, 2000)
  79. }, 1900)
  80. }
  81. })
  82. let option = {
  83. tooltip: {
  84. formatter: data => {
  85. 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}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[3].color.colorStops[0].color}"></span> ${data[3].seriesName}:${data[3].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[4].color.colorStops[0].color}"></span> ${data[4].seriesName}:${data[4].value}亿`
  86. },
  87. trigger: 'axis',
  88. axisPointer: {
  89. type: 'cross',
  90. },
  91. },
  92. dataZoom: [
  93. {
  94. // start: 9,//默认为@
  95. // end: 100,//黑认认为1@0
  96. type: "slider",
  97. show: false,
  98. // xAxisIndex: [0]
  99. handlesize: 0,//滑动条的 左右2个滑动条的大小
  100. startValue: 5,// 初始显示值
  101. endValue: 0,// 结束显示值
  102. height: 10,//组件高度
  103. left: "5%",
  104. right: "4%",//右边的距离
  105. bottom: "25%",//底边的距离
  106. borderColor: "#939",
  107. fillerColor: "#269cdb",
  108. borderRadius: 5,
  109. backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
  110. showDataShadow: false,//是否显示数据阴影
  111. showDetail: false,//即拖拽时候是否显示详细数值信息
  112. truerealtime: true,//是否实时更新
  113. filterMode: "filter"
  114. }, {
  115. type: 'inside',
  116. show: true,
  117. start: 1,
  118. end: 100
  119. }
  120. ],
  121. grid: {
  122. top: '10%',
  123. right: '3%',
  124. left: '5%',
  125. bottom: '10%',
  126. },
  127. legend: {
  128. data: ["预算额", "已签合同额", '产值认定额', '结算额', '付款额'],
  129. x: 'center',
  130. y: '20px',
  131. textStyle: {
  132. color: 'rgba(250,250,250,0.6)',
  133. },
  134. },
  135. xAxis: {
  136. data: echart1.map(item => item.name),
  137. axisLine: {
  138. show: true, //隐藏X轴轴线
  139. lineStyle: {
  140. color: '#005094',
  141. width: 1,
  142. },
  143. },
  144. axisTick: {
  145. show: false, //隐藏X轴刻度
  146. },
  147. axisLabel: {
  148. show: true,
  149. // rotate: 40,
  150. textStyle: {
  151. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  152. },
  153. },
  154. },
  155. yAxis: [
  156. {
  157. type: 'value',
  158. name: '亿元',
  159. nameTextStyle: {
  160. color: 'rgba(255,255,255,0.6)',
  161. },
  162. splitLine: {
  163. show: true,
  164. lineStyle: {
  165. color: '#68b4dd66',
  166. type: 'dashed',
  167. },
  168. },
  169. axisLine: {
  170. show: true,
  171. lineStyle: {
  172. color: '#3D7495',
  173. },
  174. },
  175. axisLabel: {
  176. show: true,
  177. textStyle: {
  178. color: 'rgba(250,250,250,0.6)',
  179. },
  180. },
  181. },
  182. ],
  183. series: [
  184. {
  185. name: '预算额',
  186. type: 'bar',
  187. barWidth: 10,
  188. itemStyle: {
  189. normal: {
  190. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  191. {
  192. offset: 0,
  193. color: '#71D5FF',
  194. },
  195. {
  196. offset: 1,
  197. color: '#082550',
  198. },
  199. ]),
  200. },
  201. },
  202. data: echart1.map(item => item.value),
  203. },
  204. {
  205. name: '已签合同额',
  206. type: 'bar',
  207. barWidth: 10,
  208. itemStyle: {
  209. normal: {
  210. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  211. {
  212. offset: 0,
  213. color: '#4D6FF6',
  214. },
  215. {
  216. offset: 1,
  217. color: '#082550',
  218. },
  219. ]),
  220. },
  221. },
  222. data: echart1.map(item => item.value2),
  223. },
  224. {
  225. name: '产值认定额',
  226. type: 'bar',
  227. barWidth: 10,
  228. itemStyle: {
  229. normal: {
  230. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  231. {
  232. offset: 0,
  233. color: '#877CFC',
  234. },
  235. {
  236. offset: 1,
  237. color: '#082550',
  238. },
  239. ]),
  240. },
  241. },
  242. data: echart1.map(item => item.value),
  243. },
  244. {
  245. name: '结算额',
  246. type: 'bar',
  247. barWidth: 10,
  248. itemStyle: {
  249. normal: {
  250. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  251. {
  252. offset: 0,
  253. color: '#52BF80',
  254. },
  255. {
  256. offset: 1,
  257. color: '#082550',
  258. },
  259. ]),
  260. },
  261. },
  262. data: echart1.map(item => item.value2),
  263. },
  264. {
  265. name: '付款额',
  266. type: 'bar',
  267. barWidth: 10,
  268. itemStyle: {
  269. normal: {
  270. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  271. {
  272. offset: 0,
  273. color: '#CADD62',
  274. },
  275. {
  276. offset: 1,
  277. color: '#082550',
  278. },
  279. ]),
  280. },
  281. },
  282. data: echart1.map(item => item.value),
  283. },
  284. ],
  285. }
  286. myChart.setOption(option)
  287. tools.loopShowTooltip(myChart, option, {
  288. interval: 2000,
  289. loopSeries: true,
  290. })
  291. },
  292. initChart2 () {
  293. let that = this
  294. const itemStyle = {
  295. // opacity: 0.8,
  296. shadowBlur: 10,
  297. shadowOffsetX: 0,
  298. shadowOffsetY: 0,
  299. shadowColor: 'rgba(0,0,0,0.3)'
  300. };
  301. let myChart = echarts.init(this.$refs['echart2'])
  302. myChart.on('showTip', (params) => {
  303. // 如果是7或者15并且满足防抖则切换
  304. if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart2Fd) {
  305. that.echart2Fd = false
  306. setTimeout(() => {
  307. option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
  308. option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
  309. myChart.setOption(option);
  310. // 防止勿刷新做的防抖
  311. setTimeout(() => {
  312. that.echart2Fd = true
  313. }, 2000)
  314. }, 1900);
  315. // 如果是17表示到了最后一个,那么重新来一遍
  316. } else if (params.dataIndex == 17 && that.echart2Fd) {
  317. that.echart2Fd = false
  318. setTimeout(() => {
  319. option.dataZoom[0].endValue = 0
  320. option.dataZoom[0].startValue = 5
  321. myChart.setOption(option);
  322. // 防止勿刷新做的防抖
  323. setTimeout(() => {
  324. that.echart2Fd = true
  325. }, 2000)
  326. }, 1900)
  327. }
  328. })
  329. let option = {
  330. color: ['#80F1BE', '#fec42c', '#dd4444'],
  331. title: {
  332. textStyle: {
  333. color: '#69C0FF',
  334. fontSize: 16,
  335. fontWeight: 500
  336. },
  337. top: '10',
  338. left: '10'
  339. },
  340. dataZoom: [
  341. {
  342. // start: 9,//默认为@
  343. // end: 100,//黑认认为1@0
  344. type: "slider",
  345. show: false,
  346. // xAxisIndex: [0]
  347. handlesize: 0,//滑动条的 左右2个滑动条的大小
  348. startValue: 5,// 初始显示值
  349. endValue: 0,// 结束显示值
  350. height: 10,//组件高度
  351. left: "5%",
  352. right: "4%",//右边的距离
  353. bottom: "25%",//底边的距离
  354. borderColor: "#939",
  355. fillerColor: "#269cdb",
  356. borderRadius: 5,
  357. backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
  358. showDataShadow: false,//是否显示数据阴影
  359. showDetail: false,//即拖拽时候是否显示详细数值信息
  360. truerealtime: true,//是否实时更新
  361. filterMode: "filter"
  362. }, {
  363. type: 'inside',
  364. show: true,
  365. start: 1,
  366. end: 100
  367. }
  368. ],
  369. legend: {
  370. top: 10,
  371. data: ['正偏差', '容差', '负偏差'],
  372. textStyle: {
  373. fontSize: 12,
  374. color: '#fff'
  375. }
  376. },
  377. textStyle: {
  378. color: '#fff',
  379. },
  380. tooltip: {
  381. show: true,
  382. trigger: "axis",
  383. formatter: data => {
  384. return `${data[0].value[0]}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color}"></span> ${data[0].seriesName}:${data[0].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color}"></span> ${data[1].seriesName}:${data[1].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color}"></span> ${data[2].seriesName}:${data[2].data[1]}亿`
  385. },
  386. axisPointer: {
  387. type: 'cross',
  388. },
  389. // axisPointer: {
  390. // lineStyle: {
  391. // type: 'dashed',
  392. // width: 2,
  393. // color: 'rgba(255,255,255,0.6)'
  394. // },
  395. // animation: true
  396. // }
  397. },
  398. grid: {
  399. top: '10%',
  400. right: '4%',
  401. left: '5%',
  402. bottom: '10%',
  403. },
  404. yAxis: {
  405. name: '亿元',
  406. splitLine: {
  407. show: true,
  408. lineStyle: {
  409. color: '#68b4dd66',
  410. type: 'dashed',
  411. },
  412. },
  413. axisLine: {
  414. show: false
  415. },
  416. axisLabel: {
  417. show: true,
  418. formatter: '{value}',
  419. textStyle: {
  420. color: 'rgba(250,250,250,0.6)',
  421. },
  422. },
  423. nameTextStyle: {
  424. color: '#fff',
  425. fontSize: 10,
  426. },
  427. },
  428. xAxis: {
  429. data: echart2[0].map(item => item[0]),
  430. axisLine: {
  431. show: true, //隐藏X轴轴线
  432. lineStyle: {
  433. color: '#005094',
  434. width: 1,
  435. },
  436. },
  437. splitLine: {
  438. show: true,
  439. lineStyle: {
  440. color: '#68b4dd66',
  441. type: 'dashed',
  442. },
  443. },
  444. axisTick: {
  445. show: false, //隐藏X轴刻度
  446. },
  447. axisLabel: {
  448. show: true,
  449. // rotate: 40,
  450. padding: [0,0 , 0, 0],
  451. textStyle: {
  452. color: '#fff', //X轴文字颜色
  453. fontSize: 12,
  454. },
  455. },
  456. },
  457. series: [
  458. {
  459. name: '正偏差',
  460. type: 'scatter',
  461. itemStyle: itemStyle,
  462. data: echart2[0],
  463. symbolSize: function (data) {
  464. return Math.sqrt(data[1]) * 4;
  465. },
  466. },
  467. {
  468. name: '容差',
  469. type: 'scatter',
  470. itemStyle: itemStyle,
  471. data: echart2[1],
  472. symbolSize: function (data) {
  473. return Math.sqrt(data[1]) * 4;
  474. },
  475. },
  476. {
  477. name: '负偏差',
  478. type: 'scatter',
  479. itemStyle: itemStyle,
  480. data: echart2[2],
  481. symbolSize: function (data) {
  482. return Math.sqrt(data[1]) * 4;
  483. },
  484. }
  485. ]
  486. }
  487. myChart.setOption(option)
  488. tools.loopShowTooltip(myChart, option, {
  489. interval: 2000,
  490. loopSeries: true,
  491. })
  492. },
  493. initChart3 () {
  494. let that = this
  495. let myChart = echarts.init(this.$refs['echart3'])
  496. myChart.on('showTip', (params) => {
  497. // 如果是7或者15并且满足防抖则切换
  498. if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart3Fd) {
  499. that.echart3Fd = false
  500. setTimeout(() => {
  501. option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
  502. option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
  503. myChart.setOption(option);
  504. // 防止勿刷新做的防抖
  505. setTimeout(() => {
  506. that.echart3Fd = true
  507. }, 2000)
  508. }, 1900);
  509. // 如果是17表示到了最后一个,那么重新来一遍
  510. } else if (params.dataIndex == 17 && that.echart3Fd) {
  511. that.echart3Fd = false
  512. setTimeout(() => {
  513. option.dataZoom[0].endValue = 0
  514. option.dataZoom[0].startValue = 5
  515. myChart.setOption(option);
  516. // 防止勿刷新做的防抖
  517. setTimeout(() => {
  518. that.echart3Fd = true
  519. }, 2000)
  520. }, 1900)
  521. }
  522. })
  523. let option = {
  524. tooltip: {
  525. formatter: data => {
  526. 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}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿`
  527. },
  528. trigger: 'axis',
  529. axisPointer: {
  530. type: 'cross',
  531. },
  532. position: (params) => {
  533. return [params[0] + 10, 30]
  534. },
  535. },
  536. dataZoom: [
  537. {
  538. // start: 9,//默认为@
  539. // end: 100,//黑认认为1@0
  540. type: "slider",
  541. show: false,
  542. // xAxisIndex: [0]
  543. handlesize: 0,//滑动条的 左右2个滑动条的大小
  544. startValue: 5,// 初始显示值
  545. endValue: 0,// 结束显示值
  546. height: 10,//组件高度
  547. left: "5%",
  548. right: "4%",//右边的距离
  549. bottom: "25%",//底边的距离
  550. borderColor: "#939",
  551. fillerColor: "#269cdb",
  552. borderRadius: 5,
  553. backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
  554. showDataShadow: false,//是否显示数据阴影
  555. showDetail: false,//即拖拽时候是否显示详细数值信息
  556. truerealtime: true,//是否实时更新
  557. filterMode: "filter"
  558. }, {
  559. type: 'inside',
  560. show: true,
  561. start: 1,
  562. end: 100
  563. }
  564. ],
  565. grid: {
  566. top: '10%',
  567. right: '3%',
  568. left: '10%',
  569. bottom: '10%',
  570. },
  571. legend: {
  572. data: ["高风险", "中风险", '低风险'],
  573. x: 'center',
  574. y: '5px',
  575. textStyle: {
  576. color: 'rgba(250,250,250,0.6)',
  577. },
  578. },
  579. xAxis: {
  580. data: echart1.map(item => item.name),
  581. axisLine: {
  582. show: true, //隐藏X轴轴线
  583. lineStyle: {
  584. color: '#005094',
  585. width: 1,
  586. },
  587. },
  588. axisTick: {
  589. show: false, //隐藏X轴刻度
  590. },
  591. axisLabel: {
  592. show: true,
  593. rotate: 40,
  594. textStyle: {
  595. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  596. },
  597. },
  598. },
  599. yAxis: [
  600. {
  601. type: 'value',
  602. name: '亿元',
  603. nameTextStyle: {
  604. color: 'rgba(255,255,255,0.6)',
  605. },
  606. splitLine: {
  607. show: true,
  608. lineStyle: {
  609. color: '#68b4dd66',
  610. type: 'dashed',
  611. },
  612. },
  613. axisLine: {
  614. show: true,
  615. lineStyle: {
  616. color: '#3D7495',
  617. },
  618. },
  619. axisLabel: {
  620. show: true,
  621. textStyle: {
  622. color: 'rgba(250,250,250,0.6)',
  623. },
  624. },
  625. },
  626. ],
  627. series: [
  628. {
  629. name: '高风险',
  630. type: 'bar',
  631. stack: 'Ad',
  632. barWidth: 10,
  633. itemStyle: {
  634. normal: {
  635. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  636. {
  637. offset: 0,
  638. color: '#CADD62',
  639. },
  640. {
  641. offset: 1,
  642. color: '#082550',
  643. },
  644. ]),
  645. },
  646. },
  647. data: echart3.map(item => item.value),
  648. },
  649. {
  650. name: '中风险',
  651. type: 'bar',
  652. stack: 'Ad',
  653. barWidth: 10,
  654. itemStyle: {
  655. normal: {
  656. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  657. {
  658. offset: 0,
  659. color: '#4D6FF6',
  660. },
  661. {
  662. offset: 1,
  663. color: '#082550',
  664. },
  665. ]),
  666. },
  667. },
  668. data: echart3.map(item => item.value2),
  669. },
  670. {
  671. name: '低风险',
  672. type: 'bar',
  673. stack: 'Ad',
  674. barWidth: 10,
  675. itemStyle: {
  676. normal: {
  677. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  678. {
  679. offset: 0,
  680. color: '#52BF80',
  681. },
  682. {
  683. offset: 1,
  684. color: '#082550',
  685. },
  686. ]),
  687. },
  688. },
  689. data: echart3.map(item => item.value3),
  690. },
  691. ],
  692. }
  693. myChart.setOption(option)
  694. tools.loopShowTooltip(myChart, option, {
  695. interval: 2000,
  696. loopSeries: true,
  697. })
  698. },
  699. initChart4 () {
  700. let myChart = echarts.init(this.$refs['echart4'])
  701. option = {
  702. title: {
  703. text: ''
  704. },
  705. // legend: {
  706. // data: ['安全风险', '付款风险', '合同风险', '结算风险', '进度风险', '质量风险'],
  707. // textStyle: {
  708. // color: '#9DB9EB',
  709. // },
  710. // top: 'center',
  711. // right:'50',
  712. // orient: 'vertical', // vertical 竖着
  713. // },
  714. radar: {
  715. // shape: 'circle',
  716. center: ['50%', '50%'],
  717. radius: 175,
  718. indicator: [
  719. { name: '安全风险', max: 100000 },
  720. { name: '付款风险', max: 100000 },
  721. { name: '合同风险', max: 100000 },
  722. { name: '结算风险', max: 100000 },
  723. { name: '进度风险', max: 100000 },
  724. { name: '质量风险', max: 100000 },
  725. ],
  726. axisLine: { // 设置雷达图中间射线的颜色
  727. lineStyle: {
  728. color: '#887d33',
  729. },
  730. },
  731. splitLine: { //网格颜色设置
  732. show: true,
  733. lineStyle: {
  734. width: 1,
  735. color: ['#871b1a', '#638f41', '#d29e35', '#b6802b']
  736. // color: '#000',
  737. // color:(color)=>{
  738. // console.log(color,'??????')
  739. // }
  740. },
  741. },
  742. name: { //修改indicator文字的颜色
  743. textStyle: {
  744. color: "#fff"
  745. }
  746. },
  747. splitNumber: 4, //有几个圈
  748. splitArea: { //设置图表颜色,show的值为true
  749. show: true,
  750. areaStyle: {
  751. // color:"#c1ddf8", //一般设置方式
  752. //设置渐变背景色 new echarts.graphic.LinearGradient(a,b,c,d,arr)
  753. //a ,b,c,d值可为0,1 a:1表示arr中的颜色右到左;c:1 arr中的颜色左到右
  754. //b:1表示arr中的颜色下到上;d:1表示arr中的颜色上到下
  755. // color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  756. // { offset: 0, color: '#887D33' }, // 0% 处的颜色
  757. // { offset: 0.75, color: '#7D4216' }, // 0% 处的颜色
  758. // { offset: 1, color: '#430705' }// 100% 处的颜色
  759. // ], false)
  760. color: ['#638f41', '#887d33', '#7d4216', '#430705'],
  761. }
  762. }
  763. },
  764. series: [
  765. {
  766. name: '',
  767. type: 'radar',
  768. symbol: 'circle', // 单个数值点的样式,还可以取值'rect','angle'等
  769. symbolSize: 0, // 数值点的大小
  770. data: [
  771. {
  772. value: echart4[0],
  773. name: '安全风险',
  774. itemStyle: { //该数值区域样式设置
  775. normal: {
  776. color: 'rgb(44,198,255,0.8)', //背景颜色,还需设置areaStyle
  777. lineStyle: {
  778. color: 'rgb(44,198,255,0.8)', //边框颜色
  779. },
  780. },
  781. },
  782. label: { //显示value中具体的数值
  783. normal: {
  784. show: false,
  785. textStyle: { //更改数值样式
  786. color: '#43EDE3'
  787. }
  788. },
  789. },
  790. areaStyle: { //设置区域背景颜色透明度
  791. normal: {
  792. width: 1,
  793. opacity: 0.8,
  794. },
  795. },
  796. }
  797. ]
  798. }
  799. ]
  800. };
  801. tools.loopShowTooltip(myChart, option, {
  802. interval: 2000,
  803. loopSeries: true,
  804. });
  805. myChart.setOption(option)
  806. },
  807. initChart5 () {
  808. let myChart = echarts.init(this.$refs['echart5'])
  809. let option = {
  810. tooltip: {
  811. formatter: data => {
  812. 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}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[3].color.colorStops[0].color}"></span> ${data[3].seriesName}:${data[3].value}亿`
  813. },
  814. trigger: 'axis',
  815. axisPointer: {
  816. type: 'cross',
  817. }
  818. },
  819. grid: {
  820. top: '10%',
  821. right: '3%',
  822. left: '5%',
  823. bottom: '20',
  824. },
  825. legend: {
  826. data: ["预算额", "合同额", "结算额", "支付额"],
  827. x: 'center',
  828. y: '0px',
  829. textStyle: {
  830. color: 'rgba(250,250,250,0.6)',
  831. },
  832. },
  833. xAxis: {
  834. data: ['设备费','设计费','施工费','材料费'],
  835. axisLine: {
  836. show: true, //隐藏X轴轴线
  837. lineStyle: {
  838. color: '#005094',
  839. width: 1,
  840. },
  841. },
  842. axisTick: {
  843. show: false, //隐藏X轴刻度
  844. },
  845. axisLabel: {
  846. show: true,
  847. // rotate: 40,
  848. textStyle: {
  849. color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
  850. },
  851. },
  852. },
  853. yAxis: [
  854. {
  855. type: 'value',
  856. name: '亿元',
  857. nameTextStyle: {
  858. color: 'rgba(255,255,255,0.6)',
  859. },
  860. splitLine: {
  861. show: true,
  862. lineStyle: {
  863. color: '#68b4dd66',
  864. type: 'dashed',
  865. },
  866. },
  867. axisLine: {
  868. show: true,
  869. lineStyle: {
  870. color: '#3D7495',
  871. },
  872. },
  873. axisLabel: {
  874. show: true,
  875. textStyle: {
  876. color: 'rgba(250,250,250,0.6)',
  877. },
  878. },
  879. },
  880. ],
  881. series: [
  882. {
  883. name: '预算额',
  884. type: 'bar',
  885. barWidth: 10,
  886. itemStyle: {
  887. normal: {
  888. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  889. {
  890. offset: 0,
  891. color: '#71D5FF',
  892. },
  893. {
  894. offset: 1,
  895. color: '#082550',
  896. },
  897. ]),
  898. },
  899. },
  900. data: echart5.map(item => item.value),
  901. },
  902. {
  903. name: '合同额',
  904. type: 'bar',
  905. barWidth: 10,
  906. itemStyle: {
  907. normal: {
  908. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  909. {
  910. offset: 0,
  911. color: '#4D6FF6',
  912. },
  913. {
  914. offset: 1,
  915. color: '#082550',
  916. },
  917. ]),
  918. },
  919. },
  920. data: echart5.map(item => item.value2),
  921. },
  922. {
  923. name: '结算额',
  924. type: 'bar',
  925. barWidth: 10,
  926. itemStyle: {
  927. normal: {
  928. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  929. {
  930. offset: 0,
  931. color: '#877CFC',
  932. },
  933. {
  934. offset: 1,
  935. color: '#082550',
  936. },
  937. ]),
  938. },
  939. },
  940. data: echart5.map(item => item.value3),
  941. },
  942. {
  943. name: '支付额',
  944. type: 'bar',
  945. barWidth: 10,
  946. itemStyle: {
  947. normal: {
  948. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  949. {
  950. offset: 0,
  951. color: '#52BF80',
  952. },
  953. {
  954. offset: 1,
  955. color: '#082550',
  956. },
  957. ]),
  958. },
  959. },
  960. data: echart5.map(item => item.value4),
  961. },
  962. ],
  963. }
  964. myChart.setOption(option)
  965. tools.loopShowTooltip(myChart, option, {
  966. interval: 2000,
  967. loopSeries: true,
  968. })
  969. },
  970. },
  971. })