diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index e23bb38..0d90d8a 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -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 }); diff --git a/resources/views/domain/view.blade.php b/resources/views/domain/view.blade.php index ddd35de..8291542 100644 --- a/resources/views/domain/view.blade.php +++ b/resources/views/domain/view.blade.php @@ -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',