diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/yztInfo/gyjj.vue b/src/components/economic/yztInfo/gyjj.vue index a7e0772..a3ff487 100644 --- a/src/components/economic/yztInfo/gyjj.vue +++ b/src/components/economic/yztInfo/gyjj.vue @@ -421,6 +421,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine1('chartsTwo',t.xAxis,t.value,t.value2); }).catch((err)=>{console.log(err)}); }, @@ -461,7 +462,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { @@ -550,7 +555,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/yztInfo/gyjj.vue b/src/components/economic/yztInfo/gyjj.vue index a7e0772..a3ff487 100644 --- a/src/components/economic/yztInfo/gyjj.vue +++ b/src/components/economic/yztInfo/gyjj.vue @@ -421,6 +421,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine1('chartsTwo',t.xAxis,t.value,t.value2); }).catch((err)=>{console.log(err)}); }, @@ -461,7 +462,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { @@ -550,7 +555,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/qyfz.vue b/src/components/economic/yztInfo/qyfz.vue index 5c11fe3..71e9461 100644 --- a/src/components/economic/yztInfo/qyfz.vue +++ b/src/components/economic/yztInfo/qyfz.vue @@ -427,8 +427,8 @@ let vm = this; // 假数据 let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartsOne',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/qyfzCharts/qyfz',{params:{}}).then(function (resp) { @@ -494,7 +494,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/yztInfo/gyjj.vue b/src/components/economic/yztInfo/gyjj.vue index a7e0772..a3ff487 100644 --- a/src/components/economic/yztInfo/gyjj.vue +++ b/src/components/economic/yztInfo/gyjj.vue @@ -421,6 +421,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine1('chartsTwo',t.xAxis,t.value,t.value2); }).catch((err)=>{console.log(err)}); }, @@ -461,7 +462,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { @@ -550,7 +555,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/qyfz.vue b/src/components/economic/yztInfo/qyfz.vue index 5c11fe3..71e9461 100644 --- a/src/components/economic/yztInfo/qyfz.vue +++ b/src/components/economic/yztInfo/qyfz.vue @@ -427,8 +427,8 @@ let vm = this; // 假数据 let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartsOne',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/qyfzCharts/qyfz',{params:{}}).then(function (resp) { @@ -494,7 +494,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zdcy.vue b/src/components/economic/yztInfo/zdcy.vue index f07e24b..d166ffb 100644 --- a/src/components/economic/yztInfo/zdcy.vue +++ b/src/components/economic/yztInfo/zdcy.vue @@ -458,6 +458,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartsTwo',t.xAxis,t.value,t.value2); }) }, @@ -524,7 +525,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/yztInfo/gyjj.vue b/src/components/economic/yztInfo/gyjj.vue index a7e0772..a3ff487 100644 --- a/src/components/economic/yztInfo/gyjj.vue +++ b/src/components/economic/yztInfo/gyjj.vue @@ -421,6 +421,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine1('chartsTwo',t.xAxis,t.value,t.value2); }).catch((err)=>{console.log(err)}); }, @@ -461,7 +462,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { @@ -550,7 +555,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/qyfz.vue b/src/components/economic/yztInfo/qyfz.vue index 5c11fe3..71e9461 100644 --- a/src/components/economic/yztInfo/qyfz.vue +++ b/src/components/economic/yztInfo/qyfz.vue @@ -427,8 +427,8 @@ let vm = this; // 假数据 let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartsOne',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/qyfzCharts/qyfz',{params:{}}).then(function (resp) { @@ -494,7 +494,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zdcy.vue b/src/components/economic/yztInfo/zdcy.vue index f07e24b..d166ffb 100644 --- a/src/components/economic/yztInfo/zdcy.vue +++ b/src/components/economic/yztInfo/zdcy.vue @@ -458,6 +458,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartsTwo',t.xAxis,t.value,t.value2); }) }, @@ -524,7 +525,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zhnh.vue b/src/components/economic/yztInfo/zhnh.vue index 78fa867..f84c0cd 100644 --- a/src/components/economic/yztInfo/zhnh.vue +++ b/src/components/economic/yztInfo/zhnh.vue @@ -511,9 +511,9 @@ } // 假数据 const mockData = { - "xAxis":["新能源新材料","生物医药","电子信息","金属加工","轻工制造","化工","其他","陶瓷","纺织"], - "value":[0,0,0,0,0,0,0,0,0], - "value2":[0,0,0,0,0,0,0,0,0] + "xAxis":["新能源新材料","生物医药","电子信息","其他"], + "value":[0,0,0,0], + "value2":[0,0,0,0] } vm.drawLine('chartsOne',mockData.xAxis,mockData.value,mockData.value2,[0, 0, -5,30]); // 真实后台请求,隐藏 @@ -715,7 +715,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/subject/gdzctz.vue b/src/components/economic/subject/gdzctz.vue index 9b16f13..82e1282 100644 --- a/src/components/economic/subject/gdzctz.vue +++ b/src/components/economic/subject/gdzctz.vue @@ -255,7 +255,10 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jck.vue b/src/components/economic/subject/jck.vue index b3a0d33..8209c05 100644 --- a/src/components/economic/subject/jck.vue +++ b/src/components/economic/subject/jck.vue @@ -263,6 +263,7 @@ let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = _data.data + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -438,7 +439,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/jjyx.vue b/src/components/economic/subject/jjyx.vue index d102b33..fbfb114 100644 --- a/src/components/economic/subject/jjyx.vue +++ b/src/components/economic/subject/jjyx.vue @@ -311,6 +311,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -489,7 +490,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyfz.vue b/src/components/economic/subject/qyfz.vue index b2ebdea..667799b 100644 --- a/src/components/economic/subject/qyfz.vue +++ b/src/components/economic/subject/qyfz.vue @@ -219,14 +219,15 @@ vm.$http.get('/dx-economy-api/subject/qyfz/times',{params:vm.filter}).then(function (resp) { let t = resp.data.data vm.chartsTitle.left='总产值(亿元)';vm.chartsTitle.right = '' + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartTwo',t.xAxis,t.value,null,t.value2); }) }, getThreeData(){ let vm = this; let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartThree',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/subject/qyfz/qyfz',{params:vm.filter}).then(function (resp) { @@ -254,7 +255,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { @@ -366,7 +371,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/qyrz.vue b/src/components/economic/subject/qyrz.vue index ba2e137..4491d51 100644 --- a/src/components/economic/subject/qyrz.vue +++ b/src/components/economic/subject/qyrz.vue @@ -264,6 +264,7 @@ let t = resp.data.data vm.chartsTitle.left = '融资额(亿元)'; vm.chartsTitle.right = '同比'; + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -327,7 +328,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -439,7 +451,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0, // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/subject/zdcy.vue b/src/components/economic/subject/zdcy.vue index a39fe3e..697634b 100644 --- a/src/components/economic/subject/zdcy.vue +++ b/src/components/economic/subject/zdcy.vue @@ -306,6 +306,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) @@ -483,7 +484,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + // rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/gdzctz.vue b/src/components/economic/yztInfo/gdzctz.vue index f9d5eb0..273875a 100644 --- a/src/components/economic/yztInfo/gdzctz.vue +++ b/src/components/economic/yztInfo/gdzctz.vue @@ -408,7 +408,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { @@ -420,16 +431,21 @@ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; + let text = '' if(value<1000){ texts.push(value) + text = value }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") + text = Math.ceil(value/1000) + "千" }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") + text = Math.ceil(value/10000) + "万" }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") + text =Math.ceil(value/1000000) + "百万" } - return value + return text }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} diff --git a/src/components/economic/yztInfo/gyjj.vue b/src/components/economic/yztInfo/gyjj.vue index a7e0772..a3ff487 100644 --- a/src/components/economic/yztInfo/gyjj.vue +++ b/src/components/economic/yztInfo/gyjj.vue @@ -421,6 +421,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine1('chartsTwo',t.xAxis,t.value,t.value2); }).catch((err)=>{console.log(err)}); }, @@ -461,7 +462,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { @@ -550,7 +555,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/qyfz.vue b/src/components/economic/yztInfo/qyfz.vue index 5c11fe3..71e9461 100644 --- a/src/components/economic/yztInfo/qyfz.vue +++ b/src/components/economic/yztInfo/qyfz.vue @@ -427,8 +427,8 @@ let vm = this; // 假数据 let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.drawLine('chartsOne',t.xAxis,t.value,null,null); // vm.$http.get('/dx-economy-api/qyfzCharts/qyfz',{params:{}}).then(function (resp) { @@ -494,7 +494,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zdcy.vue b/src/components/economic/yztInfo/zdcy.vue index f07e24b..d166ffb 100644 --- a/src/components/economic/yztInfo/zdcy.vue +++ b/src/components/economic/yztInfo/zdcy.vue @@ -458,6 +458,7 @@ if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } + t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLine('chartsTwo',t.xAxis,t.value,t.value2); }) }, @@ -524,7 +525,11 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0 // 标签倾斜的角度 + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zhnh.vue b/src/components/economic/yztInfo/zhnh.vue index 78fa867..f84c0cd 100644 --- a/src/components/economic/yztInfo/zhnh.vue +++ b/src/components/economic/yztInfo/zhnh.vue @@ -511,9 +511,9 @@ } // 假数据 const mockData = { - "xAxis":["新能源新材料","生物医药","电子信息","金属加工","轻工制造","化工","其他","陶瓷","纺织"], - "value":[0,0,0,0,0,0,0,0,0], - "value2":[0,0,0,0,0,0,0,0,0] + "xAxis":["新能源新材料","生物医药","电子信息","其他"], + "value":[0,0,0,0], + "value2":[0,0,0,0] } vm.drawLine('chartsOne',mockData.xAxis,mockData.value,mockData.value2,[0, 0, -5,30]); // 真实后台请求,隐藏 @@ -715,7 +715,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ { diff --git a/src/components/economic/yztInfo/zhyx.vue b/src/components/economic/yztInfo/zhyx.vue index 72f3190..dd16ae6 100644 --- a/src/components/economic/yztInfo/zhyx.vue +++ b/src/components/economic/yztInfo/zhyx.vue @@ -453,6 +453,21 @@ } vm.$http.get('/dx-economy-api/zhyxCharts/czhy',{params:vm.filter}).then(function (resp) { let t = resp.data.data + console.log('czhy') + console.log(t) + console.log('=========') + // 排序 + let temp = [] + const tlength = t.xAxis.length + for(let i=0;i0){ + temp.push({'x':t.xAxis[i],'value':t.value[i]}) + } + } + // 对temp进行排序 + // temp = temp.sort((a,b)=>a.value-b.value) + t.xAxis = temp.map(item=>item.x).reverse() + t.value = temp.map(item=>item.value).reverse() vm.drawBar('chartsOne',t.xAxis,t.value); }).catch((err)=>{console.log(err)}); }, @@ -469,8 +484,8 @@ } // 假数据 let t = { - xAxis:["工业企业", "规上企业", "上市公司","高新技术企业"], - value:[360, 126, 2,69] + xAxis:["拟上市企业", "规上企业", "上市公司","高新技术企业"], + value:[2, 126, 2,69] } vm.chartsTitle.left = '企业数(家)';vm.chartsTitle.right = ''; vm.drawLine('chartsTwo',t.xAxis,t.value,null,null); @@ -587,7 +602,18 @@ xAxis: { type:"category", data: cate, - axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} + axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, + axisLabel: { + interval: 0, // 坐标轴刻度标签的显示间隔 + rotate: cate.length>5?40:0, // 标签倾斜的角度 + formatter: function(value) { + var res = value; + if(cate.length>5 && res.length > 3) { + res = res.substring(0, 2) + ".."; + } + return res; + }, + } }, yAxis:[ {