This is the error I am getting when I try to have monthly sales from my Sql table displayed on a graph using koolreport ( Fatal error: Uncaught Error: Class 'koolreport\widgets\google\ColumnChart' not found in C:\xampp\htdocs\bata\pages\salesrepo.view.php:111 Stack trace: #0 {main} thrown in C:\xampp\htdocs\bata\pages\salesrepo.view.php on line 111).
The code is displayed below
index.php code
<?php
require_once "koolreport/autoload.php";
require_once "salesrepo.php";
$report = new salesrepo;
$report->run()->render();
?>
salesrepo.view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\ColumnChart;
?>
<?php
ColumnChart::create(array(
"dataStore"=>$this->dataStore('sale_by_month'),
"columns"=>array(
"Date_TimeAdded"=>array(
"label"=>"Month",
"type"=>"datetime",
"format"=>"Y-n",
"displayFormat"=>"F, Y",
),
"Value1"=>array(
"label"=>"Value1",
"type"=>"number",
"prefix"=>"$",
)
),
"width"=>"100%",
));
?>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('sale_by_month'),
"columns"=>array(
"Date_TimeAdded"=>array(
"label"=>"Month",
"type"=>"datetime",
"format"=>"Y-n",
"displayFormat"=>"F, Y",
),
"Value1"=>array(
"label"=>"Value1",
"type"=>"number",
"prefix"=>"$",
)
),
"cssClass"=>array(
"table"=>"table table-hover table-bordered"
)
));
?>
salesrepo.php
<?php
require_once "/koolreport/autoload.php";
require_once "/koolreport/koolreport.php";
use \koolreport\KoolReport;
use \koolreport\processes\Filter;
use \koolreport\processes\TimeBucket;
use \koolreport\processes\Group;
use \koolreport\processes\Limit;
class salesrepo extends \koolreport\KoolReport
{
function settings()
{
return array(
"dataSources"=>array(
"sales_repo"=>array(
"connectionString"=>"mysql:host=localhost;dbname=batasales",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
"class"=>"koolreport\dataSources\MySQLDataSource"
),
)
);
}
protected function setup()
{
$this->src('sales_repo')
->query("SELECT Date_TimeAdded,Value1 FROM rm80")
->pipe(new TimeBucket(array(
"Date_TimeAdded"=>"month"
)))
->pipe(new Group(array(
"by"=>"Date_TimeAdded",
"sum"=>"Value1"
)))
->pipe($this->dataStore('sale_by_month'));
}
}
?>