Commit 23c3bec4 authored by youjie's avatar youjie

no message

parent 130d1fa0
<template>
<div class="echartsBox">
<div class="titleBox text-center row">
<h3>各费用项收入占比变化趋势图</h3>
<h3>各费用项收入占比变化趋势图 %</h3>
<div style="margin-left: 20px;">
......@@ -26,9 +26,27 @@ export default {
MaoLiAnalysisData: [],
SJLLAnalysisData: [],
RoomAnalysisData: [],
CostAnalysisData: [],
colorList:['#089bab','#FFA171','#72b8ff','#ff9cc6','#7b78ff','#28cc90','#ee8fff','#5cf2ff','#ff9a00','#4fc4f7','#738eff','#b0edff',
'rgba(228,57,57,.9)','rgba(248,126,46,1)','rgba(252,196,34,.7)','#3DD948','#39CAE4','rgba(44,49,241,.6)','rgba(122,57,228,.5)','#E65FC1','#D0B478','#BABABA',
'rgba(228,57,57,.7)','rgba(247,154,44,.7)','rgba(255,246,11,.7)','rgba(61,217,72,.7)','rgba(57,202,228,.7)','rgba(44,49,241,.7)','rgba(122,57,228,.7)'],
CostDataObj: {
name: '',
type:'line',
showSymbol: true,
smooth: true,
symbolSize: 1,
data: [],
},
CostDatas: [],
incomeTitles:[
{Name: '机票/收入',value:'JiPiaoRate',ID:2},
{Name: '房费/收入',value:'RommFeeRate',ID:4},
{Name: '车费/收入',value:'CarFeeRate',ID:6},
{Name: '餐费/收入',value:'MealFeeRate',ID:8},
{Name: '门票/收入',value:'TicketFeeRate',ID:10},
{Name: '签证/收入',value:'VisaFeeRate',ID:12},
],
}
},
watch: {
......@@ -41,6 +59,7 @@ export default {
this.MaoLiAnalysisData = n.MaoLiAnalysisData
this.SJLLAnalysisData = n.SJLLAnalysisData
this.RoomAnalysisData = n.RoomAnalysisData
this.CostAnalysisData = n.CostAnalysisData
this.getEchart()
},
deep: true,
......@@ -52,111 +71,142 @@ export default {
},
methods: {
getEchart(){
this.inCostDatas()
let that = this
let titles = this.incomeTitles.map(x=>{return x.Name})
let datas = []
let titles = []
let Stocklegend = {}
let Newobj = {}
this.JapanSPData.forEach((x,indexs)=>{
let Name = `${x.Name.indexOf('率')==-1?x.Name:x.Name+'%'}`
titles.push(Name)
let obj = {
name: Name,
type: 'line',
showSymbol: true,
smooth: true,
symbolSize: 1,
data: x.MonthData // 绑定实时数据数组
}
datas.push(obj)
if(indexs>8){
let name=x.Name;
Newobj[name]=false;
}
Stocklegend=Newobj;
})
let chartDom = document.getElementById('PropMyEchart','light');
let Newobj={};
for(let index=0;index<this.incomeTitles.length;index++){
for(let i=0;i<this.MonthList.length;i++){
let filter = this.CostAnalysisData.filter(z=>{return z.Month==this.MonthList[i]})
if(filter){
this.CostDatas.forEach((x,indexs)=>{
if(indexs==0){
x.name = '机票/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['JiPiaoRate'])
})
}else if(indexs==1){
x.name = '房费/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['RoomFeeRate'])
})
}else if(indexs==3){
x.name = '车费/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['CarFeeRate'])
})
}else if(indexs==4){
x.name = '餐费/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['MealFeeRate'])
})
}else if(indexs==5){
x.name = '门票/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['TicketFeeRate'])
})
}else if(indexs==6){
x.name = '签证/收入'
this.CostAnalysisData.forEach(z=>{
x.data.push(z['VisaFeeRate'])
})
}
// if(indexs>4){
// let name=x.name;
// Newobj[name]=false;
// }
// Stocklegend=Newobj;
})
}
}
}
datas = this.CostDatas
let chartDom = document.getElementById('PropMyEchart');
let myChart = this.$echarts.init(chartDom);
let option
let option;
option = {
color:this.colorList,
legend: {
x:'left',
y:'bottom',
type:'scroll',
icon: "circle",
padding: [5, 30, 20, 30] ,
data: titles,
selected: Stocklegend
},
grid: {
color:that.colorList,
tooltip : {
trigger: 'axis',
axisPointer: {
lineStyle: {
type: 'dashed',
color: "#ddd"
}
}
},
legend: {
x:'left',
y:'bottom',
type:'scroll',
icon: "circle",
padding: [5, 30, 20, 30] ,
type:'scroll',
data: titles,
selected: Stocklegend
},
grid: {
left: 15, // 默认10%,给24就挺合适的。
top: 30, // 默认60
right: 45, // 默认10%
right: 15, // 默认10%
bottom: 70, // 默认60
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
nameTextStyle: {
fontWeight: 600,
fontSize: 18
},
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent"
}
},
axisLabel: {
textStyle: {
color: "#333333"
}
},
data: this.MonthList
},
yAxis : [
{
type : 'value',
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent",
width: 1,
}
},
axisLabel: {
textStyle: {
color: "#969696"
}
},
splitLine:{
show:true,
lineStyle:{
// type:'dashed'
color:'#EEEEEE',
xAxis : [
{
type: 'category',
boundaryGap: false,
data:this.MonthList,
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent"
}
},
axisLabel: {
textStyle: {
color: "#333333"
}
},
}
}
],
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
type: 'dashed',
color: "#ddd"
}
}
},
dataZoom: [
{
type: 'inside'
}
],
series:datas
],
yAxis : [
{
type : 'value',
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent",
width: 1,
}
},
axisLabel: {
textStyle: {
color: "#969696"
}
},
splitLine:{
show:true,
lineStyle:{
// type:'dashed'
color:'#EEEEEE',
}
}
}
],
series:datas
};
myChart.setOption(option,true)
},
inCostDatas() {
this.CostDatas = []
for(let i=0;i<7;i++){
this.CostDatas.push(JSON.parse(JSON.stringify(this.CostDataObj)))
}
myChart.setOption(option,true)
},
}
......
......@@ -71,7 +71,9 @@ export default {
let Stocklegend = {}
let Newobj = {}
this.LineAnalysisData.forEach((x,indexs)=>{
let Name = `${x.Name}`
if(Name!='合计'){
titles.push(Name)
let newDetailList = []
......@@ -91,11 +93,13 @@ export default {
}
// if(indexs>3){
// let name=x.Name;
// Newobj[name]=false;
// }
// Stocklegend=Newobj;
// if(indexs>3){
// let name=x.Name;
// Newobj[name]=false;
// }
// Stocklegend=Newobj;
}
})
let chartDom = document.getElementById('ShareMyEchart');
let myChart = this.$echarts.init(chartDom);
......@@ -106,9 +110,11 @@ export default {
trigger: 'item'
},
legend: {
orient: 'vertical',
bottom:'bottom',
left: 'left',
padding: [25, 30, 20, 20] ,
type:'scroll',
icon: "circle",
padding: [25, 20, 20, 20] ,
selected: Stocklegend
},
series: datas
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment