Showing
1 changed file
with
89 additions
and
35 deletions
... | @@ -110,24 +110,27 @@ | ... | @@ -110,24 +110,27 @@ |
110 | time = new Date().getTime(); | 110 | time = new Date().getTime(); |
111 | var length= <%=dataLen%>; | 111 | var length= <%=dataLen%>; |
112 | var i=-9; | 112 | var i=-9; |
113 | - for(i;i<-9+length;i++) | 113 | + var j=0; |
114 | + for(j;j<10-length;j++) | ||
114 | { | 115 | { |
115 | deathArr.push({ | 116 | deathArr.push({ |
116 | x: time + i * 60000, | 117 | x: time + i * 60000, |
117 | y: 0 | 118 | y: 0 |
118 | }) | 119 | }) |
120 | + i++; | ||
119 | } | 121 | } |
120 | 122 | ||
121 | <%probArr.forEach((probArr)=>{%> | 123 | <%probArr.forEach((probArr)=>{%> |
122 | temp; | 124 | temp; |
123 | temp= <%=probArr%>; | 125 | temp= <%=probArr%>; |
124 | 126 | ||
125 | - for(i+1;i<=0;i++) | 127 | + for(j;j<10;j++) |
126 | { | 128 | { |
127 | deathArr.push({ | 129 | deathArr.push({ |
128 | x: time + i * 60000, | 130 | x: time + i * 60000, |
129 | y: temp | 131 | y: temp |
130 | }) | 132 | }) |
133 | + j++; | ||
131 | } | 134 | } |
132 | <%})%> | 135 | <%})%> |
133 | 136 | ||
... | @@ -153,7 +156,7 @@ | ... | @@ -153,7 +156,7 @@ |
153 | var x = new Date().getTime(), // 현재 시간 | 156 | var x = new Date().getTime(), // 현재 시간 |
154 | y = Math.random(); // | 157 | y = Math.random(); // |
155 | series.addPoint([x, y], true, true); | 158 | series.addPoint([x, y], true, true); |
156 | - }, 3000); //1000=1초 | 159 | + }, 60000); //1000=1초 |
157 | } | 160 | } |
158 | } | 161 | } |
159 | }, | 162 | }, |
... | @@ -205,18 +208,35 @@ | ... | @@ -205,18 +208,35 @@ |
205 | { | 208 | { |
206 | name: "기온", | 209 | name: "기온", |
207 | data: (function() { | 210 | data: (function() { |
208 | - // generate an array of random data | 211 | + var tempArr = [], |
209 | - var data = [], | 212 | + time = new Date().getTime(); |
210 | - time = new Date().getTime(), | 213 | + var length= <%=dataLen%>; |
211 | - i; | 214 | + var i=-9; |
212 | - | 215 | + var j=0; |
213 | - for (i = -19; i <= 0; i += 1) { | 216 | + for(j;j<10-length;j++) |
214 | - data.push({ | 217 | + { |
215 | - x: time + i * 3000, | 218 | + tempArr.push({ |
219 | + x: time + i * 60000, | ||
216 | y: 0 | 220 | y: 0 |
217 | - }); | 221 | + }) |
222 | + i++; | ||
218 | } | 223 | } |
219 | - return data; | 224 | + |
225 | + <%ptArr.forEach((ptArr)=>{%> | ||
226 | + temp; | ||
227 | + temp= <%=ptArr%>; | ||
228 | + | ||
229 | + for(j;j<10;j++) | ||
230 | + { | ||
231 | + tempArr.push({ | ||
232 | + x: time + i * 60000, | ||
233 | + y: temp | ||
234 | + }) | ||
235 | + j++; | ||
236 | + } | ||
237 | + <%})%> | ||
238 | + | ||
239 | + return tempArr; | ||
220 | })() | 240 | })() |
221 | } | 241 | } |
222 | ] | 242 | ] |
... | @@ -238,7 +258,7 @@ | ... | @@ -238,7 +258,7 @@ |
238 | var x = new Date().getTime(), // 현재 시간 | 258 | var x = new Date().getTime(), // 현재 시간 |
239 | y = Math.random(); // | 259 | y = Math.random(); // |
240 | series.addPoint([x, y], true, true); | 260 | series.addPoint([x, y], true, true); |
241 | - }, 3000); //1000=1초 | 261 | + }, 60000); //1000=1초 |
242 | } | 262 | } |
243 | } | 263 | } |
244 | }, | 264 | }, |
... | @@ -290,18 +310,35 @@ | ... | @@ -290,18 +310,35 @@ |
290 | { | 310 | { |
291 | name: "풍속", | 311 | name: "풍속", |
292 | data: (function() { | 312 | data: (function() { |
293 | - // generate an array of random data | 313 | + var windArr = [], |
294 | - var data = [], | 314 | + time = new Date().getTime(); |
295 | - time = new Date().getTime(), | 315 | + var length= <%=dataLen%>; |
296 | - i; | 316 | + var i=-9; |
297 | - | 317 | + var j=0; |
298 | - for (i = -19; i <= 0; i += 1) { | 318 | + for(j;j<10-length;j++) |
299 | - data.push({ | 319 | + { |
300 | - x: time + i * 3000, | 320 | + windArr.push({ |
321 | + x: time + i * 60000, | ||
301 | y: 0 | 322 | y: 0 |
302 | - }); | 323 | + }) |
324 | + i++; | ||
325 | + } | ||
326 | + | ||
327 | + <%wsArr.forEach((wsArr)=>{%> | ||
328 | + temp; | ||
329 | + temp= <%=wsArr%>; | ||
330 | + | ||
331 | + for(j;j<10;j++) | ||
332 | + { | ||
333 | + windArr.push({ | ||
334 | + x: time + i * 60000, | ||
335 | + y: temp | ||
336 | + }) | ||
337 | + j++; | ||
303 | } | 338 | } |
304 | - return data; | 339 | + <%})%> |
340 | + | ||
341 | + return windArr; | ||
305 | })() | 342 | })() |
306 | } | 343 | } |
307 | ] | 344 | ] |
... | @@ -323,7 +360,7 @@ | ... | @@ -323,7 +360,7 @@ |
323 | var x = new Date().getTime(), // 현재 시간 | 360 | var x = new Date().getTime(), // 현재 시간 |
324 | y = Math.random(); // | 361 | y = Math.random(); // |
325 | series.addPoint([x, y], true, true); | 362 | series.addPoint([x, y], true, true); |
326 | - }, 3000); //1000=1초 | 363 | + }, 60000); //1000=1초 |
327 | } | 364 | } |
328 | } | 365 | } |
329 | }, | 366 | }, |
... | @@ -375,18 +412,35 @@ | ... | @@ -375,18 +412,35 @@ |
375 | { | 412 | { |
376 | name: "강수량", | 413 | name: "강수량", |
377 | data: (function() { | 414 | data: (function() { |
378 | - // generate an array of random data | 415 | + var rainArr = [], |
379 | - var data = [], | 416 | + time = new Date().getTime(); |
380 | - time = new Date().getTime(), | 417 | + var length= <%=dataLen%>; |
381 | - i; | 418 | + var i=-9; |
382 | - | 419 | + var j=0; |
383 | - for (i = -19; i <= 0; i += 1) { | 420 | + for(j;j<10-length;j++) |
384 | - data.push({ | 421 | + { |
385 | - x: time + i * 3000, | 422 | + rainArr.push({ |
423 | + x: time + i * 60000, | ||
386 | y: 0 | 424 | y: 0 |
387 | - }); | 425 | + }) |
426 | + i++; | ||
388 | } | 427 | } |
389 | - return data; | 428 | + |
429 | + <%rainArr.forEach((rainArr)=>{%> | ||
430 | + temp; | ||
431 | + temp= <%=rainArr%>; | ||
432 | + | ||
433 | + for(j;j<10;j++) | ||
434 | + { | ||
435 | + rainArr.push({ | ||
436 | + x: time + i * 60000, | ||
437 | + y: temp | ||
438 | + }) | ||
439 | + j++; | ||
440 | + } | ||
441 | + <%})%> | ||
442 | + | ||
443 | + return rainArr; | ||
390 | })() | 444 | })() |
391 | } | 445 | } |
392 | ] | 446 | ] | ... | ... |
-
Please register or login to post a comment