Oh sorry, here is the TestReport.php:
<?php
namespace App\Reports;
use koolreport\amazing\Theme;
use koolreport\KoolReport;
use koolreport\pivot\processes\Pivot;
use koolreport\processes\CalculatedColumn;
use koolreport\processes\DateTimeFormat;
class TestReport extends BaseReport
{
use Theme;
public function settings()
{
return array(
"dataSources" => array(
"example" => array(
"class" => '\koolreport\datasources\ArrayDataSource',
"data" => array(
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '21',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "1",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '44',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "2",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '53',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "3",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '54',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "4",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '21',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "5",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '20',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "6",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '15',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "7",
),
array(
"user" => "User1",
"room" => 'Room1',
"seconds" => '76',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "8",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '88',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "1",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '12',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "2",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '40',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "3",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '35',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "4",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '76',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "5",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '53',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "6",
),
array(
"user" => "User2",
"room" => 'Room2',
"seconds" => '12',
"seconds_can_spend" => '60',
"year" => "2021",
"month" => "1",
"day" => "7",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '87',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "1",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '40',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "2",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '85',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "3",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '63',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "4",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '34',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "5",
),
array(
"user" => "User2",
"room" => 'Room3',
"seconds" => '26',
"seconds_can_spend" => '40',
"year" => "2021",
"month" => "1",
"day" => "6",
),
),
"dataFormat" => "associate",
),
),
);
}
function setup()
{
parent::setup();
$this->src('example')->pipe(
new Pivot(
array(
"dimensions" => array(
"column" => "year",
"row" => "user",
),
"aggregates" => array(
"avg" => "seconds",
),
)
)
)
->pipe($this->dataStore("example_data"));
}
}