Skip to content

Commit

Permalink
Merge pull request #90 from hyosung-second-team1/85-jsp-vote-distance
Browse files Browse the repository at this point in the history
[Feat] 테이블 페이지에 차트 추가
  • Loading branch information
Koneweekk authored May 16, 2024
2 parents e1209c7 + 03cb836 commit 65d5227
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
22 changes: 18 additions & 4 deletions src/main/resources/static/css/table/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ body {


/* 차트 */
.chart {
width: 300px;
#bar-chart {
width: 400px;
}

#circle-chart {
width: 200px;
}
/* 차트 End*/

Expand Down Expand Up @@ -245,8 +249,18 @@ td > p{


/* 미디어 쿼리 */
@media (max-width:1100px) {
@media (max-width:1600px) {
.head-container {
flex-direction: column;
gap: 30px;
}
}

@media (max-width:1000px) {
.important-container {
flex-direction: column;
gap: 20px;
}
}
}


16 changes: 8 additions & 8 deletions src/main/resources/static/js/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ async function getBarData() {
{
label: '그룹',
data: new Array(12).fill(0),
borderColor: '#4FD1C5',
backgroundColor: '#4FD1C5',
borderColor: 'tomato',
backgroundColor: 'tomato',
borderWidth: 2,
},
{
label: '개인',
data: new Array(12).fill(0),
borderColor: '#4FD1C5',
backgroundColor: '#4FD1C5',
borderColor: 'cornflowerblue',
backgroundColor: 'cornflowerblue',
borderWidth: 2,
},
]
Expand All @@ -279,15 +279,15 @@ async function getBarData() {
const countData2 = response2.data;
$.each(countData2, function (idx, month) {
const monthIdx = Number(month.month) - 1;
data.datasets[0].data[monthIdx] = month.scheduleCount;
data.datasets[1].data[monthIdx] = month.scheduleCount;
});

// 개인 일정
const response3 = await aj.getMonthStatic(year, false);
const countData3 = response3.data;
$.each(countData3, function (idx, month) {
const monthIdx = Number(month.month) - 1;
data.datasets[0].data[monthIdx] = month.scheduleCount;
data.datasets[2].data[monthIdx] = month.scheduleCount;
});

return data
Expand All @@ -310,7 +310,7 @@ async function showFirstCircleChart() {
},
title: {
display: true,
text: '카테고리별 일정 통계'
text: `이번달 카테고리별 일정 통계`
}
}
},
Expand All @@ -336,7 +336,7 @@ async function showFirstBarChart() {
},
title: {
display: true,
text: '월별 일정 통계'
text: `${today.getFullYear()}월별 일정 통계`
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/WEB-INF/views/table/table.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ pageEncoding="UTF-8"%>
<div class="top-container">
<!-- 상단부 -->
<div class="head-container">
<div class="chart-container">
<div class="chart" id="bar-chart">
<div class="important-container">
<div class="chart" id="circle-chart">
<canvas></canvas>
</div>
<div class="chart" id="circle-chart">
<div class="chart" id="bar-chart">
<canvas></canvas>
</div>
</div>
Expand Down

0 comments on commit 65d5227

Please sign in to comment.