86 lines
2.2 KiB
Plaintext
86 lines
2.2 KiB
Plaintext
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
|
|
|
<script>
|
|
var ctx = document.getElementById("Chat2_4").getContext('2d');
|
|
var myChart = new Chart(ctx, {
|
|
type: 'line',
|
|
|
|
data: {
|
|
labels: [
|
|
<%for(int i = n_p1;i<n_p2+1;i++){%>
|
|
"Period <%=i%>",
|
|
<%}%>
|
|
],
|
|
datasets: [
|
|
<%
|
|
int call_max_t = 20;
|
|
int t_i = 0;
|
|
String sql_team = " select a.c_no, a.c_team_name ";
|
|
for(int i = n_p1;i<n_p2+1;i++){
|
|
sql_team = sql_team + " ,( select count(c_no) from tbl_interview where c_use = 0 and c_team_no = a.c_no and ( c_date >= '"+ p_s_date[i] +"' and c_date <= '"+ p_e_date[i] +"' ) ) as c_h_" + i + " ";
|
|
}
|
|
sql_team = sql_team + " from tbl_team a where a.c_use = 0 and a.c_project_no = "+ session.getAttribute("member_project_no") + " order by a.c_team_name asc ";
|
|
ResultSet rs_team = stmt2.executeQuery(sql_team);
|
|
while(rs_team.next()){
|
|
t_i = t_i + 1;
|
|
if(t_i > 10){
|
|
t_i = 1;
|
|
}
|
|
%>
|
|
{
|
|
label: '<%=rs_team.getString("c_team_name")%>',
|
|
data: [
|
|
<%
|
|
int t_plus = 0;
|
|
for(int i = n_p1;i<n_p2+1;i++){
|
|
t_plus = t_plus + rs_team.getInt("c_h_"+i);
|
|
if(call_max_t < t_plus){
|
|
call_max_t = t_plus;
|
|
}
|
|
%>
|
|
<%=t_plus%>,
|
|
<%}%>
|
|
],
|
|
fill: false,
|
|
backgroundColor: chartColors.color0,
|
|
borderColor: chartColors.color<%=t_i%>,
|
|
borderWidth: 2
|
|
},
|
|
<%
|
|
}
|
|
rs_team.close();
|
|
int temp_call = call_max_t / 10;
|
|
temp_call = temp_call * 10;
|
|
call_max_t = temp_call + 10;
|
|
%>
|
|
|
|
],
|
|
},
|
|
options: {
|
|
maintainAspectRatio: false, // default value. false일 경우 포함된 div의 크기에 맞춰서 그려짐.
|
|
|
|
scales: {
|
|
yAxes: [{
|
|
ticks: {
|
|
beginAtZero: true,
|
|
stepSize: 10,
|
|
min: 0,
|
|
max: <%=call_max_t%>,
|
|
fontSize: 14,
|
|
}
|
|
|
|
}]
|
|
},
|
|
elements: {
|
|
|
|
},
|
|
legend: {
|
|
position: "right",
|
|
align: "end"
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|