diff options
author | marc <marc@thinkpad.localnet.cc> | 2011-07-19 23:29:19 +0200 |
---|---|---|
committer | marc <marc@thinkpad.localnet.cc> | 2011-07-19 23:29:19 +0200 |
commit | 43145b8d951078d202367e9eee3f2a0bac67e4ae (patch) | |
tree | c2a097a60c34393a1e9a6f783f01c0d67c46426a /ebus | |
parent | 4f75de9393cf3be232f92d80ae09ddc162867785 (diff) | |
download | ebus-alt-43145b8d951078d202367e9eee3f2a0bac67e4ae.tar.gz ebus-alt-43145b8d951078d202367e9eee3f2a0bac67e4ae.zip |
Ein-/Ausblenden eines Datensatzes; Skalierung funktioniert beim Einblenden nicht
Diffstat (limited to 'ebus')
-rw-r--r-- | ebus/webapp/static/ebus.js | 35 | ||||
-rw-r--r-- | ebus/webapp/static/index.html | 3 |
2 files changed, 29 insertions, 9 deletions
diff --git a/ebus/webapp/static/ebus.js b/ebus/webapp/static/ebus.js index e108f0a..15fe692 100644 --- a/ebus/webapp/static/ebus.js +++ b/ebus/webapp/static/ebus.js @@ -6,6 +6,7 @@ $(document).ready(function(){ var datasetOverview = []; var plotOverview = null; var plotDetail = null; + var indexFound = null; var replot = function() { if (plotDetail == null) { @@ -60,9 +61,18 @@ $(document).ready(function(){ } }); }; + var unplotSensorDetail = function(sensorname) { - + $.each(datasetDetail, function(i, sensor) { + alert(datasetDetail[i].label); + if (sensor.label == sensorname) { + indexFound = i; + } + }); + datasetDetail.splice(indexFound,1); + replot(); }; + var plotSensorOverview = function(sensorname) { $.getJSON("sensor_cached/"+escape(sensorname)+"/"+fromOverview, //+"/"+to, function(response) { @@ -76,6 +86,15 @@ $(document).ready(function(){ }); }; + var unplotSensorOverview = function(sensorname) { + $.each(datasetOverview, function(i, sensor) { + if (datasetOverview[i].label == sensorname) { + indexFound = i; + } + }); + datasetOverview.splice(indexFound,1); + replotOverview(); + } $("#overview").bind("plotselected", function (event, ranges) { range_from = Math.round(ranges.xaxis.from / 1000); @@ -103,12 +122,12 @@ $(document).ready(function(){ plotSensor("heizkreisregler10.betriebsdatenRegler1.kesselTemperatur"); plotSensor("feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur"); // TODO http://people.iola.dk/olau/flot/examples/annotating.html - $('#button').click(function() { - $.each(datasetDetail, function(i, sensor) { - if (datasetDetail[i].label == "heizkreisregler9.solarDaten.tempKollektor") { - datasetDetail.splice(i,1); - replot(); - } - }); + + + $('#ausblenden').click(function() { + unplotSensor("heizkreisregler9.solarDaten.tempKollektor"); + }); + $('#einblenden').click(function() { + plotSensor("heizkreisregler9.solarDaten.tempKollektor"); }); }); diff --git a/ebus/webapp/static/index.html b/ebus/webapp/static/index.html index e385865..7e2582d 100644 --- a/ebus/webapp/static/index.html +++ b/ebus/webapp/static/index.html @@ -9,6 +9,7 @@ <body> <div id="ebusgraph"></div> <div id="overview"></div> - <div id="button">ausblenden</div> + <div id="ausblenden">ausblenden</div> + <div id="einblenden">einblenden</div> </body> </html> |