wip tooltip with events
This commit is contained in:
1 parent
06dbeb1ed8
commit
ec9e380d33
4 files changed
+73
-36
No files matched your search
@@ -76,7 +76,9 @@ class LoadEvents
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
$res = StatistikoEvent::where('league_id', $league_id)
|
||||
$res = StatistikoEvent::with('home')
|
||||
->with('away')
|
||||
->where('league_id', $league_id)
|
||||
->where(function ($query) use ($team_id, $team_position) {
|
||||
switch ($team_position) {
|
||||
case 'home':
|
||||
@@ -104,9 +106,17 @@ class LoadEvents
|
||||
$dataset_home = [];
|
||||
$dataset_away = [];
|
||||
$labels = [];
|
||||
$events = [];
|
||||
$labels_since = [];
|
||||
$results = ['w' => 0, 'd' => 0, 'l' => 0];
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
*/
|
||||
// $res = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||
// $event = $res->home->name.' vs '.$res->away->name;
|
||||
// dd($event);
|
||||
|
||||
foreach ($res as $value) {
|
||||
|
||||
$labels[] = $value['starttime']->format('d.M.y');
|
||||
@@ -286,6 +296,7 @@ class LoadEvents
|
||||
}
|
||||
}
|
||||
if (isset($val_home) && isset($val_away)) {
|
||||
$events[] = $value->home->name.' vs '.$value->away->name;
|
||||
$dataset_home[] = $val_home;
|
||||
$dataset_away[] = $val_away;
|
||||
}
|
||||
@@ -294,15 +305,16 @@ class LoadEvents
|
||||
$data = [
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => 'Home',
|
||||
'label' => 'In Favor',
|
||||
'events' => $events,
|
||||
'data' => $dataset_home,
|
||||
'fill' => false,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#36A2EB',
|
||||
],
|
||||
[
|
||||
// 'label' => 'Away '.HelperStatisticType::get($filter),
|
||||
'label' => 'Away',
|
||||
'label' => 'Against',
|
||||
'events' => $events,
|
||||
'data' => $dataset_away,
|
||||
'fill' => false,
|
||||
'tension' => 0.5,
|
||||
|
||||
Reference in new issue
Block a user