|
|
|
@ -67,8 +67,10 @@
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
drawLine(id) {
|
|
|
|
|
drawLine() {
|
|
|
|
|
this.charts = echarts.init(this.$refs.bar_dv);
|
|
|
|
|
this.autoHeight = this.legendData.length* 35 + 50; // counst.length为柱状图的条数,即数据长度。35为我给每个柱状图的高度,50为柱状图x轴内容的高度(大概的)。
|
|
|
|
|
this.charts.resize({height:this.autoHeight});
|
|
|
|
|
let xAxis={};
|
|
|
|
|
let yAxis={};
|
|
|
|
|
if(this.isType==="across"){
|
|
|
|
@ -96,12 +98,14 @@
|
|
|
|
|
xAxis: xAxis,
|
|
|
|
|
yAxis: yAxis,
|
|
|
|
|
grid: {
|
|
|
|
|
left: '15',
|
|
|
|
|
right: '40',
|
|
|
|
|
bottom: '30',
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
bottom: '20%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
x:'center',
|
|
|
|
|
y:'bottom',
|
|
|
|
|
data: this.legendData
|
|
|
|
|
},
|
|
|
|
|
series: this.seriesData,
|
|
|
|
@ -113,11 +117,13 @@
|
|
|
|
|
backgroundColor: '#6a7985'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
|
|
this.$nextTick(function() {
|
|
|
|
|
this.drawLine('barChart')
|
|
|
|
|
})
|
|
|
|
|