diff --git a/src/main/webapp/WEB-INF/views/admins/constructionProjectManagement/construction-project-statistics-index.jsp b/src/main/webapp/WEB-INF/views/admins/constructionProjectManagement/construction-project-statistics-index.jsp index 8b9e591..41285c0 100644 --- a/src/main/webapp/WEB-INF/views/admins/constructionProjectManagement/construction-project-statistics-index.jsp +++ b/src/main/webapp/WEB-INF/views/admins/constructionProjectManagement/construction-project-statistics-index.jsp @@ -98,7 +98,19 @@ createInstitutionDetailCharts(data.institutionStats || []); // (4) 하단 전체 기관 등록 건수 차트 갱신 - updateInstitutionChart(data.institutionStats || []); + // (4)-1 하단 국토부 소속 기관 등록 건수 차트 갱신 + var gm01List = data.institutionStats.filter(function(stat) { + return stat.gm === "01"; + }); + + // (4)-2 하단 국토부 산하 기관 등록 건수 차트 갱신 + var gm02List = data.institutionStats.filter(function(stat) { + return stat.gm === "02"; + }); + + // 각각 차트 생성 + updateInstitutionChart('institutionChart_gm01', gm01List, '지방국토관리청 등록 현황'); + updateInstitutionChart('institutionChart_gm02', gm02List, '산하기관 등록 현황'); } // [상단] 전체 단계별 차트 @@ -245,45 +257,45 @@ } // [하단] 전체 기관별 등록 건수 차트 - function updateInstitutionChart(instStats) { - var canvas = document.getElementById('institutionChart'); - if(!canvas) return; - - if (instChartInstance) instChartInstance.destroy(); - - var labels = []; - var data = []; - - instStats.forEach(function(stat) { - var name = stat.name; - if (name === '울산광역시') name = '한국도로공사'; - labels.push(name); - data.push(stat.count); - }); - - instChartInstance = new Chart(canvas, { - type: 'bar', - data: { - labels: labels, - datasets: [{ - label: '등록 건수', - data: data, - backgroundColor: 'rgba(75, 192, 192, 0.5)', - borderColor: 'rgba(75, 192, 192, 1)', - borderWidth: 1 - }] - }, - options: { - responsive: true, - maintainAspectRatio: false, - scales: { y: { beginAtZero: true, ticks: { stepSize: 1 } } }, - plugins: { - legend: { display: false }, - title: { display: true, text: '전체 기관별 등록 현황' } - } - } - }); - } + function updateInstitutionChart(canvasId, instStats, title) { + var canvas = document.getElementById(canvasId); + if(!canvas) return; + + var labels = []; + var data = []; + + instStats.forEach(function(stat) { + var name = stat.name; + if (name === '울산광역시') name = '한국도로공사'; + labels.push(name); + data.push(stat.count); + }); + + new Chart(canvas, { + type: 'bar', + data: { + labels: labels, + datasets: [{ + label: '등록 건수', + data: data, + backgroundColor: 'rgba(75, 192, 192, 0.5)', + borderColor: 'rgba(75, 192, 192, 1)', + borderWidth: 1 + }] + }, + options: { + responsive: true, + maintainAspectRatio: false, + scales: { + y: { beginAtZero: true, ticks: { stepSize: 1 } } + }, + plugins: { + legend: { display: false }, + title: { display: true, text: title } + } + } + }); + } @@ -293,10 +305,8 @@
- - -
+<%--

전체 기관별 등록 건수

@@ -305,7 +315,28 @@
-
+
--%> + + <%-- 소속기관 --%> +
+
+
+

국토교통부 소속기관 등록 현황

+
+ +
+
+
+ <%-- 산하기관 --%> +
+
+

국토교통부 산하기관 등록 현황

+
+ +
+
+
+