1. 修改歷史資料 上方圖表

This commit is contained in:
Kai 2021-09-22 17:50:27 +08:00
parent a8ca32f96c
commit 62ef594a3e

View File

@ -5,7 +5,6 @@
}
@using SolarPower.Models.Role
@model RoleLayerEnum
@*<ol class="breadcrumb page-breadcrumb" >
<li class="breadcrumb-item"><a href="javascript:void(0);">總覽</a></li>
<li class="breadcrumb-item">@ViewData["Title"]</li>
@ -819,7 +818,7 @@
$(this).trigger('change');
});
//#endregion
//#region 運維作業記錄 DataTable
powerids.push(stationId);
operationRecordTable = $("#operation_record_table").DataTable({
@ -1878,7 +1877,7 @@
'<label id="lease_notarization_at_text_' + value.id + '" class="color-info-600">' + value.leaseNotarizationAt + '</label>' +
'</div>' +
'</div>' +
'</div>' +
'<div class="col-xl">' +
'<div class="row mb-3">' +
@ -2411,7 +2410,7 @@
irradianceALL += val.irradiance;
prALL = val.pr;
tempALL += val.temp;
//暫時先執行到這--->取kwhkwp
if (val.length != 0) {
@ -2436,14 +2435,14 @@
'<td>' + val.temp.toFixed(2) + '</td>' +
'</tr>');
listmonth.push(val.timestamp);
listkwh.push(val.kwh.toFixed(2));
listkwh.push(parseFloat(val.kwh.toFixed(2)));
listcolor.push(color);
listcolor2.push(color2);
listirradiance.push(val.irradiance.toFixed(2));
listtemperature.push(val.temp.toFixed(2));
listsolarhour.push(val.solarhour.toFixed(2));
listpr.push(val.pr.toFixed(2));
listkwhkwp.push(val.kwhkwp.toFixed(2));
listirradiance.push(parseFloat(val.irradiance.toFixed(2)));
listtemperature.push(parseFloat(val.temp.toFixed(2)));
listsolarhour.push(parseFloat(val.solarhour.toFixed(2)));
listpr.push(parseFloat(val.pr.toFixed(2)));
listkwhkwp.push(parseFloat(val.kwhkwp.toFixed(2)));
}
else
{
@ -2466,14 +2465,14 @@
'<td>' + val.temp.toFixed(2) + '</td>' +
'</tr>');
listmonth.push(val.timestamp);
listkwh.push(val.kwh.toFixed(2));
listkwh.push(parseFloat(val.kwh.toFixed(2)));
listcolor.push(color);
listcolor2.push(color2);
listirradiance.push(val.irradiance.toFixed(2));
listtemperature.push(val.temp.toFixed(2));
listsolarhour.push(val.solarhour.toFixed(2));
listpr.push(val.pr.toFixed(2));
listkwhkwp.push(val.kwhkwp.toFixed(2));
listirradiance.push(parseFloat(val.irradiance.toFixed(2)));
listtemperature.push(parseFloat(val.temp.toFixed(2)));
listsolarhour.push(parseFloat(val.solarhour.toFixed(2)));
listpr.push(parseFloat(val.pr.toFixed(2)));
listkwhkwp.push(parseFloat(val.kwhkwp.toFixed(2)));
}
@ -2484,7 +2483,105 @@
tempALL = tempALL / rel.data.length;
$('#history-kWh-convas-div').empty();
$('#history-kWh-convas-div').append('<figure class="highcharts-figure"><div id="history-kWh" ></div></figure>');
chart = new Highcharts.Chart({
lang: { //匯出相關中文名稱配置
printChart: '列印圖表',
downloadJPEG: '下載JPEG檔案',
downloadPDF: '下載PDF檔案',
downloadPNG: '下載PNG檔案',
downloadSVG: '下載SVG檔案',
downloadCSV: '下載CSV檔案',
downloadXLS: '下載XLS檔案',
viewData: '檢視資料表格',
viewFullscreen: '全屏檢視'
},
chart: {
renderTo: 'history-kWh',
height: 600,
animation: false
},
title: {
text: '發電量及日照度'
},
xAxis: {
categories: listmonth,
},
yAxis: [{
title: {
text: "kWh"
},
id: "A",
opposite: false,
showEmpty: false
}, {
title: {
text: "kWh/㎡"
},
id: "B",
opposite: true,
showEmpty: false
}, {
title: {
text: "hr"
},
id: "C",
opposite: true,
showEmpty: false
}, {
title: {
text: "PR(%)"
},
id: "D",
opposite: true,
showEmpty: false
}, {
title: {
text: "溫度(℃)"
},
id: "E",
opposite: true,
showEmpty: false
}],
series: [{
type: 'spline',
name: "溫度(℃)",
data: listtemperature,
yAxis: "E",
color: "rgb(255, 192, 0)",
zIndex: 4
}, {
type: 'spline',
name: "日照度(kWh/㎡)",
data: listirradiance,
yAxis: "B",
color: "rgb(190, 45, 45)",
zIndex: 3
}, {
type: 'column',
name: "PR(%)",
data: listpr,
yAxis: "D",
color: 'rgb(68, 114, 196)'
}, {
type: 'column',
name: "有效日照時數",
data: listkwhkwp,
yAxis: "C",
color: "rgb(165, 165, 165)"
}, {
type: 'column',
name: "發電量(kWh)",
data: listkwh,
yAxis: "A",
color: "rgb(103, 180, 172)"
}],
});
@*$('#history-kWh-convas-div').empty();
$('#history-kWh-convas-div').append('<canvas id="history-kWh"></canvas>');
var ctx_history_kWh = document.getElementById('history-kWh').getContext('2d');
var myhistorykwh = new Chart(ctx_history_kWh, {
@ -2609,7 +2706,7 @@
}]
}
}
});
});*@
@ -2672,7 +2769,7 @@
var urlPath = "../upload/power_station/" + rel.data.id + "/" + rel.data.mainDisplay;
var xmlhttp;
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();//其他浏览器
}
@ -2886,7 +2983,7 @@
ACDetail += "</tr>";
}
ACDetail += "<tr>";
ACDetail += "<td colspan='3'>輸出功率 <span class='color-info-700 font-weight-bold'>" + ((rel.data.aC1W + rel.data.aC2W + rel.data.aC3W) / 1000).toFixed(2) + "</span> KW</td>";
ACDetail += "<td colspan='3'>輸出功率 <span class='color-info-700 font-weight-bold'>" + ((rel.data.aC1W + rel.data.aC2W + rel.data.aC3W) / 1000).toFixed(2) + "</span> KW</td>";
ACDetail += "</tr>";
ACDetail += "<tr>";
ACDetail += "<td colspan='3'>PR <span class='color-info-700 font-weight-bold'>" + rel.data.pr.toFixed(2) + "</span> %</td>";
@ -2925,7 +3022,7 @@
})
}
</script>