Showing
1 changed file
with
137 additions
and
80 deletions
| ... | @@ -3,12 +3,10 @@ | ... | @@ -3,12 +3,10 @@ |
| 3 | <head> | 3 | <head> |
| 4 | <!-- font --> | 4 | <!-- font --> |
| 5 | <link href="https://fonts.googleapis.com/css?family=Nanum+Brush+Script&subset=korean" rel="stylesheet" /> | 5 | <link href="https://fonts.googleapis.com/css?family=Nanum+Brush+Script&subset=korean" rel="stylesheet" /> |
| 6 | - <link href="https://fonts.googleapis.com/css?family=Yeon+Sung&subset=korean" rel="stylesheet" /> | 6 | + <link href="https://fonts.googleapis.com/css?family=Do+Hyeon&display=swap" rel="stylesheet"> |
| 7 | - | ||
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 9 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 8 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 10 | <title>Highcharts Example</title> | 9 | <title>Highcharts Example</title> |
| 11 | - | ||
| 12 | <style type="text/css"> | 10 | <style type="text/css"> |
| 13 | html { | 11 | html { |
| 14 | margin: 0; | 12 | margin: 0; |
| ... | @@ -17,10 +15,9 @@ | ... | @@ -17,10 +15,9 @@ |
| 17 | body { | 15 | body { |
| 18 | margin: 0; | 16 | margin: 0; |
| 19 | padding: 0; | 17 | padding: 0; |
| 20 | - | ||
| 21 | /* background: linear-gradient( to bottom, #65799B, rgb(38, 14, 41) ); */ | 18 | /* background: linear-gradient( to bottom, #65799B, rgb(38, 14, 41) ); */ |
| 22 | /* background-color:#65799B; */ | 19 | /* background-color:#65799B; */ |
| 23 | - /* background-image: url("2.jpg"); | 20 | + /* background-image: url("2.jpg"); */ |
| 24 | background-repeat: no-repeat; | 21 | background-repeat: no-repeat; |
| 25 | background-size: cover; */ | 22 | background-size: cover; */ |
| 26 | } | 23 | } |
| ... | @@ -29,20 +26,15 @@ | ... | @@ -29,20 +26,15 @@ |
| 29 | top: 0; | 26 | top: 0; |
| 30 | width: 100%; | 27 | width: 100%; |
| 31 | } | 28 | } |
| 32 | - | ||
| 33 | </style> | 29 | </style> |
| 34 | </head> | 30 | </head> |
| 35 | - | ||
| 36 | <body> | 31 | <body> |
| 37 | <script src="highcharts.js"></script> | 32 | <script src="highcharts.js"></script> |
| 38 | <script src="modules/exporting.js"></script> | 33 | <script src="modules/exporting.js"></script> |
| 39 | <script src="modules/export-data.js"></script> | 34 | <script src="modules/export-data.js"></script> |
| 40 | - | ||
| 41 | <img src="images/newbackground.png" alt="" style="z-index:-1; min-width: 100%; min-height: 100%"> | 35 | <img src="images/newbackground.png" alt="" style="z-index:-1; min-width: 100%; min-height: 100%"> |
| 42 | - | ||
| 43 | <div id="banner"> | 36 | <div id="banner"> |
| 44 | <div id="container1" style="width:1260px; height: 400px; margin: 0 auto;"></div> | 37 | <div id="container1" style="width:1260px; height: 400px; margin: 0 auto;"></div> |
| 45 | - | ||
| 46 | <div style="width:1275px; margin:0 auto;"> | 38 | <div style="width:1275px; margin:0 auto;"> |
| 47 | <div style="display: inline-block;"> | 39 | <div style="display: inline-block;"> |
| 48 | <div id="container2" style="width:400px; height: 300px; padding:0; margin-left:0px;margin-right: 30px;"></div> | 40 | <div id="container2" style="width:400px; height: 300px; padding:0; margin-left:0px;margin-right: 30px;"></div> |
| ... | @@ -50,12 +42,13 @@ | ... | @@ -50,12 +42,13 @@ |
| 50 | <div style="display: inline-block;"> | 42 | <div style="display: inline-block;"> |
| 51 | <div id="container3" style="width:400px; height: 300px; padding:0; margin-left:0px;margin-right: 30px;"></div> | 43 | <div id="container3" style="width:400px; height: 300px; padding:0; margin-left:0px;margin-right: 30px;"></div> |
| 52 | </div> | 44 | </div> |
| 53 | - | ||
| 54 | <div style="display: inline-block;"> | 45 | <div style="display: inline-block;"> |
| 55 | <div id="container4" style="width:400px; height: 300px; padding:0; margin-left:0px;"></div> | 46 | <div id="container4" style="width:400px; height: 300px; padding:0; margin-left:0px;"></div> |
| 56 | </div> | 47 | </div> |
| 48 | + <div style="display: inline-block;"> | ||
| 49 | + <div id="container5" style="width:400px; height: 300px; padding:0; margin-left:0px;margin-right: 30px;"></div> | ||
| 50 | + </div> | ||
| 57 | </div> | 51 | </div> |
| 58 | - | ||
| 59 | <script src="/socket.io/socket.io.js"></script> | 52 | <script src="/socket.io/socket.io.js"></script> |
| 60 | <script type="text/javascript"> | 53 | <script type="text/javascript"> |
| 61 | let client_data = { | 54 | let client_data = { |
| ... | @@ -63,7 +56,6 @@ | ... | @@ -63,7 +56,6 @@ |
| 63 | name: "<%=name%>" | 56 | name: "<%=name%>" |
| 64 | } | 57 | } |
| 65 | 58 | ||
| 66 | - | ||
| 67 | var chart1 = Highcharts.chart("container1", { | 59 | var chart1 = Highcharts.chart("container1", { |
| 68 | chart: { | 60 | chart: { |
| 69 | type: "spline", | 61 | type: "spline", |
| ... | @@ -75,25 +67,22 @@ | ... | @@ -75,25 +67,22 @@ |
| 75 | // var series = this.series[0]; | 67 | // var series = this.series[0]; |
| 76 | // setInterval(function () { | 68 | // setInterval(function () { |
| 77 | // var x = new Date().getTime(), // 현재 시간 | 69 | // var x = new Date().getTime(), // 현재 시간 |
| 78 | - // y = Math.random(); //여기에 새로 넣을 값 | 70 | + // y = Math.random(); //여기에 새로 넣을 값(실시간 사망률) |
| 79 | // series.addPoint({x:x,y:y,color:"#FFE08C"}, true, true); | 71 | // series.addPoint({x:x,y:y,color:"#FFE08C"}, true, true); |
| 80 | // }, 1000); //1000=1초 -> 1분=60000 | 72 | // }, 1000); //1000=1초 -> 1분=60000 |
| 81 | // } | 73 | // } |
| 82 | // }, | 74 | // }, |
| 83 | - | ||
| 84 | backgroundColor: "rgba(255, 255, 255, 0.0)" | 75 | backgroundColor: "rgba(255, 255, 255, 0.0)" |
| 85 | }, | 76 | }, |
| 86 | - | ||
| 87 | time: { | 77 | time: { |
| 88 | useUTC: false | 78 | useUTC: false |
| 89 | }, | 79 | }, |
| 90 | - | ||
| 91 | title: { | 80 | title: { |
| 92 | text: "<%=name%>님의 실시간 사망 확률", | 81 | text: "<%=name%>님의 실시간 사망 확률", |
| 93 | style: { | 82 | style: { |
| 94 | color: "#FFFFFF", | 83 | color: "#FFFFFF", |
| 95 | - fontWeight: "bold", | 84 | + //fontWeight: "bold", |
| 96 | - fontFamily: 'Yeon Sung', | 85 | + fontFamily: 'Do Hyeon', |
| 97 | fontSize:'32px' | 86 | fontSize:'32px' |
| 98 | } | 87 | } |
| 99 | }, | 88 | }, |
| ... | @@ -113,7 +102,6 @@ | ... | @@ -113,7 +102,6 @@ |
| 113 | color: "white" | 102 | color: "white" |
| 114 | } | 103 | } |
| 115 | }, | 104 | }, |
| 116 | - | ||
| 117 | plotLines: [ | 105 | plotLines: [ |
| 118 | { | 106 | { |
| 119 | value: 0, | 107 | value: 0, |
| ... | @@ -126,7 +114,6 @@ | ... | @@ -126,7 +114,6 @@ |
| 126 | color: "white" | 114 | color: "white" |
| 127 | } | 115 | } |
| 128 | } | 116 | } |
| 129 | - | ||
| 130 | }, | 117 | }, |
| 131 | tooltip: { | 118 | tooltip: { |
| 132 | headerFormat: "<b>{series.name}</b><br/>", | 119 | headerFormat: "<b>{series.name}</b><br/>", |
| ... | @@ -148,7 +135,6 @@ | ... | @@ -148,7 +135,6 @@ |
| 148 | exporting: { | 135 | exporting: { |
| 149 | enabled: false | 136 | enabled: false |
| 150 | }, | 137 | }, |
| 151 | - | ||
| 152 | plotOptions: { | 138 | plotOptions: { |
| 153 | series: { | 139 | series: { |
| 154 | marker: { | 140 | marker: { |
| ... | @@ -156,7 +142,6 @@ plotOptions: { | ... | @@ -156,7 +142,6 @@ plotOptions: { |
| 156 | } | 142 | } |
| 157 | } | 143 | } |
| 158 | }, | 144 | }, |
| 159 | - | ||
| 160 | series: [ | 145 | series: [ |
| 161 | { | 146 | { |
| 162 | name: "사망률", | 147 | name: "사망률", |
| ... | @@ -173,11 +158,9 @@ plotOptions: { | ... | @@ -173,11 +158,9 @@ plotOptions: { |
| 173 | }) | 158 | }) |
| 174 | i++; | 159 | i++; |
| 175 | } | 160 | } |
| 176 | - | ||
| 177 | <% probArr.forEach((probArr) => {%> | 161 | <% probArr.forEach((probArr) => {%> |
| 178 | var temp; | 162 | var temp; |
| 179 | temp = <%=probArr %>; | 163 | temp = <%=probArr %>; |
| 180 | - | ||
| 181 | // for(;j<10;j++) | 164 | // for(;j<10;j++) |
| 182 | // { | 165 | // { |
| 183 | // deathArr.push({ | 166 | // deathArr.push({ |
| ... | @@ -186,25 +169,18 @@ plotOptions: { | ... | @@ -186,25 +169,18 @@ plotOptions: { |
| 186 | // }) | 169 | // }) |
| 187 | // i++; | 170 | // i++; |
| 188 | // } | 171 | // } |
| 189 | - | ||
| 190 | deathArr.push({ | 172 | deathArr.push({ |
| 191 | x: time + i * 60000, | 173 | x: time + i * 60000, |
| 192 | y: temp | 174 | y: temp |
| 193 | }) | 175 | }) |
| 194 | i++; | 176 | i++; |
| 195 | - | ||
| 196 | <%}) %> | 177 | <%}) %> |
| 197 | - | ||
| 198 | return deathArr; | 178 | return deathArr; |
| 199 | })(), | 179 | })(), |
| 200 | - | ||
| 201 | color: "#FFFFFF" | 180 | color: "#FFFFFF" |
| 202 | } | 181 | } |
| 203 | ] | 182 | ] |
| 204 | - | ||
| 205 | }); | 183 | }); |
| 206 | - | ||
| 207 | - | ||
| 208 | var chart2 = Highcharts.chart("container2", { | 184 | var chart2 = Highcharts.chart("container2", { |
| 209 | chart: { | 185 | chart: { |
| 210 | type: "spline", | 186 | type: "spline", |
| ... | @@ -221,23 +197,19 @@ plotOptions: { | ... | @@ -221,23 +197,19 @@ plotOptions: { |
| 221 | // }, 3000); //1000=1초 | 197 | // }, 3000); //1000=1초 |
| 222 | // } | 198 | // } |
| 223 | // }, | 199 | // }, |
| 224 | - | ||
| 225 | backgroundColor: "rgba(255, 255, 255, 0.0)" | 200 | backgroundColor: "rgba(255, 255, 255, 0.0)" |
| 226 | }, | 201 | }, |
| 227 | - | ||
| 228 | time: { | 202 | time: { |
| 229 | useUTC: false | 203 | useUTC: false |
| 230 | }, | 204 | }, |
| 231 | - | ||
| 232 | title: { | 205 | title: { |
| 233 | text: "기온", | 206 | text: "기온", |
| 234 | style: { | 207 | style: { |
| 235 | color: "#FFFFFF", | 208 | color: "#FFFFFF", |
| 236 | - fontWeight: "bold", | 209 | + //fontWeight: "bold", |
| 237 | - fontFamily: 'Yeon Sung', | 210 | + fontFamily: 'Do Hyeon', |
| 238 | fontSize:'25px' | 211 | fontSize:'25px' |
| 239 | } | 212 | } |
| 240 | - | ||
| 241 | }, | 213 | }, |
| 242 | xAxis: { | 214 | xAxis: { |
| 243 | type: "datetime", | 215 | type: "datetime", |
| ... | @@ -267,7 +239,6 @@ plotOptions: { | ... | @@ -267,7 +239,6 @@ plotOptions: { |
| 267 | color: "white" | 239 | color: "white" |
| 268 | } | 240 | } |
| 269 | } | 241 | } |
| 270 | - | ||
| 271 | }, | 242 | }, |
| 272 | tooltip: { | 243 | tooltip: { |
| 273 | headerFormat: "<b>{series.name}</b><br/>", | 244 | headerFormat: "<b>{series.name}</b><br/>", |
| ... | @@ -305,11 +276,9 @@ plotOptions: { | ... | @@ -305,11 +276,9 @@ plotOptions: { |
| 305 | }) | 276 | }) |
| 306 | i++; | 277 | i++; |
| 307 | } | 278 | } |
| 308 | - | ||
| 309 | <% ptArr.forEach((ptArr) => {%> | 279 | <% ptArr.forEach((ptArr) => {%> |
| 310 | var temp; | 280 | var temp; |
| 311 | temp = <%=ptArr %>; | 281 | temp = <%=ptArr %>; |
| 312 | - | ||
| 313 | // for(j;j<10;j++) | 282 | // for(j;j<10;j++) |
| 314 | // { | 283 | // { |
| 315 | // tempArr.push({ | 284 | // tempArr.push({ |
| ... | @@ -318,23 +287,18 @@ plotOptions: { | ... | @@ -318,23 +287,18 @@ plotOptions: { |
| 318 | // }) | 287 | // }) |
| 319 | // i++; | 288 | // i++; |
| 320 | // } | 289 | // } |
| 321 | - | ||
| 322 | tempArr.push({ | 290 | tempArr.push({ |
| 323 | x: time + i * 60000, | 291 | x: time + i * 60000, |
| 324 | y: temp | 292 | y: temp |
| 325 | }) | 293 | }) |
| 326 | i++; | 294 | i++; |
| 327 | - | ||
| 328 | <%}) %> | 295 | <%}) %> |
| 329 | - | ||
| 330 | return tempArr; | 296 | return tempArr; |
| 331 | })(), | 297 | })(), |
| 332 | - | ||
| 333 | color: "#FFE08C" | 298 | color: "#FFE08C" |
| 334 | } | 299 | } |
| 335 | ] | 300 | ] |
| 336 | }); | 301 | }); |
| 337 | - | ||
| 338 | var chart3 = Highcharts.chart("container3", { | 302 | var chart3 = Highcharts.chart("container3", { |
| 339 | chart: { | 303 | chart: { |
| 340 | type: "spline", | 304 | type: "spline", |
| ... | @@ -353,17 +317,15 @@ plotOptions: { | ... | @@ -353,17 +317,15 @@ plotOptions: { |
| 353 | // }, | 317 | // }, |
| 354 | backgroundColor: "rgba(255, 255, 255, 0.0)" | 318 | backgroundColor: "rgba(255, 255, 255, 0.0)" |
| 355 | }, | 319 | }, |
| 356 | - | ||
| 357 | time: { | 320 | time: { |
| 358 | useUTC: false | 321 | useUTC: false |
| 359 | }, | 322 | }, |
| 360 | - | ||
| 361 | title: { | 323 | title: { |
| 362 | text: "풍속", | 324 | text: "풍속", |
| 363 | style: { | 325 | style: { |
| 364 | color: "#FFFFFF", | 326 | color: "#FFFFFF", |
| 365 | - fontWeight: "bold", | 327 | + //fontWeight: "bold", |
| 366 | - fontFamily: 'Yeon Sung', | 328 | + fontFamily: 'Do Hyeon', |
| 367 | fontSize:'25px' | 329 | fontSize:'25px' |
| 368 | } | 330 | } |
| 369 | }, | 331 | }, |
| ... | @@ -395,7 +357,6 @@ plotOptions: { | ... | @@ -395,7 +357,6 @@ plotOptions: { |
| 395 | color: "white" | 357 | color: "white" |
| 396 | } | 358 | } |
| 397 | } | 359 | } |
| 398 | - | ||
| 399 | }, | 360 | }, |
| 400 | tooltip: { | 361 | tooltip: { |
| 401 | headerFormat: "<b>{series.name}</b><br/>", | 362 | headerFormat: "<b>{series.name}</b><br/>", |
| ... | @@ -433,11 +394,9 @@ plotOptions: { | ... | @@ -433,11 +394,9 @@ plotOptions: { |
| 433 | }) | 394 | }) |
| 434 | i++; | 395 | i++; |
| 435 | } | 396 | } |
| 436 | - | ||
| 437 | <% wsArr.forEach((wsArr) => {%> | 397 | <% wsArr.forEach((wsArr) => {%> |
| 438 | var temp; | 398 | var temp; |
| 439 | temp = <%=wsArr %>; | 399 | temp = <%=wsArr %>; |
| 440 | - | ||
| 441 | // for(j;j<10;j++) | 400 | // for(j;j<10;j++) |
| 442 | // { | 401 | // { |
| 443 | // windArr.push({ | 402 | // windArr.push({ |
| ... | @@ -446,22 +405,17 @@ plotOptions: { | ... | @@ -446,22 +405,17 @@ plotOptions: { |
| 446 | // }) | 405 | // }) |
| 447 | // i++; | 406 | // i++; |
| 448 | // } | 407 | // } |
| 449 | - | ||
| 450 | windArr.push({ | 408 | windArr.push({ |
| 451 | x: time + i * 60000, | 409 | x: time + i * 60000, |
| 452 | y: temp | 410 | y: temp |
| 453 | }) | 411 | }) |
| 454 | i++; | 412 | i++; |
| 455 | - | ||
| 456 | <%}) %> | 413 | <%}) %> |
| 457 | - | ||
| 458 | return windArr; | 414 | return windArr; |
| 459 | })(), | 415 | })(), |
| 460 | - | ||
| 461 | color: "#FFE08C" | 416 | color: "#FFE08C" |
| 462 | } | 417 | } |
| 463 | ] }); | 418 | ] }); |
| 464 | - | ||
| 465 | var chart4 = Highcharts.chart("container4", { | 419 | var chart4 = Highcharts.chart("container4", { |
| 466 | chart: { | 420 | chart: { |
| 467 | type: "spline", | 421 | type: "spline", |
| ... | @@ -480,17 +434,15 @@ plotOptions: { | ... | @@ -480,17 +434,15 @@ plotOptions: { |
| 480 | // }, | 434 | // }, |
| 481 | backgroundColor: "rgba(255, 255, 255, 0.0)" | 435 | backgroundColor: "rgba(255, 255, 255, 0.0)" |
| 482 | }, | 436 | }, |
| 483 | - | ||
| 484 | time: { | 437 | time: { |
| 485 | useUTC: false | 438 | useUTC: false |
| 486 | }, | 439 | }, |
| 487 | - | ||
| 488 | title: { | 440 | title: { |
| 489 | text: "강수량", | 441 | text: "강수량", |
| 490 | style: { | 442 | style: { |
| 491 | color: "#FFFFFF", | 443 | color: "#FFFFFF", |
| 492 | - fontWeight: "bold", | 444 | + //fontWeight: "bold", |
| 493 | - fontFamily: 'Yeon Sung', | 445 | + fontFamily: 'Do Hyeon', |
| 494 | fontSize:'25px' | 446 | fontSize:'25px' |
| 495 | } | 447 | } |
| 496 | }, | 448 | }, |
| ... | @@ -522,7 +474,6 @@ plotOptions: { | ... | @@ -522,7 +474,6 @@ plotOptions: { |
| 522 | color: "white" | 474 | color: "white" |
| 523 | } | 475 | } |
| 524 | } | 476 | } |
| 525 | - | ||
| 526 | }, | 477 | }, |
| 527 | tooltip: { | 478 | tooltip: { |
| 528 | headerFormat: "<b>{series.name}</b><br/>", | 479 | headerFormat: "<b>{series.name}</b><br/>", |
| ... | @@ -560,11 +511,9 @@ plotOptions: { | ... | @@ -560,11 +511,9 @@ plotOptions: { |
| 560 | }) | 511 | }) |
| 561 | i++; | 512 | i++; |
| 562 | } | 513 | } |
| 563 | - | ||
| 564 | <% rainArr.forEach((rainArr) => {%> | 514 | <% rainArr.forEach((rainArr) => {%> |
| 565 | var temp; | 515 | var temp; |
| 566 | temp = <%=rainArr %>; | 516 | temp = <%=rainArr %>; |
| 567 | - | ||
| 568 | // for(j;j<10;j++) | 517 | // for(j;j<10;j++) |
| 569 | // { | 518 | // { |
| 570 | // rainArr.push({ | 519 | // rainArr.push({ |
| ... | @@ -573,32 +522,141 @@ plotOptions: { | ... | @@ -573,32 +522,141 @@ plotOptions: { |
| 573 | // }) | 522 | // }) |
| 574 | // i++; | 523 | // i++; |
| 575 | // } | 524 | // } |
| 576 | - | ||
| 577 | rainArr.push({ | 525 | rainArr.push({ |
| 578 | x: time + i * 60000, | 526 | x: time + i * 60000, |
| 579 | y: temp | 527 | y: temp |
| 580 | 528 | ||
| 581 | }) | 529 | }) |
| 582 | i++; | 530 | i++; |
| 583 | - | ||
| 584 | <%}) %> | 531 | <%}) %> |
| 585 | - | ||
| 586 | return rainArr; | 532 | return rainArr; |
| 587 | })(), | 533 | })(), |
| 588 | color: "#FFE08C" | 534 | color: "#FFE08C" |
| 589 | - | ||
| 590 | } | 535 | } |
| 591 | ] | 536 | ] |
| 592 | - | ||
| 593 | - | ||
| 594 | }); | 537 | }); |
| 538 | + var chart5 = Highcharts.chart("container5", { | ||
| 539 | + chart: { | ||
| 540 | + type: "spline", | ||
| 541 | + animation: Highcharts.svg, // don't animate in old IE | ||
| 542 | + marginRight: 10, | ||
| 543 | + // events: { | ||
| 544 | + // load: function () { | ||
| 545 | + // // set up the updating of the chart each second | ||
| 546 | + // var series = this.series[0]; | ||
| 547 | + // setInterval(function () { | ||
| 548 | + // var x = new Date().getTime(), // 현재 시간 | ||
| 549 | + // y = Math.random(); // | ||
| 550 | + // series.addPoint([x, y], true, true); | ||
| 551 | + // }, 3000); //1000=1초 | ||
| 552 | + // } | ||
| 553 | + // }, | ||
| 554 | + backgroundColor: "rgba(255, 255, 255, 0.0)" | ||
| 555 | + }, | ||
| 556 | + time: { | ||
| 557 | + useUTC: false | ||
| 558 | + }, | ||
| 559 | + title: { | ||
| 560 | + text: "교통사고", | ||
| 561 | + style: { | ||
| 562 | + color: "#FFFFFF", | ||
| 563 | + //fontWeight: "bold", | ||
| 564 | + fontFamily: 'Do Hyeon', | ||
| 565 | + fontSize:'25px' | ||
| 566 | + } | ||
| 567 | + }, | ||
| 568 | + xAxis: { | ||
| 569 | + type: "datetime", | ||
| 570 | + tickPixelInterval: 150, | ||
| 571 | + labels: { | ||
| 572 | + style: { | ||
| 573 | + color: "white" | ||
| 574 | + } | ||
| 575 | + } | ||
| 576 | + }, | ||
| 577 | + yAxis: { | ||
| 578 | + title: { | ||
| 579 | + text: "교통사고발생횟수(번)", | ||
| 580 | + style: { | ||
| 581 | + color: "white" | ||
| 582 | + } | ||
| 583 | + }, | ||
| 584 | + plotLines: [ | ||
| 585 | + { | ||
| 586 | + value: 0, | ||
| 587 | + width: 1, | ||
| 588 | + color: "#808080" | ||
| 589 | + } | ||
| 590 | + ], | ||
| 591 | + labels: { | ||
| 592 | + style: { | ||
| 593 | + color: "white" | ||
| 594 | + } | ||
| 595 | + } | ||
| 596 | + }, | ||
| 597 | + tooltip: { | ||
| 598 | + headerFormat: "<b>{series.name}</b><br/>", | ||
| 599 | + pointFormat: "{point.x:%Y년%m월%d일 %H시%M분}<br/>의 교통사고 발생 수 : {point.y:.2f}m/s" | ||
| 600 | + }, | ||
| 601 | + legend: { | ||
| 602 | + //enabled: false | ||
| 603 | + layout: "vertical", | ||
| 604 | + align: "left", | ||
| 605 | + verticalAlign: "top", | ||
| 606 | + x: 100, | ||
| 607 | + y: 50, | ||
| 608 | + floating: true, | ||
| 609 | + borderWidth: 1, | ||
| 610 | + backgroundColor: | ||
| 611 | + (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || | ||
| 612 | + "#FFFFFF" | ||
| 613 | + }, | ||
| 614 | + exporting: { | ||
| 615 | + enabled: false | ||
| 616 | + }, | ||
| 617 | + series: [ | ||
| 618 | + { | ||
| 619 | + name: "교통사고 발생수", | ||
| 620 | + data: (function () { | ||
| 621 | + var trafficArr = [], //windArr | ||
| 622 | + time = new Date().getTime(); | ||
| 623 | + var length = <%=dataLen%>; | ||
| 624 | + var i = -9; | ||
| 625 | + var j = 0; | ||
| 626 | + for (j; j < 10 - length; j++) { | ||
| 627 | + trafficArr.push({ | ||
| 628 | + x: time + i * 60000, | ||
| 629 | + y: 0 | ||
| 630 | + }) | ||
| 631 | + i++; | ||
| 632 | + } | ||
| 633 | + <% occurArr.forEach((occurArr) => {%> | ||
| 634 | + var temp; | ||
| 635 | + temp = <%=occurArr %>; | ||
| 636 | + // for(j;j<10;j++) | ||
| 637 | + // { | ||
| 638 | + // trafficArr.push({ | ||
| 639 | + // x: time + i * 60000, | ||
| 640 | + // y: temp | ||
| 641 | + // }) | ||
| 642 | + // i++; | ||
| 643 | + // } | ||
| 644 | + trafficArr.push({ | ||
| 645 | + x: time + i * 60000, | ||
| 646 | + y: temp | ||
| 647 | + }) | ||
| 648 | + i++; | ||
| 649 | + <%}) %> | ||
| 650 | + return trafficArr; | ||
| 651 | + })(), | ||
| 652 | + color: "#FFE08C" | ||
| 653 | + } | ||
| 654 | + ] }); | ||
| 595 | var socket = io.connect('/', { transports: ['websocket'], upgrade: false }); | 655 | var socket = io.connect('/', { transports: ['websocket'], upgrade: false }); |
| 596 | socket.emit("connection", client_data); | 656 | socket.emit("connection", client_data); |
| 597 | - socket.on("weatherInfo_minutely_send_to_client", (info) => { //서버에서 client에게 메세지 전송 | 657 | + socket.on("weather_and_traffic_Info_minutely_send_to_client", (info) => { //서버에서 client에게 메세지 전송 |
| 598 | console.log(info); | 658 | console.log(info); |
| 599 | - | ||
| 600 | var date = new Date().getTime(); | 659 | var date = new Date().getTime(); |
| 601 | - | ||
| 602 | chart1.series[0].addPoint({ | 660 | chart1.series[0].addPoint({ |
| 603 | x: date, | 661 | x: date, |
| 604 | y: info.death, | 662 | y: info.death, |
| ... | @@ -609,24 +667,23 @@ plotOptions: { | ... | @@ -609,24 +667,23 @@ plotOptions: { |
| 609 | y: info.temperature*1, | 667 | y: info.temperature*1, |
| 610 | color:"#FFE08C" | 668 | color:"#FFE08C" |
| 611 | }); | 669 | }); |
| 612 | - | ||
| 613 | chart3.series[0].addPoint({ | 670 | chart3.series[0].addPoint({ |
| 614 | x: date, | 671 | x: date, |
| 615 | y: info.wind*1, | 672 | y: info.wind*1, |
| 616 | color:"#FFE08C" | 673 | color:"#FFE08C" |
| 617 | }); | 674 | }); |
| 618 | - | ||
| 619 | chart4.series[0].addPoint({ | 675 | chart4.series[0].addPoint({ |
| 620 | x: date, | 676 | x: date, |
| 621 | y: info.rain*1, | 677 | y: info.rain*1, |
| 622 | color:"#FFE08C" | 678 | color:"#FFE08C" |
| 623 | }); | 679 | }); |
| 624 | - | 680 | + chart5.series[0].addPoint({ |
| 681 | + x: date, | ||
| 682 | + y: info.occurence*1, | ||
| 683 | + color:"#FFE08C" | ||
| 684 | + }); | ||
| 625 | }); | 685 | }); |
| 626 | - | ||
| 627 | </script> | 686 | </script> |
| 628 | </div> | 687 | </div> |
| 629 | - | ||
| 630 | </body> | 688 | </body> |
| 631 | - | ||
| 632 | </html> | 689 | </html> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment