Files
lubelog/Views/Vehicle/_ReminderMakeUpReport.cshtml
DESKTOP-T0O5CDB\DESK-555BD a396eb4f72 Updated colors again.
2024-01-11 09:22:57 -07:00

51 lines
1.7 KiB
Plaintext

@model ReminderMakeUpForVehicle
@if (Model.UrgentCount + Model.VeryUrgentCount + Model.NotUrgentCount + Model.PastDueCount > 0)
{
<canvas id="donut-chart"></canvas>
<script>
renderChart();
function renderChart() {
var useDarkMode = getGlobalConfig().useDarkMode;
new Chart($("#donut-chart"), {
type: 'doughnut',
data: {
labels: ["Not Urgent", "Urgent", "Very Urgent", "Past Due"],
datasets: [
{
label: "Reminders by Category",
backgroundColor: ["#488f31", "#ffa600", "#de425b", "#cccccc"],
data: [
@Model.NotUrgentCount,
@Model.UrgentCount,
@Model.VeryUrgentCount,
@Model.PastDueCount
]
}
]
},
options: {
plugins: {
legend: {
position: "bottom",
labels: {
color: useDarkMode ? "#fff" : "#000"
}
},
title: {
display: true,
text: "Reminders by Urgency",
color: useDarkMode ? "#fff" : "#000"
},
}
}
});
}
</script>
}
else
{
<div class="text-center">
<h4>No data found, create reminders to see visualizations here.</h4>
</div>
}