Add dashboard default settings to system_counts.php (#6140)

* Add dashboard default settings to system_counts.php

* Update system_counts.php
This commit is contained in:
AlexC
2021-11-19 16:32:23 -07:00
committed by GitHub
parent 68baf7a0db
commit e2cb5f2eba
@@ -292,23 +292,29 @@
//add doughnut chart //add doughnut chart
?> ?>
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 10px;'> <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 10px;'>
<div style='width: 250px; height: 175px;'><canvas id='system_count_chart'></canvas></div> <div style='width: 250px; height: 175px;'><canvas id='system_counts_chart'></canvas></div>
</div> </div>
<script> <script>
const system_count_data = { var system_counts_chart_context = document.getElementById('system_counts_chart').getContext('2d');
const system_counts_chart_data = {
labels: ['InActive: <?php echo $domain_inactive; ?>', 'Active: <?php echo $domain_active; ?>'], labels: ['InActive: <?php echo $domain_inactive; ?>', 'Active: <?php echo $domain_active; ?>'],
datasets: [{ datasets: [{
data: ['<?php echo $domain_inactive; ?>', '<?php echo $domain_active; ?>'], data: ['<?php echo $domain_inactive; ?>', '<?php echo $domain_active; ?>'],
borderColor: 'rgba(0,0,0,0)', backgroundColor: [
backgroundColor: ['#d4d4d4', '#2a9df4'], '<?php echo $_SESSION['dashboard']['system_counts_chart_sub_background_color']['text']; ?>',
'<?php echo $_SESSION['dashboard']['system_counts_chart_main_background_color']['text']; ?>'
],
borderColor: '<?php echo $_SESSION['dashboard']['system_counts_chart_border_color']['text']; ?>',
borderWidth: '<?php echo $_SESSION['dashboard']['system_counts_chart_border_width']['text']; ?>',
cutout: chart_cutout cutout: chart_cutout
}] }]
}; };
const system_count_config = { const system_counts_chart_config = {
type: 'doughnut', type: 'doughnut',
data: system_count_data, data: system_counts_chart_data,
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
@@ -333,9 +339,9 @@
plugins: [chart_counter], plugins: [chart_counter],
}; };
const system_count_chart = new Chart( const system_counts_chart = new Chart(
document.getElementById('system_count_chart'), system_counts_chart_context,
system_count_config system_counts_chart_config
); );
</script> </script>
<?php <?php