성장점수 표시 하기 (3개월간)

dev_bert
kyebyungha 3 years ago
parent 80274cd833
commit 3a753e8110

@ -534,8 +534,14 @@ public class M_Bf_growthController extends AbstractControllerManager{
//6. 리포트 헤더
double height_max = 0d, height_min = 250d;
String height_max_dt = "", height_min_dt = "";
paramMap.put("baseday", "growth_balance");
paramMap.put("baseday", "month");
List<DataMap> lm_growth_body = bf_growth_bodyBO.select_bf_growth_body_list(paramMap); //smc_no
paramMap.put("baseday", "1month");
List<DataMap> lm_growth_body_1 = bf_growth_bodyBO.select_bf_growth_body_list(paramMap); //smc_no
paramMap.put("baseday", "2month");
List<DataMap> lm_growth_body_2 = bf_growth_bodyBO.select_bf_growth_body_list(paramMap); //smc_no
paramMap.put("baseday", "growth_balance");
/*
for (DataMap map_growth_body : lm_growth_body) {
height = RenaStringUtil.getDataToDouble(map_growth_body, "height");
if(height > 0){
@ -558,11 +564,14 @@ public class M_Bf_growthController extends AbstractControllerManager{
rm_growth_body.put("height_max_dt", height_max_dt);
rm_growth_body.put("height_min_dt", height_min_dt);
rm_growth_body.put("lm_growth_body_count", lm_growth_body.size());
*/
DataMap.putToModel(model, "rm_growth_body", rm_growth_body);
DataMap.putToModel(model, "rm_growth_body", rm_growth_body);
DataMap.putToModel(model, "rm_child", rm_child);
DataMap.putToModel(model, "rm_report", rm_report);
DataMap.putToModel(model, "lm_growth_body", lm_growth_body);
DataMap.putToModel(model, "lm_growth_body_1", lm_growth_body_1);
DataMap.putToModel(model, "lm_growth_body_2", lm_growth_body_2);
}
}

@ -132,9 +132,17 @@
AND x.sgb_no = #sgb_no#
</isNotEmpty>
<isNotEmpty property="baseday">
and x.base_dt between date_add(now(),interval -1 month ) and now()
</isNotEmpty>
<isEqual property="baseday" compareValue="month">
and x.base_dt between LAST_DAY(NOW() - interval 1 month) + interval 1 DAY and now()
</isEqual>
<isEqual property="baseday" compareValue="1month">
and x.base_dt between LAST_DAY(NOW() - interval 2 month) + interval 1 DAY and LAST_DAY(NOW() - interval 1 month)
</isEqual>
<isEqual property="baseday" compareValue="2month">
and x.base_dt between LAST_DAY(NOW() - interval 3 month) + interval 1 DAY and LAST_DAY(NOW() - interval 2 month)
</isEqual>
ORDER BY base_dt DESC
<isNotEmpty property="page.startRowNum" prepend="">

@ -59,10 +59,10 @@
</#list>
</#if>
</div>
<!-- myChart1 -->
<div class="myChart_wrap">
<!-- myChart1 -->
<div class="myChart_wrap">
<canvas id="myChart5">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="nutrition_report_graph_txt">

@ -0,0 +1,481 @@
<!-- m_coach -->
<div class="m_coach">
<!-- m_nutrition_report -->
<div class="m_nutrition_report">
<!-- m_nutrition_report_wrap -->
<div class="m_nutrition_report_wrap">
<h2>키 성장</h2>
<!-- report_tab -->
<ul class="report_tab report_tab01">
<li class="tab01">
<a href="javascript:void(0);">키 성장</a>
</li>
</ul>
<!-- report_tab -->
<!-- nutrition_report_graph -->
<div class="nutrition_report_graph">
<div class="swiper-container swiper-container1-chart">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="nutrition_report_graph_txt">
<h3>
<span class="date"></span>
<span class="tit">이번 달</span>
</h3>
</div>
<!-- myChart11 -->
<div class="myChart_wrap">
<canvas id="myChart11">
</div>
</div>
<div class="swiper-slide">
<div class="nutrition_report_graph_txt">
<h3>
<span class="date"></span>
<span class="tit">지난달</span>
</h3>
</div>
<!-- myChart12 -->
<div class="myChart_wrap">
<canvas id="myChart12">
</div>
</div>
<div class="swiper-slide">
<div class="nutrition_report_graph_txt">
<h3>
<span class="date"></span>
<span class="tit">2개월전</span>
</h3>
</div>
<!-- myChart13 -->
<div class="myChart_wrap">
<canvas id="myChart13">
</div>
</div>
</div>
<!-- 페이징 -->
<div class="swiper-pagination"></div>
</div>
</div>
<!-- //nutrition_report_graph -->
</div>
<!-- //m_nutrition_report_wrap -->
</div>
<!-- //m_nutrition_report -->
</div>
<!-- //m_coach -->
<script>
// swiper 슬라이더
new Swiper('.swiper-container1', {
slidesPerView: 4, // 동시에 보여줄 슬라이드 갯수
slidesPerGroup: 4, // 그룹으로 묶을 수
// 그룹수가 맞지 않을 경우 빈칸으로 메우기
// 3개가 나와야 되는데 1개만 있다면 2개는 빈칸으로 채워서 3개를 만듬
loopFillGroupWithBlank: true,
loop: false, // 무한 반복
pagination: { // 페이징
el: '.swiper-pagination',
clickable: true, // 페이징을 클릭하면 해당 영역으로 이동, 필요시 지정해 줘야 기능 작동
},
navigation: { // 네비게이션
nextEl: '.swiper-button-next', // 다음 버튼 클래스명
prevEl: '.swiper-button-prev', // 이번 버튼 클래스명
}
});
// 차트 swiper 슬라이더
new Swiper('.swiper-container1-chart', {
slidesPerView: 1, // 동시에 보여줄 슬라이드 갯수
slidesPerGroup: 1, // 그룹으로 묶을 수
spaceBetween: 50,
// 그룹수가 맞지 않을 경우 빈칸으로 메우기
// 3개가 나와야 되는데 1개만 있다면 2개는 빈칸으로 채워서 3개를 만듬
loopFillGroupWithBlank: true,
loop: false, // 무한 반복
pagination: { // 페이징
el: '.swiper-pagination',
clickable: true, // 페이징을 클릭하면 해당 영역으로 이동, 필요시 지정해 줘야 기능 작동
},
navigation: { // 네비게이션
nextEl: '.swiper-button-next', // 다음 버튼 클래스명
prevEl: '.swiper-button-prev', // 이번 버튼 클래스명
},
});
/* 그래프 myChart11 */
var ctx = document.getElementById("myChart11");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [ <#if model['lm_growth_body']?has_content>
<#list model['lm_growth_body']?reverse as item>
"${item['base_day']!}",
</#list>
</#if>
],
datasets: [{ label: '',
data: [
<#if model['lm_growth_body']?has_content>
<#list model['lm_growth_body']?reverse as item>
"${item['height']!}",
</#list>
</#if>
],
backgroundColor: 'rgba(255,255,255,0)',
borderColor: '#e7e7e7',
cubicInterpolationMode: true,
pointRadius: '5',
// pointBackgroundColor: [ '#fff', '#fff', '#fff', '#fff', '#fff', '#fff', '#fff' ],
pointBorderWidth: '3',
pointBorderColor: '#33CC33' ,
borderWidth: '3',
lineTension: 0,
}, ]
},
options: {
maintainAspectRatio: false,
legend: {
display: false,
labels: {
fontColor: '#fff'
}
},
layout: {
padding: {
left: 0,
right: 0,
top: 10,
bottom: 0
},
},
scales: {
yAxes: [{
display: true,
gridLines: {
offsetGridLines: false,
color: '#ddd',
drawBorder: true,
drawTicks: true,
drawOnChartArea: false,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: '${model['rm_child']['name']} 키'
}, //왼쪽 라벨
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
min: 20,
max: 120,
stepSize: 20,
}
}],
xAxes: [{
display: true, //세로선
gridLines: {
color: '#f2f2f2',
drawTicks: true,
drawBorder: true,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: ''
},
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
}
}]
},
tooltips: { //툴팁
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].label || '';
label += tooltipItem.yLabel ;
return label + " cm";
}
},
enabled: 'true',
intersect: false,
displayColors: false,
backgroundColor: '#FF8135',
yPadding: 15,
xPadding: 10,
titleFontSize: 15,
titleFontColor: '#fff',
titleFontFamily: 'Noto Sans KR',
bodyFontSize: 15,
bodyFontColor: '#fff',
bodyFontFamily: 'Noto Sans KR',
caretPadding: 5,
cornerRadius: 10,
caretSize: 5,
}
}, //옵션
});
/* 그래프 myChart12 */
var ctx = document.getElementById("myChart12");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [ <#if model['lm_growth_body_1']?has_content>
<#list model['lm_growth_body_1']?reverse as item>
"${item['base_day']!}",
</#list>
</#if>
],
datasets: [{ label: '',
data: [
<#if model['lm_growth_body_1']?has_content>
<#list model['lm_growth_body_1']?reverse as item>
"${item['height']!}",
</#list>
</#if>
],
backgroundColor: 'rgba(255,255,255,0)',
borderColor: '#e7e7e7',
cubicInterpolationMode: true,
pointRadius: '5',
// pointBackgroundColor: [ '#fff', '#fff', '#fff', '#fff', '#fff', '#fff', '#fff' ],
pointBorderWidth: '3',
pointBorderColor: '#33CC33' ,
borderWidth: '3',
lineTension: 0,
}, ]
},
options: {
maintainAspectRatio: false,
legend: {
display: false,
labels: {
fontColor: '#fff'
}
},
layout: {
padding: {
left: 0,
right: 0,
top: 10,
bottom: 0
},
},
scales: {
yAxes: [{
display: true,
gridLines: {
offsetGridLines: false,
color: '#ddd',
drawBorder: true,
drawTicks: true,
drawOnChartArea: false,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: '${model['rm_child']['name']} 키'
}, //왼쪽 라벨
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
min: 20,
max: 120,
stepSize: 20,
}
}],
xAxes: [{
display: true, //세로선
gridLines: {
color: '#f2f2f2',
drawTicks: true,
drawBorder: true,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: ''
},
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
}
}]
},
tooltips: { //툴팁
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].label || '';
label += tooltipItem.yLabel ;
return label + " cm";
}
},
enabled: 'true',
intersect: false,
displayColors: false,
backgroundColor: '#FF8135',
yPadding: 15,
xPadding: 10,
titleFontSize: 15,
titleFontColor: '#fff',
titleFontFamily: 'Noto Sans KR',
bodyFontSize: 15,
bodyFontColor: '#fff',
bodyFontFamily: 'Noto Sans KR',
caretPadding: 5,
cornerRadius: 10,
caretSize: 5,
}
}, //옵션
});
/* 그래프 myChart13 */
var ctx = document.getElementById("myChart13");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [ <#if model['lm_growth_body_2']?has_content>
<#list model['lm_growth_body_2']?reverse as item>
"${item['base_day']!}",
</#list>
</#if>
],
datasets: [{ label: '',
data: [
<#if model['lm_growth_body_2']?has_content>
<#list model['lm_growth_body_2']?reverse as item>
"${item['height']!}",
</#list>
</#if>
],
backgroundColor: 'rgba(255,255,255,0)',
borderColor: '#e7e7e7',
cubicInterpolationMode: true,
pointRadius: '5',
// pointBackgroundColor: [ '#fff', '#fff', '#fff', '#fff', '#fff', '#fff', '#fff' ],
pointBorderWidth: '3',
pointBorderColor: '#33CC33' ,
borderWidth: '3',
lineTension: 0,
}, ]
},
options: {
maintainAspectRatio: false,
legend: {
display: false,
labels: {
fontColor: '#fff'
}
},
layout: {
padding: {
left: 0,
right: 0,
top: 10,
bottom: 0
},
},
scales: {
yAxes: [{
display: true,
gridLines: {
offsetGridLines: false,
color: '#ddd',
drawBorder: true,
drawTicks: true,
drawOnChartArea: false,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: '${model['rm_child']['name']} 키'
}, //왼쪽 라벨
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
min: 20,
max: 120,
stepSize: 20,
}
}],
xAxes: [{
display: true, //세로선
gridLines: {
color: '#f2f2f2',
drawTicks: true,
drawBorder: true,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: ''
},
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
}
}]
},
tooltips: { //툴팁
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].label || '';
label += tooltipItem.yLabel ;
return label + " cm";
}
},
enabled: 'true',
intersect: false,
displayColors: false,
backgroundColor: '#FF8135',
yPadding: 15,
xPadding: 10,
titleFontSize: 15,
titleFontColor: '#fff',
titleFontFamily: 'Noto Sans KR',
bodyFontSize: 15,
bodyFontColor: '#fff',
bodyFontFamily: 'Noto Sans KR',
caretPadding: 5,
cornerRadius: 10,
caretSize: 5,
}
}, //옵션
});
</script>

@ -53,13 +53,13 @@
<div class="growth_subMain_graph_tit">
<h2 class="tit01"><img src="${URL_STATIC_ROOT}/m/img/growth/growth_subMain_graph_tit_ico01.png" alt="기린 아이콘" /> ${model['rm_child']['name']}의 키</h2>
</div>
<div class="growth_subMain_graph_box">
<div class="graph_wrap">
<canvas id="myChart1" class="graph" style="height:10vh; width: calc(100% - 50px);"></canvas>
</div>
</div>
<!-- nutrition_subMain_iframe -->
<div class="nutrition_subMain_iframe">
<#include "/m/bf_food/view_sn_nutrition_main_31.ftl">
</div>
<!-- //nutrition_subMain_iframe -->
</div>
<!-- //growth_subMain_graph -->
@ -108,123 +108,8 @@
</div>
<!-- //wrap -->
<script>
/* 그래프 myChart1 */
var ctx = document.getElementById("myChart1");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [ <#if model['lm_growth_body']?has_content>
<#list model['lm_growth_body']?reverse as item>
"${item['base_day']!}",
</#list>
</#if>
],
datasets: [{ label: '',
data: [
<#if model['lm_growth_body']?has_content>
<#list model['lm_growth_body']?reverse as item>
"${item['height']!}",
</#list>
</#if>
],
backgroundColor: 'rgba(255,255,255,0)',
borderColor: '#e7e7e7',
cubicInterpolationMode: true,
pointRadius: '5',
// pointBackgroundColor: [ '#fff', '#fff', '#fff', '#fff', '#fff', '#fff', '#fff' ],
pointBorderWidth: '3',
pointBorderColor: '#33CC33' ,
borderWidth: '3',
lineTension: 0,
}, ]
},
options: {
maintainAspectRatio: false,
legend: {
display: false,
labels: {
fontColor: '#fff'
}
},
layout: {
padding: {
left: 0,
right: 0,
top: 10,
bottom: 0
},
},
scales: {
yAxes: [{
display: true,
gridLines: {
offsetGridLines: false,
color: '#ddd',
drawBorder: true,
drawTicks: true,
drawOnChartArea: false,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: '${model['rm_child']['name']} 키'
}, //왼쪽 라벨
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
min: 20,
max: 120,
stepSize: 20,
}
}],
xAxes: [{
display: true, //세로선
gridLines: {
color: '#f2f2f2',
drawTicks: true,
drawBorder: true,
tickMarkLength: 3,
},
scaleLabel: {
display: true,
labelString: ''
},
ticks: {
padding: 5,
fontColor: '#252525',
fontSize: '11',
}
}]
},
tooltips: { //툴팁
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].label || '';
label += tooltipItem.yLabel ;
return label + " cm";
}
},
enabled: 'true',
intersect: false,
displayColors: false,
backgroundColor: '#FF8135',
yPadding: 15,
xPadding: 10,
titleFontSize: 15,
titleFontColor: '#fff',
titleFontFamily: 'Noto Sans KR',
bodyFontSize: 15,
bodyFontColor: '#fff',
bodyFontFamily: 'Noto Sans KR',
caretPadding: 5,
cornerRadius: 10,
caretSize: 5,
}
}, //옵션
});
<script>
/* 그래프 myChart2 */
var ctx = document.getElementById("myChart2");

Loading…
Cancel
Save