Fixed the range of the lights graph y axis (255 before 100 max after)
This commit is contained in:
parent
120a0e3efd
commit
ba63edfc5f
2 changed files with 13 additions and 10 deletions
|
@ -13,6 +13,7 @@ tabTDE.classList.remove("visible");
|
||||||
amain.classList.add("pure-button-primary");
|
amain.classList.add("pure-button-primary");
|
||||||
acfg.classList.remove("pure-button-primary");
|
acfg.classList.remove("pure-button-primary");
|
||||||
atde.classList.remove("pure-button-primary");
|
atde.classList.remove("pure-button-primary");
|
||||||
|
loadGraphData();
|
||||||
});
|
});
|
||||||
acfg.addEventListener("click", function() {
|
acfg.addEventListener("click", function() {
|
||||||
tabMain.classList.remove("visible");
|
tabMain.classList.remove("visible");
|
||||||
|
@ -50,10 +51,10 @@ var channel3 = [];
|
||||||
var channel4 = [];
|
var channel4 = [];
|
||||||
for (var i = 0; i < data['tcdata'].length; i++) {
|
for (var i = 0; i < data['tcdata'].length; i++) {
|
||||||
time.push(data['tcdata'][i]['hour'] + ':' + (data['tcdata'][i]['min'] < 10 ? '0' : '') + data['tcdata'][i]['min']);
|
time.push(data['tcdata'][i]['hour'] + ':' + (data['tcdata'][i]['min'] < 10 ? '0' : '') + data['tcdata'][i]['min']);
|
||||||
channel1.push(data['tcdata'][i]['ch1']);
|
channel1.push(data['tcdata'][i]['ch1'] * 100 / 255);
|
||||||
channel2.push(data['tcdata'][i]['ch2']);
|
channel2.push(data['tcdata'][i]['ch2'] * 100 / 255);
|
||||||
channel3.push(data['tcdata'][i]['ch3']);
|
channel3.push(data['tcdata'][i]['ch3'] * 100 / 255);
|
||||||
channel4.push(data['tcdata'][i]['ch4']);
|
channel4.push(data['tcdata'][i]['ch4'] * 100 / 255);
|
||||||
}
|
}
|
||||||
currenttime.push(data['currenttime']['hour']);
|
currenttime.push(data['currenttime']['hour']);
|
||||||
currenttime.push(data['currenttime']['min']);
|
currenttime.push(data['currenttime']['min']);
|
||||||
|
@ -130,7 +131,7 @@ tickangle: -45,
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Brightness',
|
title: 'Brightness',
|
||||||
range: [0, 255],
|
range: [0, 100],
|
||||||
},
|
},
|
||||||
shapes: [{
|
shapes: [{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|
|
@ -19,6 +19,8 @@ function addTabListener() {
|
||||||
amain.classList.add("pure-button-primary");
|
amain.classList.add("pure-button-primary");
|
||||||
acfg.classList.remove("pure-button-primary");
|
acfg.classList.remove("pure-button-primary");
|
||||||
atde.classList.remove("pure-button-primary");
|
atde.classList.remove("pure-button-primary");
|
||||||
|
|
||||||
|
loadGraphData(); // reload the graph
|
||||||
});
|
});
|
||||||
|
|
||||||
acfg.addEventListener("click", function() {
|
acfg.addEventListener("click", function() {
|
||||||
|
@ -64,10 +66,10 @@ function loadGraphData() {
|
||||||
var channel4 = [];
|
var channel4 = [];
|
||||||
for (var i = 0; i < data['tcdata'].length; i++) {
|
for (var i = 0; i < data['tcdata'].length; i++) {
|
||||||
time.push(data['tcdata'][i]['hour'] + ':' + (data['tcdata'][i]['min'] < 10 ? '0' : '') + data['tcdata'][i]['min']);
|
time.push(data['tcdata'][i]['hour'] + ':' + (data['tcdata'][i]['min'] < 10 ? '0' : '') + data['tcdata'][i]['min']);
|
||||||
channel1.push(data['tcdata'][i]['ch1']);
|
channel1.push(data['tcdata'][i]['ch1'] * 100 / 255);
|
||||||
channel2.push(data['tcdata'][i]['ch2']);
|
channel2.push(data['tcdata'][i]['ch2'] * 100 / 255);
|
||||||
channel3.push(data['tcdata'][i]['ch3']);
|
channel3.push(data['tcdata'][i]['ch3'] * 100 / 255);
|
||||||
channel4.push(data['tcdata'][i]['ch4']);
|
channel4.push(data['tcdata'][i]['ch4'] * 100 / 255);
|
||||||
}
|
}
|
||||||
currenttime.push(data['currenttime']['hour']);
|
currenttime.push(data['currenttime']['hour']);
|
||||||
currenttime.push(data['currenttime']['min']);
|
currenttime.push(data['currenttime']['min']);
|
||||||
|
@ -155,7 +157,7 @@ function loadGraphData() {
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Brightness',
|
title: 'Brightness',
|
||||||
range: [0, 255],
|
range: [0, 100],
|
||||||
},
|
},
|
||||||
shapes: [{
|
shapes: [{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|
Loading…
Reference in a new issue