KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Too few arguments to function error on ChartJS timeline widget using Dashboard package #2732

Open Andre Van Der Walt opened this topic on on Jun 17, 2022 - 2 comments

Andre Van Der Walt commented on Jun 17, 2022

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()
                            ])
                        ]),
                        
        ];
    } 
}
Andre Van Der Walt commented on Jun 21, 2022

Any assistance here, please?

KoolReport commented on Jun 21, 2022

So sorry for our late reply. Actually the Timeline of chartjs for Dashboard Framework is not available yet. The class koolreport/chartjs/Timeline will not be able to use directly in Dashboard like above. I have asked dev.team for a solution, I will keep you updated.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard