Update missed_calls.php (#6122)

This commit is contained in:
AlexC
2021-11-12 12:56:11 -07:00
committed by GitHub
parent fd3f3c2d69
commit 4600e5f98e
@@ -74,51 +74,51 @@
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
echo "
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom:10px;'>
<div style='width: 175px; height: 175px;'><canvas id='missed_calls_chart'></canvas></div>
</div>
<script> //add doughnut chart
var missed_calls_bgc = ['#FF595a', '#d4d4d4']; ?>
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 10px;'>
<div style='width: 175px; height: 175px;'><canvas id='missed_calls_chart'></canvas></div>
</div>
const missed_calls_data = { <script>
datasets: [{ const missed_calls_data = {
data:[".$num_rows.", 0.00001], datasets: [{
borderColor: 'rgba(0,0,0,0)', data: ['<?php echo $num_rows; ?>', 0.00001],
backgroundColor: [missed_calls_bgc[0], missed_calls_bgc[1]], borderColor: 'rgba(0,0,0,0)',
cutout: chart_cutout backgroundColor: ['#ff595a', '#d4d4d4'],
}] cutout: chart_cutout
}; }]
};
const missed_calls_config = { const missed_calls_config = {
type: 'doughnut', type: 'doughnut',
data: missed_calls_data, data: missed_calls_data,
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
plugins: { plugins: {
chart_counter: { chart_counter: {
chart_text: ".$num_rows." chart_text: '<?php echo $num_rows; ?>'
}, },
legend: { legend: {
display: false display: false
}, },
title: { title: {
display: true, display: true,
text: '".$text['label-missed_calls']."' text: '<?php echo $text['label-missed_calls']; ?>'
}
} }
}, }
plugins: [chart_counter], },
}; plugins: [chart_counter],
};
const missed_calls_chart = new Chart( const missed_calls_chart = new Chart(
document.getElementById('missed_calls_chart'), document.getElementById('missed_calls_chart'),
missed_calls_config missed_calls_config
); );
</script> </script>
"; <?php
echo "<div class='hud_details hud_box' id='hud_missed_calls_details'>"; echo "<div class='hud_details hud_box' id='hud_missed_calls_details'>";
echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n"; echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";