| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277 |
- 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 => {
- console.log(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],
- },
- {
- name: '容差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[1]
- },
- {
- name: '负偏差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[2]
- }
- ]
- }
- 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);
- },
- },
- })
|