Our traffic graph now has a dynamic y axis
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 44s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m36s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
Deon George 2025-01-08 08:04:55 +11:00
parent 3e202e34d2
commit 35c5b3da8d
2 changed files with 7 additions and 0 deletions

View File

@ -162,6 +162,7 @@
title: {
text: 'Echomail'
},
max: 100,
},
legend: {
symbolWidth: 40
@ -202,7 +203,12 @@
dataType: 'json',
data : {name: item.name},
success: function(data) {
var avg;
item.setData(data);
if (data.length) {
avg = data.reduce(function(a,b) { return ((typeof a == 'object') ? a.y : a)+b.y; })/data.length*1.5;
item.yAxis.update({max: item.yAxis.max < avg ? avg : item.yAxis.max,});
}
},
cache: false
});

View File

@ -355,6 +355,7 @@
title: {
text: 'Echomail'
},
max: {{ $o->echoarea_total_daily()->groupBy('name')->map(fn($item)=>$item->map(fn($item)=>$item->count)->average()*1.5)->max() ?: 10 }},
},
legend: {
align: 'right',