From b6538e5d0f9b5fa58f8d94b33d8b7912471c0102 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 21 Jul 2011 21:58:19 +0200 Subject: =?UTF-8?q?ausblenden=20von=20datens=C3=A4tzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebus/webapp/static/ebus.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'ebus/webapp/static/ebus.js') 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) { -- cgit v1.2.1