This commit is contained in:
salam committed 2026-06-15 10:54:43 +02:00
1 parent 1cb3b0bad9
commit 2bb7fdbc27
3 files changed
+11 -6

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@
## 6) Aggiungere nel Grafico Performance anche i dati della partita (Data / Home / Away / Risultato) come per gli altri grafici ## 6) Aggiungere nel Grafico Performance anche i dati della partita (Data / Home / Away / Risultato) come per gli altri grafici
## 7) Il Grafico della Moving Average per Events Performance secondo me è sbagliato quindi probabilmnete c'è un errore nel calcolo della Moving Average ## 7) Il Grafico della Moving Average per Events Performance secondo me è sbagliato quindi probabilmnete c'è un errore nel calcolo della Moving Average
## 8) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono invertiti WIN con LOST ## 8) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono invertiti WIN con LOST
9) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES è opportuno sostituire Win con 1, Draw con X e Lost con 2 ## 9) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES è opportuno sostituire Win con 1, Draw con X e Lost con 2
## 10) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono sbagliate le Average Goals ## 10) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono sbagliate le Average Goals
11) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES i valori delle quote dovrebbero avere due decimali fissi 11) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES i valori delle quote dovrebbero avere due decimali fissi
12) Filtrando per PLAYER sono sbagliate le Average Goals, sia Totali che Home/Away 12) Filtrando per PLAYER sono sbagliate le Average Goals, sia Totali che Home/Away
+7 -3
View File
@@ -103,14 +103,18 @@ class StatsMedianAverage extends StatsOverviewWidget
$value_away = 0; $value_away = 0;
// dd($value_home); // dd($value_home);
if ($data['similar_past_matches'] != 'none')
$fixtotwo = true;
else
$fixtotwo = false;
return [ return [
Stat::make('Number of events', new HtmlString('<div id="number-of-events">' . $total_home . '</div>'))->extraAttributes(['x-init' => "animate('number-of-events', $total_home)"]), Stat::make('Number of events', new HtmlString('<div id="number-of-events">' . $total_home . '</div>'))->extraAttributes(['x-init' => "animate('number-of-events', $total_home)"]),
Stat::make('Average ' . $statistic_type, self::template('avhome', 'avaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('avhome', $value_home); animate('avaway', $value_away)"]), Stat::make('Average ' . $statistic_type, self::template('avhome', 'avaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('avhome', $value_home); animate('avaway', $value_away)"]),
Stat::make('Median ' . $statistic_type, self::template('mehome', 'meaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('mehome', $median_home); animate('meaway', $median_away)"]), Stat::make('Median ' . $statistic_type, self::template('mehome', 'meaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('mehome', $median_home); animate('meaway', $median_away)"]),
Stat::make($data['similar_past_matches'] != 'none' ? '1' : 'Win: ' . $data['results']['w'], new HtmlString('<div id="number-of-win">' . $win . '</div>'))->extraAttributes(['x-init' => "animate('number-of-win', $win)"]), Stat::make($data['similar_past_matches'] != 'none' ? '1' : 'Win: ' . $data['results']['w'], new HtmlString('<div id="number-of-win">' . $win . '</div>'))->extraAttributes(['x-init' => "animate('number-of-win', $win, 500, $fixtotwo)"]),
Stat::make($data['similar_past_matches'] != 'none' ? 'X' : 'Draw: ' . $data['results']['d'], new HtmlString('<div id="number-of-draw">' . $draw . '</div>'))->extraAttributes(['x-init' => "animate('number-of-draw', $draw)"]), Stat::make($data['similar_past_matches'] != 'none' ? 'X' : 'Draw: ' . $data['results']['d'], new HtmlString('<div id="number-of-draw">' . $draw . '</div>'))->extraAttributes(['x-init' => "animate('number-of-draw', $draw, 500, $fixtotwo)"]),
Stat::make($data['similar_past_matches'] != 'none' ? '2' : 'Lost: ' . $data['results']['l'], new HtmlString('<div id="number-of-lost">' . $lost . '</div>'))->extraAttributes(['x-init' => "animate('number-of-lost', $lost)"]), Stat::make($data['similar_past_matches'] != 'none' ? '2' : 'Lost: ' . $data['results']['l'], new HtmlString('<div id="number-of-lost">' . $lost . '</div>'))->extraAttributes(['x-init' => "animate('number-of-lost', $lost, 500, $fixtotwo)"]),
]; ];
} }
+3 -2
View File
@@ -1,4 +1,4 @@
function animate(element, end, duration = 500) { function animate(element, end, duration = 500, fixtotwo = false) {
console.log(element, end); console.log(element, end);
var element = document.getElementById(element); var element = document.getElementById(element);
@@ -21,7 +21,8 @@ function animate(element, end, duration = 500) {
// Calculate current value and round to integer // Calculate current value and round to integer
const currentCount = Math.round(end * easedProgress * 100) / 100; const currentCount = Math.round(end * easedProgress * 100) / 100;
element.innerHTML = currentCount; if (fixtotwo) element.innerHTML = currentCount.toFixed(2);
else element.innerHTML = currentCount;
if (progress < 1) { if (progress < 1) {
requestAnimationFrame(updateCount); requestAnimationFrame(updateCount);