| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285 |
- let app = new Vue({
- el: '#app',
- data () {
- return {
- timeOut1:'',
- timeOut2:'',
- timeOut3:'',
- titleList: [
- { name: '初步设计', type: 1, number: '106' },
- { name: '', type: 1, number: '' },
- { name: '详细设计', type: 1, number: '103' },
- { name: '', type: 1, number: '' },
- { name: '施工', type: 1, number: '62' },
- { name: '', type: 1, number: '' },
- { name: '完工', type: 1, number: '35' },
- { name: '', type: 1, number: '' },
- { name: '验收', type: 2, number: '42' },
- { name: '', type: 1, number: '' },
- { name: '结算', type: 1, number: '33' }
- ],
- centerLeftList: [
- { name: '正偏差', value: '160', value2: '500' },
- { name: '容差内', value: '28', value2: '264' },
- { name: '负偏差', value: '103', value2: '182' }
- ],
- time: '',
- timer: '',
- }
- },
- created () {
- this.time = formatDate()
- this.timer = setInterval(() => {
- this.time = formatDate()
- })
- },
- beforeDestroy () {
- if (this.timer) {
- clearInterval(this.timer);
- clearInterval(this.timeOut1);
- clearInterval(this.timeOut2);
- clearInterval(this.timeOut3);
- }
- },
- mounted () {
- setTimeout(() => {
- this.initChart1()
- this.initChart2()
- this.initChart3()
- this.initChart4()
- this.initChart5()
- })
- },
- methods: {
- initChart1 () {
- let myChart = echarts.init(this.$refs['echart1'])
- let option = {
- tooltip: {
- formatter: data => {
- 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}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- },
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 8,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- grid: {
- top: '16%',
- right: '3%',
- left: '5%',
- bottom: '15%',
- },
- legend: {
- data: ["预算额", "已签合同额", '产值认定额', '结算额', '结算额'],
- x: 'center',
- y: '20px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: echart1.map(item => item.name),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '预算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#71D5FF',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- {
- name: '已签合同额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value2),
- },
- {
- name: '产值认定额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#877CFC',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- {
- name: '结算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#52BF80',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value2),
- },
- {
- name: '付款额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#CADD62',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- let arr = echart1.map(item => item.value2)
- this.timeOut1 = setInterval(function () {
- let startValue = myChart.getModel().option.dataZoom[0].startValue;
- let endValue = myChart.getModel().option.dataZoom[0].endValue;
- let start = myChart.getModel().option.xAxis[0].data[startValue];//起始X轴
- let end = myChart.getModel().option.xAxis[0].data[endValue];//结束X轴
- // 每次向后滚动一个,最后一个从头开始。
- // console.log(option.dataZoom[0].endValue);
- if (option.dataZoom[0].endValue >= 9) {
- option.dataZoom[0].endValue = 8
- option.dataZoom[0].startValue = 0
- } else {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 9
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 9
- }
- // myChart.dispatchAction({
- // type: 'showTip',
- // seriesIndex: 0,
- // dataIndex: startValue +1,
- // });
- myChart.setOption(option);
- }, 18000);
- },
- initChart2 () {
- const itemStyle = {
- // opacity: 0.8,
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- shadowColor: 'rgba(0,0,0,0.3)'
- };
- let myChart = echarts.init(this.$refs['echart2'])
- let option = {
- color: ['#80F1BE', '#fec42c', '#dd4444'],
- title: {
- textStyle: {
- color: '#69C0FF',
- fontSize: 16,
- fontWeight: 500
- },
- top: '10',
- left: '10'
- },
- legend: {
- top: 10,
- data: ['正偏差', '容差', '负偏差'],
- textStyle: {
- fontSize: 12,
- color: '#fff'
- }
- },
- textStyle: {
- color: '#fff',
- },
- tooltip: {
- show: true,
- trigger: "axis",
- // formatter: function (params) {
- // 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] + '亿元';
- // return tip
- // },
- formatter: data => {
- 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]}亿`
- },
- axisPointer: {
- lineStyle: {
- type: 'dashed',
- width: 2,
- color: 'rgba(255,255,255,0.6)'
- },
- animation: true
- }
- },
- grid: {
- top: '15%',
- right: '5%',
- left: '6%',
- bottom: '15%',
- },
- yAxis: {
- name: '亿元',
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- formatter: '{value}',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- nameTextStyle: {
- color: '#fff',
- fontSize: 10,
- },
- },
- xAxis: {
- data: echart2[0].map(item => item[0]),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- rotate: 40,
- padding: [30, -15, 0, 0],
- textStyle: {
- color: '#fff', //X轴文字颜色
- fontSize: 12,
- },
- },
- },
- series: [
- {
- name: '正偏差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[0],
- symbolSize: function (data) {
- return Math.sqrt(data[1]) * 4;
- },
- },
- {
- name: '容差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[1],
- symbolSize: function (data) {
- return Math.sqrt(data[1])* 4;
- },
- },
- {
- name: '负偏差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[2],
- symbolSize: function (data) {
- return Math.sqrt(data[1])* 4;
- },
- }
- ]
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- nterval: 2000,
- loopSeries: true,
- })
- },
- // let myChart = echarts.init(this.$refs['echart3'])
- // let option = {
- // tooltip: {
- // formatter: data => {
- // 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}亿`
- // },
- // trigger: 'axis',
- // // axisPointer: {
- // // type: 'cross',
- // // },
- // },
- // grid: {
- // top: '16%',
- // right: '3%',
- // left: '10%',
- // bottom: '25%',
- // },
- // legend: {
- // data: ["高风险", "中风险", '低风险'],
- // x: 'center',
- // y: '10px',
- // textStyle: {
- // color: 'rgba(250,250,250,0.6)',
- // },
- // },
- // xAxis: {
- // data: title.map(item => item.name),
- // axisLine: {
- // show: true, //隐藏X轴轴线
- // lineStyle: {
- // color: '#005094',
- // width: 1,
- // },
- // },
- // axisTick: {
- // show: false, //隐藏X轴刻度
- // },
- // axisLabel: {
- // show: true,
- // rotate: 40,
- // textStyle: {
- // color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- // },
- // },
- // },
- // yAxis: [
- // {
- // type: 'value',
- // name: '亿元',
- // nameTextStyle: {
- // color: 'rgba(255,255,255,0.6)',
- // },
- // splitLine: {
- // show: true,
- // lineStyle: {
- // color: '#68b4dd66',
- // type: 'dashed',
- // },
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: '#3D7495',
- // },
- // },
- // axisLabel: {
- // show: true,
- // textStyle: {
- // color: 'rgba(250,250,250,0.6)',
- // },
- // },
- // },
- // ],
- // series: [
- // {
- // name: '高风险',
- // type: 'bar',
- // barWidth: 5,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#69c0ff',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: echart3.map(item => item.value),
- // },
- // {
- // name: '中风险',
- // type: 'bar',
- // barWidth: 5,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#957DFF',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: echart3.map(item => item.value2),
- // },
- // {
- // name: '低风险',
- // type: 'bar',
- // barWidth: 5,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#957DFF',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: echart3.map(item => item.value3),
- // },
- // ],
- // }
- // myChart.setOption(option)
- // tools.loopShowTooltip(myChart, option, {
- // nterval: 2000,
- // loopSeries: true,
- // })
- // },
- initChart3 () {
- let myChart = echarts.init(this.$refs['echart3'])
- let option = {
- tooltip: {
- formatter: data => {
- 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}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- },
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 5,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- grid: {
- top: '20%',
- right: '3%',
- left: '10%',
- bottom: '28%',
- },
- legend: {
- data: ["高风险", "中风险", '低风险'],
- x: 'center',
- y: '0px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: echart1.map(item => item.name),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '高风险',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#71D5FF',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value),
- },
- {
- name: '中风险',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value2),
- },
- {
- name: '低风险',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#877CFC',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value3),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- let arr = echart1.map(item => item.value2)
- this.timeOut2 = setInterval(function () {
- let startValue = myChart.getModel().option.dataZoom[0].startValue;
- let endValue = myChart.getModel().option.dataZoom[0].endValue;
- let start = myChart.getModel().option.xAxis[0].data[startValue];//起始X轴
- let end = myChart.getModel().option.xAxis[0].data[endValue];//结束X轴
- // 每次向后滚动一个,最后一个从头开始。
- // console.log(option.dataZoom[0].endValue);
- if (option.dataZoom[0].endValue >= 12) {
- option.dataZoom[0].endValue = 5
- option.dataZoom[0].startValue = 0
- } else {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
- }
- // myChart.dispatchAction({
- // type: 'showTip',
- // seriesIndex: 0,
- // dataIndex: startValue +1,
- // });
- myChart.setOption(option);
- }, 12000);
- },
- initChart4 () {
- let myChart = echarts.init(this.$refs['echart4'])
- option = {
- title: {
- text: ''
- },
- legend: {
- data: ['类型1', '类型2', '类型3', '类型4', '类型5'],
- textStyle: {
- color: '#9DB9EB',
- },
- },
- splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
- show: true,
- areaStyle: { // 分隔区域的样式设置。
- color: ['yellow'],
- // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
- }
- },
- radar: {
- // shape: 'circle',
- center: ['50%', '60%'],
- radius: 40,
- indicator: [
- { name: '类型1', max: 100000 },
- { name: '类型2', max: 100000 },
- { name: '类型3', max: 100000 },
- { name: '类型4', max: 100000 },
- { name: '类型5', max: 100000 },
- ],
- axisLine: { // 设置雷达图中间射线的颜色
- lineStyle: {
- color: '#c0c0c0',
- },
- },
- splitLine: { //网格颜色设置
- show: true,
- lineStyle: {
- width: 1,
- color: '#1e83e4',
- },
- },
- splitArea: { //设置图表颜色,show的值为true
- show: false,
- areaStyle: {
- // color:"#c1ddf8", //一般设置方式
- //设置渐变背景色 new echarts.graphic.LinearGradient(a,b,c,d,arr)
- //a ,b,c,d值可为0,1 a:1表示arr中的颜色右到左;c:1 arr中的颜色左到右
- //b:1表示arr中的颜色下到上;d:1表示arr中的颜色上到下
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- { offset: 0, color: '#c1ddf8' }, // 0% 处的颜色
- { offset: 1, color: '#1e83e4' }// 100% 处的颜色
- ], false)
- }
- }
- },
- series: [
- {
- name: '',
- type: 'radar',
- symbol: 'circle', // 单个数值点的样式,还可以取值'rect','angle'等
- symbolSize: 0, // 数值点的大小
- data: [
- {
- value: echart4[0],
- name: '类型1',
- itemStyle: { //该数值区域样式设置
- normal: {
- color: '#2CC6FF', //背景颜色,还需设置areaStyle
- lineStyle: {
- color: '#2CC6FF', //边框颜色
- },
- },
- },
- label: { //显示value中具体的数值
- normal: {
- show: false,
- textStyle: { //更改数值样式
- color: '#43EDE3'
- }
- },
- },
- areaStyle: { //设置区域背景颜色透明度
- normal: {
- width: 1,
- opacity: 0.8,
- },
- },
- },
- {
- value: echart4[1],
- name: '类型2',
- itemStyle: { //该数值区域样式设置
- normal: {
- color: '#D87AFF', //背景颜色,还需设置areaStyle
- lineStyle: {
- color: '#2CC6FF', //边框颜色
- },
- },
- },
- label: { //显示value中具体的数值
- normal: {
- show: false,
- textStyle: { //更改数值样式
- color: '#43EDE3'
- }
- },
- },
- areaStyle: { //设置区域背景颜色透明度
- normal: {
- width: 1,
- opacity: 0.8,
- },
- },
- }
- ]
- }
- ]
- };
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- });
- myChart.setOption(option)
- },
- // initChart5 () {
- // let myChart = echarts.init(this.$refs['echart5'])
- // let option = {
- // tooltip: {
- // formatter: data => {
- // 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}亿`
- // },
- // trigger: 'axis',
- // // axisPointer: {
- // // type: 'cross',
- // // },
- // },
- // grid: {
- // top: '16%',
- // right: '3%',
- // left: '3%',
- // bottom: '25%',
- // },
- // legend: {
- // data: ["预算额", "合同额", "结算额", "支付额"],
- // x: 'center',
- // y: '10px',
- // textStyle: {
- // color: 'rgba(250,250,250,0.6)',
- // },
- // },
- // xAxis: {
- // data: title.map(item => item.name),
- // axisLine: {
- // show: true, //隐藏X轴轴线
- // lineStyle: {
- // color: '#005094',
- // width: 1,
- // },
- // },
- // axisTick: {
- // show: false, //隐藏X轴刻度
- // },
- // axisLabel: {
- // show: true,
- // rotate: 40,
- // textStyle: {
- // color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- // },
- // },
- // },
- // yAxis: [
- // {
- // type: 'value',
- // name: '亿元',
- // nameTextStyle: {
- // color: 'rgba(255,255,255,0.6)',
- // },
- // splitLine: {
- // show: true,
- // lineStyle: {
- // color: '#68b4dd66',
- // type: 'dashed',
- // },
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: '#3D7495',
- // },
- // },
- // axisLabel: {
- // show: true,
- // textStyle: {
- // color: 'rgba(250,250,250,0.6)',
- // },
- // },
- // },
- // ],
- // series: [
- // {
- // name: '预算额',
- // type: 'bar',
- // barWidth: 10,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#69c0ff',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: title.map(item => item.value),
- // },
- // {
- // name: '合同额',
- // type: 'bar',
- // barWidth: 10,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#957DFF',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: title.map(item => item.value2),
- // },
- // {
- // name: '结算额',
- // type: 'bar',
- // barWidth: 10,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#957DFF',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: title.map(item => item.value3),
- // },
- // {
- // name: '支付额',
- // type: 'bar',
- // barWidth: 10,
- // itemStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // {
- // offset: 0,
- // color: '#957DFF',
- // },
- // {
- // offset: 1,
- // color: '#082550',
- // },
- // ]),
- // },
- // },
- // data: title.map(item => item.value4),
- // },
- // ],
- // }
- // myChart.setOption(option)
- // tools.loopShowTooltip(myChart, option, {
- // nterval: 2000,
- // loopSeries: true,
- // })
- // },
- initChart5 () {
- let myChart = echarts.init(this.$refs['echart5'])
- let option = {
- tooltip: {
- formatter: data => {
- 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}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- },
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 8,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- grid: {
- top: '20%',
- right: '3%',
- left: '5%',
- bottom: '25%',
- },
- legend: {
- data: ["预算额", "合同额", "结算额", "支付额"],
- x: 'center',
- y: '0px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: echart1.map(item => item.name),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '预算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#71D5FF',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value),
- },
- {
- name: '合同额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value2),
- },
- {
- name: '结算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#877CFC',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value3),
- },
- {
- name: '支付额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#52BF80',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value4),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- let arr = echart1.map(item => item.value2)
- this.timeOut3 = setInterval(function () {
- let startValue = myChart.getModel().option.dataZoom[0].startValue;
- let endValue = myChart.getModel().option.dataZoom[0].endValue;
- let start = myChart.getModel().option.xAxis[0].data[startValue];//起始X轴
- let end = myChart.getModel().option.xAxis[0].data[endValue];//结束X轴
- // 每次向后滚动一个,最后一个从头开始。
- // console.log(option.dataZoom[0].endValue);
- if (option.dataZoom[0].endValue >= 9) {
- option.dataZoom[0].endValue = 8
- option.dataZoom[0].startValue = 0
- } else {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 9
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 9
- }
- // myChart.dispatchAction({
- // type: 'showTip',
- // seriesIndex: 0,
- // dataIndex: startValue +1,
- // });
- myChart.setOption(option);
- }, 18000);
- },
- },
- })
|