added report count per os chart

This commit is contained in:
2026-04-12 10:57:27 +02:00
parent 0ec29a70c3
commit fe6b58c140
3 changed files with 42 additions and 1 deletions

View File

@@ -23,6 +23,11 @@
<canvas id="distChart"></canvas>
</div>
<div class="chart-card">
<h3>Reports by Operating System</h3>
<canvas id="osCountChart"></canvas>
</div>
<div class="chart-card">
<h3>Avg Score by Operating System</h3>
<canvas id="osChart"></canvas>
@@ -55,6 +60,30 @@
}
};
// OS Distribution (Count)
new Chart(document.getElementById('osCountChart'), {
type: 'bar',
data: {
labels: analyticsData.os_count_labels,
datasets: [{
label: 'Number of Reports',
data: analyticsData.os_count_values,
backgroundColor: primaryColor,
borderRadius: 6
}]
},
options: {
...chartOptions,
indexAxis: 'y',
scales: {
x: {
ticks: { stepSize: 1 },
beginAtZero: true
}
}
}
});
// Average per OS
new Chart(document.getElementById('osChart'), {
type: 'bar',