summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics
diff options
context:
space:
mode:
authorSimon Rettberg2023-01-05 16:04:58 +0100
committerSimon Rettberg2023-01-05 16:04:58 +0100
commitdd9974f776dde086752af4e80828fa1ed76a977f (patch)
tree7296f10173819aa98343e8ff64721387da63b8c9 /modules-available/statistics
parent[statistics] Fix graph background if there are no lectures (diff)
downloadslx-admin-dd9974f776dde086752af4e80828fa1ed76a977f.tar.gz
slx-admin-dd9974f776dde086752af4e80828fa1ed76a977f.tar.xz
slx-admin-dd9974f776dde086752af4e80828fa1ed76a977f.zip
[statistics] Add hint regarding blue tint of usage graph
Diffstat (limited to 'modules-available/statistics')
-rw-r--r--modules-available/statistics/lang/de/template-tags.json1
-rw-r--r--modules-available/statistics/lang/en/template-tags.json1
-rw-r--r--modules-available/statistics/pages/summary.inc.php2
-rw-r--r--modules-available/statistics/templates/summary.html14
4 files changed, 10 insertions, 8 deletions
diff --git a/modules-available/statistics/lang/de/template-tags.json b/modules-available/statistics/lang/de/template-tags.json
index 9445e17a..4e0441e8 100644
--- a/modules-available/statistics/lang/de/template-tags.json
+++ b/modules-available/statistics/lang/de/template-tags.json
@@ -30,6 +30,7 @@
"lang_free": "frei",
"lang_fullInfo": "Alle Werte",
"lang_gbRam": "RAM",
+ "lang_graphLectureTitle": "Blaue F\u00e4rbung = Anzahl der Veranstaltungen",
"lang_hardwareSummary": "Hardware",
"lang_hasNotes": "Zu diesem Rechner wurden Notizen hinterlegt",
"lang_hddUnused": "Ungenutzter Festplattenspeicher",
diff --git a/modules-available/statistics/lang/en/template-tags.json b/modules-available/statistics/lang/en/template-tags.json
index 295e34f6..9d01f7be 100644
--- a/modules-available/statistics/lang/en/template-tags.json
+++ b/modules-available/statistics/lang/en/template-tags.json
@@ -30,6 +30,7 @@
"lang_free": "free",
"lang_fullInfo": "All values",
"lang_gbRam": "RAM",
+ "lang_graphLectureTitle": "Blue shading = number of active lectures",
"lang_hardwareSummary": "Hardware",
"lang_hasNotes": "Notes have been added to this client",
"lang_hddUnused": "Unused hard drive space",
diff --git a/modules-available/statistics/pages/summary.inc.php b/modules-available/statistics/pages/summary.inc.php
index 71faff47..ce16b536 100644
--- a/modules-available/statistics/pages/summary.inc.php
+++ b/modules-available/statistics/pages/summary.inc.php
@@ -91,7 +91,7 @@ class SubPage
$points1 = [];
$points2 = [];
$lectures = [];
- // Get max from 3 consecutive values, which should be 3*5 = 15m
+ // Get max from 4 consecutive values, which should be 4*5 = 20m
$sum = 0;
foreach ($res as $row) {
if ($row['data'][0] === '{') {
diff --git a/modules-available/statistics/templates/summary.html b/modules-available/statistics/templates/summary.html
index a0efd531..751a9bed 100644
--- a/modules-available/statistics/templates/summary.html
+++ b/modules-available/statistics/templates/summary.html
@@ -30,7 +30,8 @@
var markings = {{{markings}}};
var markMax = Math.max(...markings) * 3;
- if (markMax <= 0) markMax = 1;
+ var showLegend = markMax > 0;
+ if (markMax < 8) markMax = 8;
var oldDraw = Chart.prototype._drawDatasets;
@@ -65,12 +66,11 @@
pointHitRadius: 6,
interaction: { mode: 'index' },
plugins: {
- tooltip: { callbacks: { label: function(context) {
- if (context.dataset.label === 'Courses')
- return null;
- return context.dataset.label + ': ' + context.parsed.y;
- }
- }},
+ subtitle: {
+ display: showLegend,
+ text: '{{lang_graphLectureTitle}}',
+ position: 'bottom',
+ },
legend: {position: 'left' },
}
}});