修改bug及能源分析样式
This commit is contained in:
@@ -25,6 +25,10 @@ export default {
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
timeDim: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -51,13 +55,37 @@ export default {
|
||||
let xData = []
|
||||
let yData = []
|
||||
for (let i = 0; i < this.chartData.length; i++) {
|
||||
xData.push(this.chartData[i].time)
|
||||
let time = ""
|
||||
if (this.timeDim === '3') {
|
||||
let year = this.chartData[i].time.slice(0,4)
|
||||
let weak = this.chartData[i].time.slice(4,6)
|
||||
time = year+' 第 '+weak+' 周'
|
||||
} else {
|
||||
time = this.chartData[i].time
|
||||
}
|
||||
xData.push(time)
|
||||
yData.push(this.chartData[i].useNum)
|
||||
}
|
||||
var option = {
|
||||
color:['#288AFF'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '4%',
|
||||
right: '1%',
|
||||
bottom: '1%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData
|
||||
data: xData,
|
||||
axisLabel: {
|
||||
rotate: "45"
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
@@ -65,7 +93,12 @@ export default {
|
||||
series: [
|
||||
{
|
||||
data: yData,
|
||||
type: 'bar'
|
||||
type: 'bar',
|
||||
barMaxWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import resize from '@/utils/chartMixins/resize'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: "LineChart",
|
||||
mixins: [resize],
|
||||
@@ -25,6 +26,10 @@ export default {
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
timeDim: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -51,14 +56,35 @@ export default {
|
||||
let xData = []
|
||||
let yData = []
|
||||
for (let i = 0; i < this.chartData.length; i++) {
|
||||
xData.push(this.chartData[i].time)
|
||||
let time = ""
|
||||
if (this.timeDim === '3') {
|
||||
let year = this.chartData[i].time.slice(0,4)
|
||||
let weak = this.chartData[i].time.slice(4,6)
|
||||
time = year+' 第 '+weak+' 周'
|
||||
} else {
|
||||
time = this.chartData[i].time
|
||||
}
|
||||
xData.push(time)
|
||||
yData.push(this.chartData[i].useNum)
|
||||
}
|
||||
|
||||
var option = {
|
||||
color:['#288AFF'],
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '4%',
|
||||
right: '1%',
|
||||
bottom: '1%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData
|
||||
data: xData,
|
||||
axisLabel: {
|
||||
rotate: "45"
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
|
||||
Reference in New Issue
Block a user