Good day
Can you please assist with the following error I get when testing the ChartJS timeline widget using the Dashboard package?
*Too few arguments to function koolreport\core\Widget::create(), 0 passed in ...\app\Reports\DashboardReport\Demo\DemoBoard.php on line 25 and at least 1 expected*
Data:
<?php
namespace App\Reports\Demo;
use koolreport\chartjs\Timeline;
use \koolreport\dashboard\fields\Text;
use \koolreport\dashboard\fields\Date;
use \App\Reports\AutoMaker;
class DemoDataTbl extends Timeline
{
protected function dataSource()
{
return AutoMaker::rawSQL
("SELECT
timelineLabel , itemLabel, start, end
FROM
KoolTest
");
}
protected function fields()
{
return [
Text::create("timelineLabel"),
Date::create("start"),
Date::create("end"),
Text::create("itemLabel"),
];
}
}
Board:
<?php
namespace App\Reports\Demo;
use \koolreport\dashboard\Dashboard;
use \koolreport\dashboard\containers\Row;
use \koolreport\dashboard\widgets\Text;
use \koolreport\dashboard\containers\Panel;
use \koolreport\dashboard\containers\Html;
class DemoBoard extends Dashboard
{
protected function widgets()
{
return [
Text::create()->text("<h3>Demo</h3>")->asHtml(true),
Text::create()->text("<p>This is an example of a Dashboard </p>")->asHtml(true),
Row::create([
Panel::create()
->header("<b>Test TimeLine</b>")
->sub([
DemoDataTbl::create()
])
]),
];
}
}