Our traffic graph now has a dynamic y axis
This commit is contained in:
parent
3e202e34d2
commit
35c5b3da8d
@ -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
|
||||
});
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user