<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>페라스텔원샷액 개봉후 안정성 시험 결과</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 20px;
background-color: #f5f5f5;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1, h2 {
text-align: center;
color: #333;
margin-bottom: 30px;
}
.chart-container {
position: relative;
height: 500px;
margin: 20px 0;
}
.data-table {
margin-top: 30px;
width: 100%;
border-collapse: collapse;
}
.data-table th, .data-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}
.data-table th {
background-color: #f2f2f2;
font-weight: bold;
}
.download-btn {
display: block;
margin: 20px auto;
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
}
.download-btn:hover {
background-color: #2980b9;
}
</style>
</head>
<body>
<div class="container">
<h2>페라스텔원샷액 개봉후 안정성 시험 결과</h2>
<div class="chart-container">
<canvas id="testChart"></canvas>
</div>
<button class="download-btn" onclick="downloadChart()">그래프 PNG로 다운로드</button>
<table class="data-table">
<thead>
<tr>
<th>시험 실시 일자</th>
<th>시험 경과 일자(일)</th>
<th>모의사용 검체(%)</th>
<th>대조시험 검체(%)</th>
</tr>
</thead>
<tbody>
<tr><td>23-11-10</td><td>0</td><td>15.8</td><td>15.8</td></tr>
<tr><td>23-11-17</td><td>7</td><td>15.8</td><td>15.8</td></tr>
<tr><td>23-11-21</td><td>11</td><td>16.0</td><td>16.0</td></tr>
<tr><td>23-11-27</td><td>17</td><td>16.0</td><td>16.0</td></tr>
<tr><td>23-12-13</td><td>33</td><td>15.8</td><td>15.8</td></tr>
<tr><td>23-12-22</td><td>42</td><td>15.8</td><td>15.8</td></tr>
<tr><td>23-12-28</td><td>48</td><td>16.0</td><td>16.0</td></tr>
<tr><td>24-01-04</td><td>55</td><td>16.0</td><td>16.0</td></tr>
<tr><td>24-01-11</td><td>62</td><td>15.7</td><td>15.7</td></tr>
<tr><td>24-01-17</td><td>68</td><td>15.8</td><td>15.8</td></tr>
<tr><td>24-01-24</td><td>75</td><td>15.8</td><td>15.8</td></tr>
<tr><td>24-02-02</td><td>84</td><td>15.8</td><td>15.6</td></tr>
<tr><td>24-02-20</td><td>102</td><td>15.8</td><td>15.6</td></tr>
</tbody>
</table>
</div>
<script>
const ctx = document.getElementById('testChart').getContext('2d');
const data = {
labels: [0, 7, 11, 17, 33, 42, 48, 55, 62, 68, 75, 84, 102],
datasets: [
{
label: '모의사용 검체 (%)',
data: [15.8, 15.8, 16.0, 16.0, 15.8, 15.8, 16.0, 16.0, 15.7, 15.8, 15.8, 15.8, 15.8],
borderColor: '#3498db',
backgroundColor: '#3498db',
borderWidth: 2,
pointBackgroundColor: '#3498db',
pointBorderColor: '#ffffff',
pointBorderWidth: 2,
pointRadius: 5,
pointHoverRadius: 7,
pointStyle: 'circle',
tension: 0.1
},
{
label: '대조시험 검체 (%)',
data: [15.8, 15.8, 16.0, 16.0, 15.8, 15.8, 16.0, 16.0, 15.7, 15.8, 15.8, 15.6, 15.6],
borderColor: '#e74c3c',
backgroundColor: '#e74c3c',
borderWidth: 2,
pointBackgroundColor: '#e74c3c',
pointBorderColor: '#ffffff',
pointBorderWidth: 2,
pointRadius: 5,
pointHoverRadius: 7,
pointStyle: 'rect',
tension: 0.1
},
{
label: '기준선 (15.0%)',
data: [15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0],
borderColor: '#2c3e50',
backgroundColor: 'transparent',
borderWidth: 2,
pointRadius: 0,
pointHoverRadius: 0,
tension: 0,
borderDash: [10, 5]
},
{
label: '상한 (16.5% = 110%)',
data: [16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5, 16.5],
borderColor: '#e67e22',
backgroundColor: 'transparent',
borderWidth: 2,
pointRadius: 0,
pointHoverRadius: 0,
tension: 0,
borderDash: [3, 3]
},
{
label: '하한 (13.5% = 90%)',
data: [13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5],
borderColor: '#f39c12',
backgroundColor: 'transparent',
borderWidth: 2,
pointRadius: 0,
pointHoverRadius: 0,
tension: 0,
borderDash: [3, 3]
}
]
};
const config = {
type: 'line',
data: data,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: '시험 경과 일자별 검체 결과 변화',
font: {
size: 18,
weight: 'bold'
},
padding: 20
},
legend: {
display: true,
position: 'top',
labels: {
font: {
size: 14
},
usePointStyle: true,
padding: 20
}
}
},
scales: {
x: {
display: true,
title: {
display: true,
text: '시험 경과 일자 (일)',
font: {
size: 14,
weight: 'bold'
}
},
grid: {
display: true,
color: 'rgba(0,0,0,0.1)'
}
},
y: {
display: true,
title: {
display: true,
text: '검체 농도 (%)',
font: {
size: 14,
weight: 'bold'
}
},
min: 12,
max: 18,
grid: {
display: true,
color: 'rgba(0,0,0,0.1)'
}
}
},
interaction: {
intersect: false,
mode: 'index'
},
hover: {
mode: 'nearest',
intersect: false
}
}
};
new Chart(ctx, config);
// PNG 다운로드 함수
function downloadChart() {
const canvas = document.getElementById('testChart');
const link = document.createElement('a');
link.download = '시험검체결과_' + new Date().toISOString().slice(0,10) + '.png';
link.href = canvas.toDataURL('image/png');
link.click();
}
</script>
</body>
</html>