koolreport/charttable
is package to show in both chart and table together.
\koolreport\charttable\ChartTable::create(array(
"name" => "charttable1",
"dataSource" => $this->dataStore('myDatastore')
));
<?php
require_once "MyReport.php";
$report = new MyReport;
$report->run()->render();
<?php
//Step 1: Load KoolReport
require_once "../../../load.koolreport.php";
//Step 2: Creating Report class
class MyReport extends \koolreport\KoolReport
{
function settings()
{
return array(
"dataSources"=>array(
"automaker"=>array(
"connectionString"=>"mysql:host=localhost;dbname=automaker",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
),
)
);
}
protected function setup()
{
$this->src('automaker')
->query("select * from customer_product_dollarsales2 group by customerName limit 15")
->pipe($this->dataStore("sales"));
}
}
<?php
use \koolreport\charttable\ChartTable;
?>
<div class="report-content">
<div class="text-center">
<h1>ChartTable</h1>
<p class="lead">
The basic ChartTable's working
</p>
</div>
<?php
ChartTable::create(array(
"dataSource"=>$this->dataStore("sales"),
"themeBase" => "bs4", // Optional option to work with Bootsrap 4
"options" => [
"paging" => false,
]
));
?>
</div>