Merge branch 'Willy'

This commit is contained in:
b110212000 2021-07-12 18:39:50 +08:00
commit c44ca18f18

View File

@ -2011,8 +2011,10 @@
var listmonth = new Array(0);
var listkwh = new Array(0);
var listcolor = new Array(0);
var listcolor2 = new Array(0);
var listirradiance = new Array(0);
var color = rgba(1);
var color2 = rgba(2);
$.each(rel.data, function (index, val) {
TimestampALL = val.totaltime;
kwhALL += val.kwh;
@ -2032,6 +2034,7 @@
listmonth.push(val.timestamp);
listkwh.push(val.kwh);
listcolor.push(color);
listcolor2.push(color2);
listirradiance.push(val.irradiance);
}
})
@ -2046,26 +2049,56 @@
data: {
labels: listmonth,
datasets: [{
backgroundColor: listcolor,
type: 'line',
label: '日照度(kWh/㎡)',
borderColor: listcolor,
borderWidth: 1,
label: '發電量(kWh)',
data: listkwh
pointRadius: 4,
yAxisID: 'B',
fill: false,
data: listirradiance
}, {
type: 'line',
label: '日照度(kWh/m2)',
fill: false,
data: listirradiance
type: 'bar',
borderColor: listcolor2,
backgroundColor: listcolor2,
borderWidth: 1,
label: '發電量(kWh)',
yAxisID: 'A',
data: listkwh
}]
},
options: {
title: {
display: true,
text: '發電量(kWh)'
text: '發電量及日照度'
},
legend: {
display: true,
position: 'bottom'
},
scales: {
yAxes: [{
id: 'A',
type: 'linear',
position: 'left',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: 'kWh'
}
}, {
id: 'B',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: 'kWh/㎡'
}
}]
}
}
});