|
|
@ -141,29 +141,33 @@ function updateGraphs(stats) {
|
|
|
|
updateFanGraph(convertStateStatsToGraphData(fanData));
|
|
|
|
updateFanGraph(convertStateStatsToGraphData(fanData));
|
|
|
|
|
|
|
|
|
|
|
|
var bulbData = stats['bulbData'];
|
|
|
|
var bulbData = stats['bulbData'];
|
|
|
|
console.log("bulbData...");
|
|
|
|
|
|
|
|
console.log(bulbData);
|
|
|
|
|
|
|
|
updateBulbGraph(convertStateStatsToGraphData(bulbData));
|
|
|
|
updateBulbGraph(convertStateStatsToGraphData(bulbData));
|
|
|
|
|
|
|
|
|
|
|
|
scaleGraphs();
|
|
|
|
scaleGraphs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function scaleGraphs() {
|
|
|
|
function scaleGraphs() {
|
|
|
|
|
|
|
|
var sliders = $('.right_handle');
|
|
|
|
|
|
|
|
if (sliders.length == 0){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var graphWidth = $('#canvas-wrapper1').width() - 50;
|
|
|
|
//Scale graphs
|
|
|
|
//Scale graphs
|
|
|
|
var sliderX = 1110 * 60 * 60 / (toDate - fromDate);
|
|
|
|
var sliderX = graphWidth * 60 * 60 / (toDate - fromDate);
|
|
|
|
if (sliderX < 1110) {
|
|
|
|
if (sliderX < graphWidth) {
|
|
|
|
// fake handle move
|
|
|
|
// fake handle move
|
|
|
|
if (sliderX < 100) {
|
|
|
|
if (sliderX < 100) {
|
|
|
|
sliderX = 100;
|
|
|
|
sliderX = 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var edown = document.createEvent("HTMLEvents");
|
|
|
|
var edown = document.createEvent("HTMLEvents");
|
|
|
|
edown.initEvent("mousedown", true, true);
|
|
|
|
edown.initEvent("mousedown", true, true);
|
|
|
|
edown.clientX = 1160;
|
|
|
|
edown.clientX = graphWidth;
|
|
|
|
var emove = document.createEvent("HTMLEvents");
|
|
|
|
var emove = document.createEvent("HTMLEvents");
|
|
|
|
emove.initEvent("mousemove", true, true);
|
|
|
|
emove.initEvent("mousemove", true, true);
|
|
|
|
emove.clientX = sliderX;
|
|
|
|
emove.clientX = sliderX;
|
|
|
|
var eup = document.createEvent("HTMLEvents");
|
|
|
|
var eup = document.createEvent("HTMLEvents");
|
|
|
|
eup.initEvent("mouseup", true, true);
|
|
|
|
eup.initEvent("mouseup", true, true);
|
|
|
|
var sliders = $('.right_handle');
|
|
|
|
|
|
|
|
for (var slider in sliders) {
|
|
|
|
for (var slider in sliders) {
|
|
|
|
sliders[slider].dispatchEvent(edown);
|
|
|
|
sliders[slider].dispatchEvent(edown);
|
|
|
|
document.dispatchEvent(emove);
|
|
|
|
document.dispatchEvent(emove);
|
|
|
|