wip del err

This commit is contained in:
salam committed 2026-10-04 15:22:39 +02:00
1 parent 812736ca9a
commit 9bcd4432c6
1210 files changed
-220941

No files matched your search

@@ -1,30 +0,0 @@
<?php
namespace App\Filament\Widgets\Charts;
class HelperMoveingAverage
{
public static function get(&$data)
{
if (! $data) {
return;
}
$data['labels'] = array_slice($data['labels'], 2);
$datasets = $data['datasets'];
foreach ($datasets as $k => $dataset) {
$arr = $dataset['data'];
$new = [];
$last = count($arr);
foreach ($arr as $key => $value) {
if ($key == 1 && $last > 2) {
$new[] = round(((float) $arr[0] + (float) $value + (float) $arr[2]) / 3, 1);
} elseif ($key > 1 && $key < $last - 1) {
$new[] = round(((float) $arr[$key - 1] + (float) $value + (float) $arr[$key + 1]) / 3, 1);
}
}
$data['datasets'][$k]['data'] = $new;
}
}
}