diff options
Diffstat (limited to 'ebus/webapp')
-rw-r--r-- | ebus/webapp/static/ebus.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ebus/webapp/static/ebus.js b/ebus/webapp/static/ebus.js index 32e9f3a..b334144 100644 --- a/ebus/webapp/static/ebus.js +++ b/ebus/webapp/static/ebus.js @@ -32,8 +32,9 @@ $(document).ready(function(){ shadowSize: 0 }, xaxis: { mode: "time" }, - yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 }, - selection: { mode: "x" } + yaxis: { ticks: [], min: 0, max: 100, autoscaleMargin: 0.1 }, + legend: { show: false }, + selection: { mode: "x" } }); } else { plotOverview.setData(datasetOverview); @@ -64,13 +65,12 @@ $(document).ready(function(){ var unplotSensorDetail = function(sensorname) { $.each(datasetDetail, function(i, sensor) { - alert(datasetDetail[i].label); if (sensor.label == sensorname) { - indexFound = i; + datasetDetail.splice(i,1); + replot(); + return false; } }); - datasetDetail.splice(indexFound,1); - replot(); }; var plotSensorOverview = function(sensorname) { @@ -78,7 +78,7 @@ $(document).ready(function(){ function(response) { if (response['data']) { datasetOverview.push({'data':response['data'], - 'label':null}); + 'label':sensorname}); replotOverview(); } else { alert("Overview Fehler: " + response["error"]); @@ -88,12 +88,12 @@ $(document).ready(function(){ }; var unplotSensorOverview = function(sensorname) { $.each(datasetOverview, function(i, sensor) { - if (datasetOverview[i].label == sensorname) { - indexFound = i; + if (sensor.label == sensorname) { + datasetOverview.splice(i,1); + replotOverview(); + return false; } }); - datasetOverview.splice(indexFound,1); - replotOverview(); } $("#overview").bind("plotselected", function (event, ranges) { |