X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=raspberry-kiosk%2Fkiosk.js;h=457a3590666cdd430220c5fc4d18fcf2f5fca627;hb=50d8b89aad9fc4349fb277de9e5620ba27724057;hp=8919004ad84f51d015fa2f269bbb06c17c0c883f;hpb=2d2b56de27b644964adcd5b8f90c03e558714547;p=svn42.git diff --git a/raspberry-kiosk/kiosk.js b/raspberry-kiosk/kiosk.js index 8919004..457a359 100644 --- a/raspberry-kiosk/kiosk.js +++ b/raspberry-kiosk/kiosk.js @@ -166,10 +166,10 @@ function loadCalendarMainPage() var gauges = {} function drawGauge(targetelem, label, temp, options) { - var data = google.visualization.arrayToDataTable([["Label", "Value"],[label,temp]]); // Create and draw the visualization. if (targetelem) { + var data = google.visualization.arrayToDataTable([["Label", "Value"],[label,temp]]); options["width"] = targetelem.getAttribute("width"); options["height"] = targetelem.getAttribute("height"); if (!gauges.hasOwnProperty(targetelem.id)) { @@ -216,7 +216,7 @@ function loadAndDrawSensorData() { drawLineGraph(document.getElementById('lightgooglegraph'), data["IlluminationSensorUpdate"], {curveType: "none", title: 'Illumination Sensors', vAxis: {maxValue: 1024, minValue:5}, chartArea:{left:32,top:20,width:"88%",height:"83%"}, legend: {position: "none"}} ,true); drawLineGraph(document.getElementById('movementgooglegraph'), data["MovementSensorUpdate"], - {curveType: "none", title: 'Movement Sensors', vAxis: {maxValue: 10, minValue:0}, chartArea:{left:32,top:20,width:"88%",height:"83%"}, legend: {position: "none"}} ,true); + {curveType: "function", title: 'Movement Sensors', vAxis: {maxValue: 10, minValue:0}, chartArea:{left:32,top:20,width:"88%",height:"83%"}, legend: {position: "none"}} ,true); }); } @@ -423,11 +423,11 @@ $(document).ready(function() loadCalendarMainPage(); setInterval("loadCalendarMainPage()", 123*1000); } - if (document.getElementById("sensorgraphs")) - { - setInterval("updateSensors()",145*1000); - } - if (document.getElementById("tempgooglegraph") || document.getElementById("lightgooglegraph")) +// if (document.getElementById("sensorgraphs")) +// { +// setInterval("updateSensors()",145*1000); +// } + if (document.getElementById("tempgooglegraph") || document.getElementById("lightgooglegraph") || document.getElementById("movementgooglegraph")) { loadAndDrawSensorData(); setInterval("loadAndDrawSensorData()",145*1000);