|
@ -10,14 +10,14 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> --> |
|
|
</div> --> |
|
|
<div class="income-container"> |
|
|
<div class="income-container"> |
|
|
<div class="chart" id="chart_bar"></div> |
|
|
<div class="chart" id="chart_bar"></div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
export default { |
|
|
export default { |
|
|
props: { |
|
|
props: { |
|
|
chartData: { |
|
|
chartData: { |
|
|
required: true, |
|
|
required: true, |
|
|
}, |
|
|
}, |
|
@ -30,47 +30,56 @@ export default { |
|
|
yData1: [], |
|
|
yData1: [], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
watch: { |
|
|
|
|
|
chartData: { |
|
|
|
|
|
deep: true, |
|
|
|
|
|
handler: function () { |
|
|
|
|
|
this.getEchart() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
// console.log(this.chartData) |
|
|
// console.log(this.chartData) |
|
|
for(var i= 0;i<this.chartData.inStatistics.length;i++){ |
|
|
for (var i = 0; i < this.chartData.inStatistics.length; i++) { |
|
|
this.xAxisData.push(this.chartData.inStatistics[i].timeUnit) |
|
|
this.xAxisData.push(this.chartData.inStatistics[i].timeUnit) |
|
|
this.yData1.push(this.chartData.inStatistics[i].num) |
|
|
this.yData1.push(this.chartData.inStatistics[i].num) |
|
|
} |
|
|
} |
|
|
this.getEchart(); |
|
|
this.getEchart(); |
|
|
}, 800); |
|
|
}, 800); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
getEchart() { |
|
|
getEchart() { |
|
|
let myChart = echarts.init(document.getElementById('chart_bar')); |
|
|
let myChart = echarts.init(document.getElementById('chart_bar')); |
|
|
let barWidth = '15%'; |
|
|
let barWidth = '15%'; |
|
|
let dataCoord = [ |
|
|
let dataCoord = [ |
|
|
{coord: [0, 9]}, |
|
|
{ coord: [0, 9] }, |
|
|
{coord: [1, 12]}, |
|
|
{ coord: [1, 12] }, |
|
|
{coord: [2, 15]}, |
|
|
{ coord: [2, 15] }, |
|
|
{coord: [3, 18]}, |
|
|
{ coord: [3, 18] }, |
|
|
{coord: [4, 15]}, |
|
|
{ coord: [4, 15] }, |
|
|
{coord: [5, 12]}, |
|
|
{ coord: [5, 12] }, |
|
|
{coord: [6, 9]}, |
|
|
{ coord: [6, 9] }, |
|
|
{coord: [7, 12]}, |
|
|
{ coord: [7, 12] }, |
|
|
{coord: [8, 15]}, |
|
|
{ coord: [8, 15] }, |
|
|
{coord: [9, 18]}, |
|
|
{ coord: [9, 18] }, |
|
|
{coord: [10, 15]}, |
|
|
{ coord: [10, 15] }, |
|
|
{coord: [11, 12]}, |
|
|
{ coord: [11, 12] }, |
|
|
]; |
|
|
]; |
|
|
let dataCoord2 = [ |
|
|
let dataCoord2 = [ |
|
|
{coord: [0, -9]}, |
|
|
{ coord: [0, -9] }, |
|
|
{coord: [1, -12]}, |
|
|
{ coord: [1, -12] }, |
|
|
{coord: [2, -15]}, |
|
|
{ coord: [2, -15] }, |
|
|
{coord: [3, -18]}, |
|
|
{ coord: [3, -18] }, |
|
|
{coord: [4, -15]}, |
|
|
{ coord: [4, -15] }, |
|
|
{coord: [5, -12]}, |
|
|
{ coord: [5, -12] }, |
|
|
{coord: [6, -9]}, |
|
|
{ coord: [6, -9] }, |
|
|
{coord: [7, -12]}, |
|
|
{ coord: [7, -12] }, |
|
|
{coord: [8, -15]}, |
|
|
{ coord: [8, -15] }, |
|
|
{coord: [9, -18]}, |
|
|
{ coord: [9, -18] }, |
|
|
{coord: [10, -15]}, |
|
|
{ coord: [10, -15] }, |
|
|
{coord: [11, -12]}, |
|
|
{ coord: [11, -12] }, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
this.option = { |
|
|
this.option = { |
|
@ -82,7 +91,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
axisTick: { |
|
|
axisTick: { |
|
|
show: false |
|
|
show: false |
|
|
}, |
|
|
}, |
|
|
axisLine: { |
|
|
axisLine: { |
|
|
show: true, |
|
|
show: true, |
|
|
lineStyle: { |
|
|
lineStyle: { |
|
@ -90,16 +99,16 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'axis', |
|
|
trigger: 'axis', |
|
|
showContent: true, |
|
|
showContent: true, |
|
|
axisPointer: { |
|
|
axisPointer: { |
|
|
type: 'shadow', |
|
|
type: 'shadow', |
|
|
shadowStyle: { |
|
|
shadowStyle: { |
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|
|
offset: 1, |
|
|
offset: 1, |
|
|
color: '#5d83ff' |
|
|
color: '#5d83ff' |
|
|
},{ |
|
|
}, { |
|
|
offset: 0, |
|
|
offset: 0, |
|
|
color: 'rgba(255, 255, 255, 0)' |
|
|
color: 'rgba(255, 255, 255, 0)' |
|
|
}]) |
|
|
}]) |
|
@ -112,7 +121,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
axisTick: { |
|
|
axisTick: { |
|
|
show: false |
|
|
show: false |
|
|
}, |
|
|
}, |
|
|
splitLine: { |
|
|
splitLine: { |
|
|
show: false |
|
|
show: false |
|
|
}, |
|
|
}, |
|
@ -138,23 +147,23 @@ export default { |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
normal: { |
|
|
normal: { |
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|
|
offset: 1, |
|
|
offset: 1, |
|
|
color: 'rgba(0, 0, 0, 0)' |
|
|
color: 'rgba(0, 0, 0, 0)' |
|
|
},{ |
|
|
}, { |
|
|
offset: 0.6, |
|
|
offset: 0.6, |
|
|
color: '#466e71' |
|
|
color: '#466e71' |
|
|
},{ |
|
|
}, { |
|
|
offset: 0, |
|
|
offset: 0, |
|
|
color: '#43FFFF' |
|
|
color: '#43FFFF' |
|
|
}]), |
|
|
}]), |
|
|
label: { |
|
|
label: { |
|
|
position:"top", |
|
|
position: "top", |
|
|
show: true, //开启显示 |
|
|
show: true, //开启显示 |
|
|
textStyle: { //数值样式 |
|
|
textStyle: { //数值样式 |
|
|
color: '#fff', |
|
|
color: '#fff', |
|
|
fontSize: 10 |
|
|
fontSize: 10 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
barWidth: barWidth, |
|
|
barWidth: barWidth, |
|
@ -173,7 +182,7 @@ export default { |
|
|
// }, |
|
|
// }, |
|
|
data: this.yData1 |
|
|
data: this.yData1 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
}; |
|
|
}; |
|
|
myChart.setOption(this.option, true); |
|
|
myChart.setOption(this.option, true); |
|
@ -184,7 +193,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
beforeDestroy() { |
|
|
beforeDestroy() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
@ -195,11 +204,13 @@ export default { |
|
|
height: 3rem; |
|
|
height: 3rem; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.sn-container { |
|
|
.sn-container { |
|
|
left: 975px; |
|
|
left: 975px; |
|
|
top: 690px; |
|
|
top: 690px; |
|
|
width: 895px; |
|
|
width: 895px; |
|
|
height: 400px; |
|
|
height: 400px; |
|
|
|
|
|
|
|
|
.chartsdom { |
|
|
.chartsdom { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 95%; |
|
|
height: 95%; |
|
|