wip
This commit is contained in:
1 parent
146c144c87
commit
2bb0915fce
2 files changed
+3
-3
No files matched your search
@@ -19,9 +19,9 @@ class HelperMoveingAverage
|
||||
$last = count($arr);
|
||||
foreach ($arr as $key => $value) {
|
||||
if ($key == 1 && $last > 2) {
|
||||
$new[] = round(($arr[0] + $value + $arr[2]) / 3, 1);
|
||||
$new[] = round(((float) $arr[0] + (float) $value + (float) $arr[2]) / 3, 1);
|
||||
} elseif ($key > 1 && $key < $last - 1) {
|
||||
$new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 1);
|
||||
$new[] = round(((float) $arr[$key - 1] + (float) $value + (float) $arr[$key + 1]) / 3, 1);
|
||||
}
|
||||
}
|
||||
$data['datasets'][$k]['data'] = $new;
|
||||
|
||||
Reference in new issue
Block a user