initChartEnergyOne() {
let chartInstance = echarts.init(this.$refs.energy_echarts_one);
let initOption = {
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
color: '#ddd'
}
},
backgroundColor: 'rgba(255,255,255,1)',
padding: [5, 10],
textStyle: {
color: '#7588E4',
},
extraCssText: 'box-shadow: 0 0 5px rgba(0,0,0,0.3)'
},
grid: {
left: "12%",
right: "1.5%",
bottom: "8%"
},
legend: {
right: 20,
orient: 'horizontal',
data: ['排放限制(mg/Nm³)', '实际出口排放(mg/Nm³)', '总能耗(kW)', '负荷(MW)'],
itemGap: 20,
textStyle: {
color: "#fff",
fontSize: '14px',
padding: [0, 0, 0, 10]
},
icon: "rect",
itemWidth: 53,
itemHeight: 2
},
// x轴数据
xAxis: {
type: 'category',
data: ['1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00',
'11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00',
'19:00', '20:00', '21:00', "22:00", '23:00', '24:00'
],
boundaryGap: false,
splitLine: {
show: true,
interval: 'auto',
lineStyle: {
color: ['rgba(255,255,255,.18)']
}
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#609ee9'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 14
}
}
},
// y轴数据,有几个定义几个即可 position: "left",控制y轴的位置 offset: 60,控制y轴的偏移量
yAxis: [{
type: 'value',
position: "left",
splitLine: {
lineStyle: {
color: ['rgba(255,255,255,.18)']
}
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#21CBEE'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12
}
}
},
{
type: 'value',
position: "left",
offset: 60,
splitLine: {
show: false
},
axisTick: {
show: false,
inside: true
},
axisLine: {
lineStyle: {
color: '#F19D7E'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12
}
},
},
{
type: 'value',
position: "left",
offset: 120,
splitLine: {
show: false
},
axisTick: {
show: false,
inside: true
},
axisLine: {
lineStyle: {
color: '#768AFF'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12
}
}
},
{
type: 'value',
position: "left",
offset: 180,
splitLine: {
show: false
},
axisTick: {
show: false,
inside: true
},
axisLine: {
lineStyle: {
color: '#F3FFD5'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12
}
}
}
],
// 有几个Y轴定义几个数据即可,yAxisIndex: 0,这玩意每一个都要写切从0开始
series: [{
name: '排放限制(mg/Nm³)',
type: 'line',
smooth: true,
showSymbol: false,
symbol: 'circle',
yAxisIndex: 0,
symbolSize: 6,
data: ['1200', '1400', '1008', '1411', '1026', '1288', '1300', '800', '1100', '1000',
'1118', '1322', '1200', '1400', '1008', '1411', '1026', '1288', '1300', '800',
'1100', '1000',
'1118', '1322'
],
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(14,41,105,0.5)'
}, {
offset: 1,
color: 'rgba(255,255,255,0)'
}], false)
}
},
itemStyle: {
normal: {
color: '#21CBEE'
}
},
lineStyle: {
normal: {
width: 2
}
}
}, {
name: '实际出口排放(mg/Nm³)',
type: 'line',
smooth: true,
showSymbol: false,
symbol: 'circle',
yAxisIndex: 1,
symbolSize: 6,
data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300',
'1998', '822', '1200', '1400', '1008', '1411', '1026', '1288', '1300', '800',
'1100', '1000',
'1118', '1322'
],
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(252,73,62,.2)'
}, {
offset: 1,
color: 'rgba(252,73,62,0)'
}], false)
}
},
itemStyle: {
normal: {
color: '#FFA480'
}
},
lineStyle: {
normal: {
width: 2
}
}
},
{
name: '总能耗(kW)',
type: 'line',
smooth: true,
showSymbol: false,
symbol: 'circle',
yAxisIndex: 2,
symbolSize: 6,
data: ['300', '400', '900', '811', '626', '488', '1600', '1100', '500', '300',
'1998', '822', '1400', '808', '811', '626', '488', '1600', '1100', '500',
'300',
'1998', '822', '1200',
],
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(118,138,255,.2)'
}, {
offset: 1,
color: 'rgba(118,138,255,0)'
}], false)
}
},
itemStyle: {
normal: {
color: '#768AFF'
}
},
lineStyle: {
normal: {
width: 2
}
}
},
{
name: '负荷(MW)',
type: 'line',
smooth: true,
showSymbol: false,
symbol: 'circle',
yAxisIndex: 3,
symbolSize: 6,
data: ['500', '100', '900', '811', '500', '991', '600', '200', '100', '300',
'500', '822', '500', '100', '900', '811', '500', '991', '811', '626', '488',
'1600', '1100', '500'
],
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(243,255,213,.2)'
}, {
offset: 1,
color: 'rgba(243,255,213,0)'
}], false)
}
},
itemStyle: {
normal: {
color: '#F3FFD5'
}
},
lineStyle: {
normal: {
width: 2
}
}
}
]
};
chartInstance.setOption(initOption);
},