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>
@ -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 @@
}]
}
}
});
});*@