diff --git a/index.html b/index.html index 6ba7e5f..5c3120d 100644 --- a/index.html +++ b/index.html @@ -71,6 +71,34 @@ date: "2016/12/04 0:0", toDate: "2016/12/05 0:0", fillColor: "#f08080", fillAlpha: 0.1, lineAlpha: 0 }]; + + sensors = [ + [ 1, "HSJ入口"], [ 2, "実験室LB"], + [ 4, "実験室RB"], [11, "ist準備室"], + [12, "ML2"], [13, "ML1"], + [14, "GRL"], [19, "サーバ室"], + [16, "HUB ML2"], [17, "HUB ML1"], + [18, "HUB GRL"], [15, "窓"], + [08, "外気1"], [20, "外気2"], + ]; + + tempgraphs = []; + humidgraphs = []; + for (idx in sensors) { + var sensor = sensors[idx]; + var k = {"type": "line", "valueField": "temp-" + sensor[0], + "title": sensor[1], + "balloonText": "" + sensor[1] + " [[value]]℃" } + tempgraphs.push(k); + humidgraphs.push( + {"type": "line", "valueField": "humid-" + sensor[0], + "title": sensor[1], + "balloonText": "" + sensor[1] + " [[value]]%" } + ); + } + tempgraphs[tempgraphs.length-1].id = "tempscale"; + humidgraphs[humidgraphs.length-1].id = "humidscale"; + var tempchart= AmCharts.makeChart("tempdiv", { "type": "serial", "dataProvider": data, @@ -160,38 +188,8 @@ { title => 'ist', dir => '11', group => 'I', }, { title => 'SRV', dir => '19', group => 'I', }, */ "colors": colorss, - "graphs": [ - {"type":"line", "valueField": "temp-1", "title": "01 ent H", - "balloonText": "01 ent: [[value]]℃", }, - {"type":"line", "valueField": "temp-2", "title": "02 LB L", - "balloonText": "02 LB: [[value]]℃", }, - {"type":"line", "valueField": "temp-4", "title": "04 RB R", - "balloonText": "04 RB: [[value]]℃", }, - {"type":"line", "valueField": "temp-11", "title": "11 ist準備", - "balloonText": "11 ist: [[value]]℃", }, - {"type":"line", "valueField": "temp-12", "title": "12 ML2", - "balloonText": "12 ML2: [[value]]℃", }, - {"type":"line", "valueField": "temp-13", "title": "13 ML1", - "balloonText": "13 ML1: [[value]]℃", }, - {"type":"line", "valueField": "temp-14", "title": "14 GRL", - "balloonText": "14 GRL: [[value]]℃", }, - {"type":"line", "valueField": "temp-19", "title": "19 サーバ", - "balloonText": "19 サーバ: [[value]]℃", }, - {"type":"line", "valueField": "temp-16", "title": "16 領域3 F", - "balloonText": "16 領域3: [[value]]℃", }, - {"type":"line", "valueField": "temp-17", "title": "17 領域2 F", - "balloonText": "17 領域2: [[value]]℃", }, - {"type":"line", "valueField": "temp-18", "title": "18 領域1 F", - "balloonText": "18 領域1: [[value]]℃", }, - {"type":"line", "valueField": "temp-15", "title": "15 win O", - "balloonText": "15 win: [[value]]℃", }, - {"type":"line", "valueField": "temp-8", "title": "08 out", - "balloonText": "08 out: [[value]]℃", }, - {"type":"line", "valueField": "temp-20", - "balloonText": "20 out: [[value]]℃", - "title": "20 out", "id": "tempscale" }, - ] - }); + "graphs": tempgraphs + }); var humidchart = AmCharts.makeChart("humiddiv", { "type": "serial", @@ -251,38 +249,7 @@ "rollOverGraphAlpha": 0.2, }, "colors": colorss, - "graphs": [ - {"type":"line", "valueField": "humid-1", "title": "01 ent H", - "balloonText": "01 ent: [[value]]%"}, - {"type":"line", "valueField": "humid-2", "title": "02 LB L", - "balloonText": "02 LB: [[value]]%"}, - {"type":"line", "valueField": "humid-4", "title": "04 RB R", - "balloonText": "04 RB: [[value]]%"}, - {"type":"line", "valueField": "humid-11", "title": "11 ist", - "balloonText": "11 ist: [[value]]%"}, - {"type":"line", "valueField": "humid-12", "title": "12 ML2", - "balloonText": "12 ML2: [[value]]%"}, - {"type":"line", "valueField": "humid-13", "title": "13 ML1", - "balloonText": "13 ML1: [[value]]%"}, - {"type":"line", "valueField": "humid-14", "title": "14 GRL", - "balloonText": "14 GRL: [[value]]%"}, - {"type":"line", "valueField": "humid-19", "title": "19 サーバ", - "balloonText": "19 サーバ: [[value]]%"}, - {"type":"line", "valueField": "humid-16", "title": "16 領域3", - "balloonText": "16 領域3: [[value]]%"}, - {"type":"line", "valueField": "humid-17", "title": "17 領域2", - "balloonText": "17 領域2: [[value]]%"}, - {"type":"line", "valueField": "humid-18", "title": "18 領域1", - "balloonText": "18 領域1: [[value]]%"}, - {"type":"line", "valueField": "humid-15", "title": "15 win O", - "balloonText": "15 win: [[value]]%"}, - {"type":"line", "valueField": "humid-8", "title": "08 out", - "balloonText": "08 out : [[value]]%"}, - {"type":"line", "valueField": "humid-20", - "balloonText": "20 out: [[value]]%", - "title": "20 out", "id": "humidscale" - }, - ] + "graphs": humidgraphs, }); function syncCursors(e) {