Temporarily removed timeline graph

This commit is contained in:
Ruben Ramirez 2025-03-07 04:38:40 -06:00
parent 5e92999bd2
commit 2f0f177738

View file

@ -815,51 +815,51 @@ function rl_mailwarmer_display_campaign_timeline($post) {
endforeach;
?>
</div>
<canvas id="timelineChart" style="max-height: 300px;"></canvas>
<!-- <canvas id="timelineChart" style="max-height: 300px;"></canvas> -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('timelineChart');
const data = <?php echo json_encode($chart_data); ?>;
new Chart(ctx, {
data: {
labels: data.map(row => row.date),
datasets: [{
type: 'bar',
label: 'Target Volume',
data: data.map(row => row.target),
backgroundColor: 'rgb(255, 0, 0)',
borderColor: 'rgb(255, 0, 0)',
borderWidth: 1,
order: 10,
fill: false
}, {
type: 'bar',
label: 'Emails Sent',
data: data.map(row => row.sent),
backgroundColor: 'rgba(0, 255, 0)',
borderColor: 'rgba(0, 255, 0, 0.8)',
borderWidth: 1,
order: 1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Number of Emails'
}
},
x: {
stacked: true
}
}
}
});
// new Chart(ctx, {
// data: {
// labels: data.map(row => row.date),
// datasets: [{
// type: 'bar',
// label: 'Target Volume',
// data: data.map(row => row.target),
// backgroundColor: 'rgb(255, 0, 0)',
// borderColor: 'rgb(255, 0, 0)',
// borderWidth: 1,
// order: 10,
// fill: false
// }, {
// type: 'bar',
// label: 'Emails Sent',
// data: data.map(row => row.sent),
// backgroundColor: 'rgba(0, 255, 0)',
// borderColor: 'rgba(0, 255, 0, 0.8)',
// borderWidth: 1,
// order: 1
// }]
// },
// options: {
// responsive: true,
// scales: {
// y: {
// beginAtZero: true,
// title: {
// display: true,
// text: 'Number of Emails'
// }
// },
// x: {
// stacked: true
// }
// }
// }
// });
</script>
<?php
}