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