C
C
<div class="box">
<li class="active">
</li>
</ul>
</div>-->
<li class="active">
</a></li>
<li>
</a></li>
<li>
</a></li>
<li>
</a></li>
</ul>
<div class="tab-content">
<tr>
<th><div>ID</div></th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
foreach($birth_reports as $row):?>
<tr>
<td><?php echo $count++;?></td>
<i class="icon-trash"></i>
</a>
</td>-->
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<thead>
<tr>
<th><div>ID</div></th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
foreach($birth_reports as $row):?>
<tr>
<i class="icon-trash"></i>
</a>
</td>-->>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<thead>
<tr>
<th><div>ID</div></th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
foreach($birth_reports as $row):?>
<tr>
<i class="icon-trash"></i>
</a>
</td>-->
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class="tab-content">
<div class="tab-pane box active" id="list">
<div class="table-responsive">
<thead>
<tr>
<!-- </tr>
</thead>
<tbody>
<?php
$count = 1;
foreach($report as $row):
?>
</tr>
</table>-->
</div>
<div class="graph-container">
<div class="graph">
<canvas id="birthsChart"></canvas>
</div>
<div class="graph">
<canvas id="deathsChart"></canvas>
</div>
<div class="graph">
<canvas id="operationsChart"></canvas>
</div>
<div class="graph">
<canvas id="othersChart"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
type: 'bar',
data: {
datasets: [{
label: label,
data: data,
backgroundColor: color,
borderColor: color,
borderWidth: 1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true
});
};
tableRows.forEach(row => {
row.addEventListener('click', () => {
const selectedData = {
'deces': deaths,
'naissance': births,
'operation': operations,
'autre': others
};
deathsChart.data.datasets[0].data = selectedData['deces'];
deathsChart.update();
birthsChart.data.datasets[0].data = selectedData['naissance'];
birthsChart.update();
operationsChart.data.datasets[0].data = selectedData['operation'];
operationsChart.update();
othersChart.data.datasets[0].data = selectedData['autre'];
othersChart.update();
}
});
});
</script>
<style>
.graph-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
.graph {
width: 45%;
height: 300px;
table {
width: 100%;
text-align: center;
padding: 8px;
</style>