added report count per os chart
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user