대시보드 화면크기 변경 시 차트 리로드 이벤트 추가.
parent
0dafec7513
commit
201a4153b7
|
|
@ -1,11 +1,29 @@
|
|||
const smSize = 575;
|
||||
let beforeSize;
|
||||
window.onresize = function (){
|
||||
const nowWidth = this.innerWidth;
|
||||
if(beforeSize>smSize&&nowWidth<smSize){
|
||||
loadChart(nowWidth)
|
||||
}else if(beforeSize<smSize&&nowWidth>smSize){
|
||||
loadChart(nowWidth)
|
||||
}else if(beforeSize+100<nowWidth){
|
||||
loadChart(nowWidth)
|
||||
}else if(beforeSize>nowWidth+100){
|
||||
loadChart(nowWidth)
|
||||
}
|
||||
}
|
||||
$(function (){
|
||||
loadChart(window.innerWidth)
|
||||
})
|
||||
function loadChart(nowWidth){
|
||||
beforeSize = nowWidth;
|
||||
google.charts.load('current', {packages: ['bar']});
|
||||
google.charts.setOnLoadCallback(drawMapUseFromDayChart);
|
||||
google.charts.load('current', {packages: ['corechart']});
|
||||
google.charts.setOnLoadCallback(drawAreaDonutChart);
|
||||
google.charts.load('current', {packages:['line']});
|
||||
google.charts.setOnLoadCallback(drawTempChart);
|
||||
})
|
||||
}
|
||||
|
||||
function drawMapUseFromDayChart() {
|
||||
var dataHeader = [['날짜', '사용량']];
|
||||
|
|
|
|||
Loading…
Reference in New Issue