Skip to content

Commit

Permalink
Fix dashboard charts not displaying data
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
  • Loading branch information
sampoyigi committed Oct 15, 2022
1 parent 359687e commit 80a8ba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/admin/traits/HasChartDatasets.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function queryDatasets($config, $start, $end)
$dateRanges = $this->getDatePeriod($start, $end);
$this->locationApplyScope($query);

return $this->getPointsArray($dateRanges, $query->pluck('y', 'x'));
return $this->getPointsArray($dateRanges, $query->get());
}

protected function getDatePeriod($start, $end)
Expand All @@ -89,7 +89,7 @@ protected function getDatePeriod($start, $end)
protected function getPointsArray($dateRanges, Collection $result)
{
$points = [];
$keyedResult = $result->keyBy('x');
$keyedResult = $result->pluck('y', 'x');
foreach ($dateRanges as $date) {
$x = $date->format('Y-m-d');
$points[] = [
Expand Down

0 comments on commit 80a8ba3

Please sign in to comment.