Update recent_calls.php (#6121)

This commit is contained in:
AlexC 2021-11-12 12:55:51 -07:00 committed by GitHub
parent d24aa11b99
commit fd3f3c2d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 41 deletions

View File

@ -74,51 +74,50 @@
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
echo " //add doughnut chart
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom:10px;'> ?>
<div style='width: 175px; height: 175px;'><canvas id='recent_calls_chart'></canvas></div> <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 10px;'>
</div> <div style='width: 175px; height: 175px;'><canvas id='recent_calls_chart'></canvas></div>
</div>
<script> <script>
var recent_calls_bgc = ['#2a9df4', '#d4d4d4']; const recent_calls_data = {
datasets: [{
data: ['<?php echo $num_rows; ?>', 0.00001],
borderColor: 'rgba(0,0,0,0)',
backgroundColor: ['#2a9df4', '#d4d4d4'],
cutout: chart_cutout
}]
};
const recent_calls_data = { const recent_calls_config = {
datasets: [{ type: 'doughnut',
data:[".$num_rows.", 0.00001], data: recent_calls_data,
borderColor: 'rgba(0,0,0,0)', options: {
backgroundColor: [recent_calls_bgc[0], recent_calls_bgc[1]], responsive: true,
cutout: chart_cutout maintainAspectRatio: false,
}] plugins: {
}; chart_counter: {
chart_text: '<?php echo $num_rows; ?>'
const recent_calls_config = { },
type: 'doughnut', legend: {
data: recent_calls_data, display: false
options: { },
responsive: true, title: {
maintainAspectRatio: false, display: true,
plugins: { text: '<?php echo $text['label-recent_calls']; ?>'
chart_counter: {
chart_text: ".$num_rows."
},
legend: {
display: false
},
title: {
display: true,
text: '".$text['label-recent_calls']."'
}
} }
}, }
plugins: [chart_counter], },
}; plugins: [chart_counter],
};
const recent_calls_chart = new Chart( const recent_calls_chart = new Chart(
document.getElementById('recent_calls_chart'), document.getElementById('recent_calls_chart'),
recent_calls_config recent_calls_config
); );
</script> </script>
"; <?php
echo "<div class='hud_details hud_box' id='hud_recent_calls_details'>"; echo "<div class='hud_details hud_box' id='hud_recent_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";