1 Star 0 Fork 0

芮伟棠/hengshi-echarts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
testing.html 40.40 KB
一键复制 编辑 原始数据 按行查看 历史
芮伟棠 提交于 2024-09-04 17:26 . 再次修改
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>综合能源算法管理平台-调优监测</title>
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/common.css">
<link rel="stylesheet" href="./css/testing.css">
</head>
<body>
<!-- 返回按钮 -->
<a href="./login.html" class="back"></a>
<!-- 公共头部 -->
<div class="header">
<a href="./testing.html" class="active">调优监测</a>
<a href="./effect.html">调优效果</a>
<a href="./manage.html">碳排管理</a>
<a href="#">产品单耗</a>
</div>
<!-- 看板信息 -->
<div class="info">
<div class="item">
<div class="title">现货价格</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>电力现货:</span>
<i>0.7219 元/kWh</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>生物质颗粒:</span>
<i>800 元/吨</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>碳CCER:</span>
<i>91.55 元/吨CO2</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>桉树皮:</span>
<i>102.82元/吨</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供电监测</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>光伏出口电压:</span>
<i>398.53 V</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>充电桩瞬时功率:</span>
<i> 550.26kW</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>风机出口电压:</span>
<i>401.79V</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>充电桩今日累计充电量:</span>
<i>1855.91kWh</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供冷监视</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>瞬时SCOP:</span>
<i>4.2</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>逐月SCOP:</span>
<i>4.1</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>负载率:</span>
<i>92.14%</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>厂房5温度:</span>
<i>25.9℃</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供热监视</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>供热气压:</span>
<i>0.51MPa</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>蒸汽温度:</span>
<i>185.52℃</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>负载率:</span>
<i> 82.35%</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>生物质仓储:</span>
<i>21天</i>
</li>
</ul>
</div>
</div>
<!-- AI预测 -->
<div class="main">
<!-- 第一行 -->
<div class="row">
<div class="content one"></div>
<div class="box">
<div class="title1"></div>
<div class="box1"></div>
</div>
<div class="box">
<div class="title2"></div>
<div class="box2"></div>
</div>
<div class="box">
<div class="title3"></div>
<div class="box3"></div>
</div>
<div class="box">
<div class="title4"></div>
<div class="box4"></div>
</div>
</div>
<!-- 第二行 -->
<div class="row">
<div class="content two"></div>
<div class="box">
<div class="title5"></div>
<div class="box5"></div>
</div>
<div class="box">
<div class="title6"></div>
<div class="box6"></div>
</div>
<div class="box">
<div class="title7"></div>
<div class="box7"></div>
</div>
<div class="box">
<div class="title8"></div>
<div class="box8"></div>
</div>
</div>
<!-- 第三行 -->
<div class="row">
<div class="content three"></div>
<div class="box">
<div class="title9"></div>
<div class="box9"></div>
</div>
<div class="box">
<div class="title10"></div>
<div class="box10"></div>
</div>
<div class="box">
<div class="title11"></div>
<div class="box11"></div>
</div>
<div class="box">
<div class="title12"></div>
<div class="box12"></div>
</div>
</div>
</div>
<div class="time">调优周期:15min 最新调优时间:2024/8/8 16:15</div>
<script src="./js/ip.js"></script>
<script src="./js/mqtt.min.js"></script>
<script src="./lib/echarts.js"></script>
<script src="./js/data.js"></script>
<script src="./js/data2.js"></script>
<script>
let count
const timeHTML = document.querySelector('.time')
// 首屏渲染
getTime()
// 文本大小缩放
// 改变图表字体大小
function transformFontSize(fontsize) {
// 获取屏幕宽度
const width = document.body.scrollWidth;
const ratio = width / 1920;
return parseInt(fontsize * ratio);
}
// 电负荷预测-----------------------------------------
let myChart1 = echarts.init(document.querySelector('.box1'))
let option1 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: electricLoadX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '15%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
// 自定义显示内容
// params 是一个包含当前数据信息的数组或对象
let result = params[0].name + '<br/>';
// params.forEach(function (item) {
result += params[0].seriesName + ': ' + params[0].value + '<br/>';
// });
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: electricLoadY1,
type: 'line',
color: '#00DFFF',
name: '电负荷 (kW)',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: electricLoadY2,
type: 'line',
color: '#00DFFF',
name: '电负荷预测(kW)',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
}
]
}
// 冷负荷预测-----------------------------------------
let myChart2 = echarts.init(document.querySelector('.box2'))
let option2 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: coldLoadX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '15%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
// 自定义显示内容
// params 是一个包含当前数据信息的数组或对象
let result = params[0].name + '<br/>';
// params.forEach(function (item) {
result += params[0].seriesName + ': ' + params[0].value + '<br/>';
// });
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: coldLoadY1,
type: 'line',
color: '#00A1FF',
name: '冷负荷(kW)',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: coldLoadY2,
type: 'line',
color: '#00A1FF',
name: '冷负荷预测(kW)',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
}
]
}
// 热负荷预测-----------------------------------------
let myChart3 = echarts.init(document.querySelector('.box3'))
let option3 = {
title: {
text: '吨/h(蒸汽)',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '3%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: hotLoadX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '10%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
// 自定义显示内容
// params 是一个包含当前数据信息的数组或对象
let result = params[0].name + '<br/>';
// params.forEach(function (item) {
result += params[0].seriesName + ': ' + params[0].value + '<br/>';
// });
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: hotLoadY1,
type: 'line',
color: '#F75656',
name: '热负荷(蒸汽,吨/h)',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: hotLoadY2,
type: 'line',
color: '#F75656',
name: '热负荷预测(蒸汽,吨/h)',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
}
]
}
// 生物质价格预测-----------------------------------------
let myChart4 = echarts.init(document.querySelector('.box4'))
let option4 = {
title: {
text: '',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '7%',
top: '0%'
},
legend: {
data: ['生物质颗粒价格', '桉树皮价格'],
itemGap: 5,
itemWidth: 10,
itemHeight: 0,
top: 5,
left: 'center',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(12),
}
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: biomassPriceX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '12%',
top: '17%',
bottom: '12%',
right: '3%'
},
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
let result
// 自定义显示内容
console.log(params.length, 111111111)
// params 是一个包含当前数据信息的数组或对象
if (params.length <= 2) {
// result += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color + '"></span>';
result = params[0].name + '<br/>';
params.forEach(function (item) {
result += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + item.color + '"></span>';
result += item.seriesName + ': ' + item.value + '<br/>';
});
} else {
result = params[0].name + '<br/>' + '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color + '"></span>' + params[0].seriesName + ': ' + params[0].value + '<br/>';
result += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[2].color + '"></span>';
result += params[2].seriesName + ': ' + params[2].value + '<br/>'
}
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: biomassPriceY1,
type: 'line',
color: '#00A1FF',
name: '生物质颗粒价格',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: biomassPriceY2,
type: 'line',
color: '#00A1FF',
name: '生物质颗粒预测',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
},
{
symbol: 'none',
data: casuarinaPriceY1,
type: 'line',
color: '#F2D93A',
name: '桉树皮价格',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: casuarinaPriceY2,
type: 'line',
color: '#F2D93A',
name: '桉树皮价格预测',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
},
]
}
// 光伏出力-----------------------------------------
let myChart5 = echarts.init(document.querySelector('.box5'))
let option5 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: pvOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '15%',
top: '17%',
bottom: '12%',
right: '5%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
// 自定义显示内容
// params 是一个包含当前数据信息的数组或对象
let result = params[0].name + '<br/>';
// params.forEach(function (item) {
result += params[0].seriesName + ': ' + params[0].value + '<br/>';
// });
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: pvOutputY1,
type: 'line',
color: '#7B4CFF',
name: '光伏出力(kW)',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: pvOutputY2,
type: 'line',
color: '#7B4CFF',
name: '光伏出力预测(kW)',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
}
]
}
// 风机出力--------------------------------
let myChart6 = echarts.init(document.querySelector('.box6'))
let option6 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: windOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '12%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true,
formatter: function (params) {
// 自定义显示内容
// params 是一个包含当前数据信息的数组或对象
let result = params[0].name + '<br/>';
// params.forEach(function (item) {
result += params[0].seriesName + ': ' + params[0].value + '<br/>';
// });
return result;
}
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: windOutputY1,
type: 'line',
color: '#00DFFF',
name: '风机出力(kW)',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: windOutputY2,
type: 'line',
color: '#00DFFF',
name: '风机出力预测(kW)',
smooth: true,
yAxisIndex: 0,
lineStyle: {
type: 'dotted'
}
},
]
}
// 地源热泵出力-----------------------------------------
let myChart7 = echarts.init(document.querySelector('.box7'))
let option7 = {
title: [{
text: 'kW(电度)',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '5%',
top: '0%'
}, {
text: 'kW(冷度)',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
right: '0%',
top: '0%'
}],
legend: {
data: ['用电功率', '供冷出力'],
itemGap: 5,
itemWidth: 10,
itemHeight: 0,
top: 5,
left: 'center',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(12),
}
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: geothermalOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '12%',
top: '17%',
bottom: '12%',
right: '12%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: geothermalOutputY1,
type: 'line',
color: '#FF8B31',
name: '用电功率',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: geothermalOutputY1_1,
type: 'line',
color: '#00DFFF',
name: '供冷出力',
smooth: true,
yAxisIndex: 1,
// lineStyle: {
// type: 'dotted'
// }
},
]
}
// 蓄生物质供热-----------------------------------------
let myChart8 = echarts.init(document.querySelector('.box8'))
let option8 = {
title: {
text: '吨/h',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '3%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: biomassOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '10%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: biomassOutputY1,
type: 'line',
color: '#00A1FF',
name: '生物质出力(吨/h)',
smooth: true,
yAxisIndex: 0,
},
// {
// symbol: 'none',
// data: biomassOutputY2,
// type: 'line',
// color: '#00A1FF',
// name: '生物质供热预测',
// smooth: true,
// yAxisIndex: 0,
// lineStyle: {
// type: 'dotted'
// }
// },
]
}
// 电化学储能出力-----------------------------------------
let myChart9 = echarts.init(document.querySelector('.box9'))
let option9 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: electrochemicalOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '15%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: electrochemicalOutputY1,
type: 'line',
color: '#F2D93A',
name: '电化学储能出力(kW)',
smooth: true,
yAxisIndex: 0,
},
// {
// symbol: 'none',
// data: electrochemicalOutputY2,
// type: 'line',
// color: '#F2D93A',
// name: '电化学储能出力预测',
// smooth: true,
// yAxisIndex: 0,
// lineStyle: {
// type: 'dotted'
// }
// },
]
}
// 蓄冷出力-----------------------------------------
let myChart10 = echarts.init(document.querySelector('.box10'))
let option10 = {
title: {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '10%',
top: '0%'
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: chillerOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '13%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: chillerOutputY1,
type: 'line',
color: '#00A1FF',
name: '供冷出力(kW)',
smooth: true,
yAxisIndex: 0,
},
// {
// symbol: 'none',
// data: chillerOutputY2,
// type: 'line',
// color: '#00A1FF',
// name: '蓄冷出力预测',
// smooth: true,
// yAxisIndex: 0,
// lineStyle: {
// type: 'dotted'
// }
// },
]
}
// 蓄热出力-----------------------------------------
let myChart11 = echarts.init(document.querySelector('.box11'))
let option11 = {
title: [{
text: '吨/h',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '5%',
top: '0%'
}, {
text: 'kW',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
right: '10%',
top: '0%'
}],
textStyle: {
fontSize: transformFontSize(14),
},
legend: {
// data: ['用电功率(kW)', '供冷出力(kW)'],
itemGap: 5,
itemWidth: 10,
itemHeight: 0,
top: 5,
left: 'center',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(12),
}
},
xAxis: {
type: 'category',
data: boilerOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '10%',
top: '17%',
bottom: '12%',
right: '12%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: boilerOutputY1,
type: 'line',
color: '#F15556',
name: '蓄热蒸汽出力',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: biomassOutputY1_1,
type: 'line',
color: '#00A1FF',
name: '蓄热用电功率',
smooth: true,
yAxisIndex: 1,
// lineStyle: {
// type: 'dotted'
// }
},
]
}
// LNG供热出力-----------------------------------------
let myChart12 = echarts.init(document.querySelector('.box12'))
let option12 = {
title: {
text: '吨/h',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(14)
},
left: '5%',
top: '0%'
},
legend: {
// data:['用电功率(kW)','供冷出力(kW)'],
itemGap: 5,
itemWidth: 10,
itemHeight: 0,
top: 5,
left: 'center',
textStyle: {
color: '#ccc',
fontSize: transformFontSize(12),
}
},
textStyle: {
fontSize: transformFontSize(14),
},
xAxis: {
type: 'category',
data: lngOutputX,
axisLabel: {
fontSize: transformFontSize(14)
},
},
grid: {
left: '10%',
top: '17%',
bottom: '12%',
right: '3%'
},
// legend: {
// textStyle: {
// color: '#ccc',
// }
// },
tooltip: {
trigger: 'axis',
appendToBody: true
},
yAxis: [
{
type: 'value',
// name: 'MW',
axisLine: {
show: true
},
splitLine: {
lineStyle: {
color: ['#2079A0']
}
},
axisLabel: {
fontSize: transformFontSize(14)
},
},
],
series: [
{
symbol: 'none',
data: lngOutputY1,
type: 'line',
color: '#7B4CFF',
name: '蒸汽出力',
smooth: true,
yAxisIndex: 0,
},
{
symbol: 'none',
data: lngOutputY1_1,
type: 'line',
color: '#F2D93A',
name: 'LNG消耗',
smooth: true,
yAxisIndex: 0,
// lineStyle: {
// type: 'dotted'
// }
},
]
}
// 设置echarts---------------------------------
function renderCharts() {
option1.series[0].data = electricLoadY2.slice(0, count + 1)
option2.series[0].data = coldLoadY2.slice(0, count + 1)
option3.series[0].data = hotLoadY2.slice(0, count + 1)
// option4.series[0].data = biomassPriceY2.slice(0, count + 1)
// option4.series[2].data = casuarinaPriceY2.slice(0, count + 1)
option5.series[0].data = pvOutputY2.slice(0, count + 1)
option6.series[0].data = windOutputY2.slice(0, count + 1)
option7.series[0].data = geothermalOutputY2.slice(0, count + 1)
option7.series[1].data = geothermalOutputY1_2.slice(0, count + 1)
option8.series[0].data = biomassOutputY2.slice(0, count + 1)
option9.series[0].data = electrochemicalOutputY2.slice(0, count + 1)
option10.series[0].data = chillerOutputY2.slice(0, count + 1)
option11.series[0].data = boilerOutputY2.slice(0, count + 1)
option11.series[1].data = biomassOutputY1_2.slice(0, count + 1)
option12.series[0].data = lngOutputY2.slice(0, count + 1)
option12.series[1].data = lngOutputY1_2.slice(0, count + 1)
myChart1.setOption(option1)
myChart2.setOption(option2)
myChart3.setOption(option3)
myChart4.setOption(option4)
myChart5.setOption(option5)
myChart6.setOption(option6)
myChart7.setOption(option7)
myChart8.setOption(option8)
myChart9.setOption(option9)
myChart10.setOption(option10)
myChart11.setOption(option11)
myChart12.setOption(option12)
}
// 首屏渲染
renderCharts()
// echarts跟随屏幕变化而适配-----------------------
window.addEventListener("resize", function () {
myChart1.resize()
myChart2.resize()
myChart3.resize()
myChart4.resize()
myChart5.resize()
myChart6.resize()
myChart7.resize()
myChart8.resize()
myChart9.resize()
myChart10.resize()
myChart11.resize()
myChart12.resize()
})
let time = ''
// 每隔1min执行一次(更新数据)
setInterval(function () {
getTime()
// 重新渲染数据
renderCharts()
}, 10000)
// 根据当前时间获取第几个15min
function getTime() {
// 获取当前时间属于第几个15min
let now = new Date()
// 一个小时有4个15分钟
let hours = now.getHours()
let minutes = now.getMinutes()
let seconds = now.getSeconds()
// 几个15分钟
count = hours * 4 + parseInt(minutes / 15)
// 测试代码
// count = seconds
console.log(count)
let timeHours = parseInt(count / 4)
timeHours = timeHours < 10 ? '0' + timeHours : timeHours
let timeMinutes = (count % 4 * 15)
timeMinutes = timeMinutes < 10 ? '0' + timeMinutes : timeMinutes
timeHTML.innerHTML = `调优周期:15min 最新调优时间: ${now.toLocaleDateString()} ${timeHours}:${timeMinutes}`
}
// 设置看板数据
let num = 1
let nameArr = [lookArr1, lookArr2, lookArr3, lookArr4]
let info = document.querySelector('.info')
function renderBoard(arr) {
// console.log(arr)
info.innerHTML = `
<div class="item">
<div class="title">现货价格</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>电力现货:</span>
<i>${arr[0]}元/kWh</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>生物质颗粒:</span>
<i>${arr[1]}元/吨</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>碳CCER:</span>
<i>${arr[2]}元/吨CO2</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>桉树皮:</span>
<i>${arr[3]}元/吨</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供电监测</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>光伏出口电压:</span>
<i>${arr[4]}V</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>充电桩瞬时功率:</span>
<i>${arr[6]}kW</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>风机出口电压:</span>
<i>${arr[5]}V</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>充电桩今日累计充电量:</span>
<i>${arr[7]}kWh</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供冷监视</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>瞬时SCOP:</span>
<i>${arr[8]}</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>逐月SCOP:</span>
<i>${arr[9]}</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>负载率:</span>
<i>${arr[10]}</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>厂房5温度:</span>
<i>${arr[11]}℃</i>
</li>
</ul>
</div>
<div class="item">
<div class="title">供热监视</div>
<ul>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>供热气压:</span>
<i>${arr[12]}MPa</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>蒸汽温度:</span>
<i>${arr[13]}℃</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>负载率:</span>
<i>${arr[14]}</i>
</li>
<li>
<img src="./images/编组 2@2x.png" alt="">
<span>生物质仓储:</span>
<i>${arr[15]}天</i>
</li>
</ul>
</div>
`
}
getMqtt()
renderBoard(nameArr[0])
// 定时器
setInterval(() => {
getMqtt()
renderBoard(nameArr[num])
num++
if (num > 3) {
num = 0
}
}, 5000)
// 实时获取mqtt协议数据
function getMqtt() {
const client = mqtt.connect(`ws://${ip}:${port}`, {
reconnectPeriod: 1000,
connectTimeout: 30 * 1000,
})
// 当连接成功时触发
client.on('connect', function () {
console.log('连接成功')
})
// 订阅主题
client.subscribe(url, function (err) {
if (!err) {
// 发布消息
client.publish('test', 'Hello mqtt')
}
})
// 当断开连接后,经过重连间隔时间重新自动连接到 Broker 时触发
client.on('reconnect', function () {
console.log('自动重连中...')
// 1、GridVab
lookArr1[4] = '--- '
lookArr2[4] = '--- '
lookArr3[4] = '--- '
lookArr4[4] = '--- '
// 2、lineVab
lookArr1[5] = '--- '
lookArr2[5] = '--- '
lookArr3[5] = '--- '
lookArr4[5] = '--- '
// 3、RatedPower
lookArr1[6] = '--- '
lookArr2[6] = '--- '
lookArr3[6] = '--- '
lookArr4[6] = '--- '
// 4、AccumulatedElectricity
lookArr1[7] = '--- '
lookArr2[7] = '--- '
lookArr3[7] = '--- '
lookArr4[7] = '--- '
})
// 在断开连接以后触发
client.on('close', function () {
console.log('连接断开了')
})
// 当客户端无法成功连接时或发生解析错误时触发,参数 error 为错误信息
client.on('error', function (error) {
console.log('连接出错了', error)
})
// 接收消息
client.on('message', function (topic, message) {
// message is Buffer
let data = JSON.parse(message.toString())
// 1、GridVab
console.log(data.inverter.GridVab)
lookArr1[4] = data.inverter.GridVab
lookArr2[4] = data.inverter.GridVab
lookArr3[4] = data.inverter.GridVab
lookArr4[4] = data.inverter.GridVab
// 2、lineVab
console.log(data.elec_meter.lineVab)
lookArr1[5] = data.elec_meter.lineVab
lookArr2[5] = data.elec_meter.lineVab
lookArr3[5] = data.elec_meter.lineVab
lookArr4[5] = data.elec_meter.lineVab
// 3、RatedPower
console.log(data.charging.RatedPower)
lookArr1[6] = data.charging.RatedPower
lookArr2[6] = data.charging.RatedPower
lookArr3[6] = data.charging.RatedPower
lookArr4[6] = data.charging.RatedPower
// 4、AccumulatedElectricity
console.log(data.charging.AccumulatedElectricity)
lookArr1[7] = data.charging.AccumulatedElectricity
lookArr2[7] = data.charging.AccumulatedElectricity
lookArr3[7] = data.charging.AccumulatedElectricity
lookArr4[7] = data.charging.AccumulatedElectricity
client.end()
})
}
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ruiweitang/hengshi-echarts.git
git@gitee.com:ruiweitang/hengshi-echarts.git
ruiweitang
hengshi-echarts
hengshi-echarts
main

搜索帮助