@@ -156,13 +156,20 @@ $chartLabels = array_map($formatDateKey, $dateOrder);
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const ctx = document.getElementById('lateChart').getContext('2d');
|
||||
|
||||
const lateChart = document.getElementById('lateChart');
|
||||
if (!lateChart || typeof Chart === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// PHP to JS data conversion
|
||||
const labels = <?= json_encode($chartLabels) ?>;
|
||||
const counts = <?= json_encode($chartData) ?>;
|
||||
|
||||
new Chart(ctx, {
|
||||
if (!labels.length || !counts.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
new Chart(lateChart.getContext('2d'), {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: labels,
|
||||
|
||||
Reference in New Issue
Block a user