153 lines
3.4 KiB
Vue
153 lines
3.4 KiB
Vue
![]() |
|
|||
|
<template>
|
|||
|
<el-row style="background:#fff;margin-top:30px;">
|
|||
|
<el-col :xs="24" :sm="24" :lg="24">
|
|||
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding">
|
|||
|
<div slot="header">
|
|||
|
<span class="card-title">能量流转</span>
|
|||
|
</div>
|
|||
|
<div style="height: 310px" id="nllzChart"></div>
|
|||
|
</el-card>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
</template>
|
|||
|
|
|||
|
<script>
|
|||
|
import * as echarts from 'echarts'
|
|||
|
require('echarts/theme/macarons') // echarts theme
|
|||
|
import resize from '@/mixins/ems/resize'
|
|||
|
|
|||
|
export default {
|
|||
|
mixins: [resize],
|
|||
|
data() {
|
|||
|
return {
|
|||
|
chart: null
|
|||
|
}
|
|||
|
},
|
|||
|
mounted() {
|
|||
|
this.$nextTick(() => {
|
|||
|
this.initChart()
|
|||
|
})
|
|||
|
},
|
|||
|
beforeDestroy() {
|
|||
|
if (!this.chart) {
|
|||
|
return
|
|||
|
}
|
|||
|
this.chart.dispose()
|
|||
|
this.chart = null
|
|||
|
},
|
|||
|
methods: {
|
|||
|
initChart() {
|
|||
|
this.chart = echarts.init(document.querySelector('#nllzChart'), 'macarons')
|
|||
|
this.setOptions()
|
|||
|
},
|
|||
|
setOptions() {
|
|||
|
this.chart.setOption({
|
|||
|
title: [
|
|||
|
// 右上角
|
|||
|
{
|
|||
|
text: '电网 实时功率:15kW',
|
|||
|
top: 10,
|
|||
|
right: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
},
|
|||
|
// 右下角
|
|||
|
{
|
|||
|
text: '负载 实时功率:15kW',
|
|||
|
bottom: 10,
|
|||
|
right: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
},
|
|||
|
// 左下角第一行
|
|||
|
{
|
|||
|
text: '储能',
|
|||
|
bottom: 56,
|
|||
|
left: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
},
|
|||
|
// 左下角第二行
|
|||
|
{
|
|||
|
text: '实时功率:12kW',
|
|||
|
bottom: 40,
|
|||
|
left: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
},
|
|||
|
// 左下角第三行
|
|||
|
{
|
|||
|
text: 'SOC:75%',
|
|||
|
bottom: 26,
|
|||
|
left: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
},
|
|||
|
// 左下角第四行
|
|||
|
{
|
|||
|
text: '可用电量:12kWh',
|
|||
|
bottom: 10,
|
|||
|
left: 10,
|
|||
|
textStyle:{
|
|||
|
fontSize:12,
|
|||
|
color:'#666666'
|
|||
|
}
|
|||
|
}
|
|||
|
],
|
|||
|
grid:{
|
|||
|
left:200
|
|||
|
},
|
|||
|
tooltip: {
|
|||
|
trigger: 'axis',
|
|||
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|||
|
}
|
|||
|
},
|
|||
|
textStyle:{
|
|||
|
color:"#333333",
|
|||
|
},
|
|||
|
xAxis: {
|
|||
|
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
|
|||
|
axisLine: {
|
|||
|
lineStyle:{
|
|||
|
color: '#333333',
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
yAxis: {
|
|||
|
type: 'value',
|
|||
|
axisLine: {
|
|||
|
lineStyle:{
|
|||
|
color: '#333333',
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
series: [
|
|||
|
{
|
|||
|
name:'充电量',
|
|||
|
data: [80,92,1,34,90,130,320,80,9,91,34,90],
|
|||
|
type: 'line',
|
|||
|
},{
|
|||
|
name:'放电量',
|
|||
|
data: [820,932,901,934,1290,1330,1320,820,932,901,934,1290],
|
|||
|
type: 'line',
|
|||
|
}]
|
|||
|
})
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
</script>
|
|||
|
|