Live
Senin, 31 Agustus 2026 | Humas PA Amuntai
<?php<?php// Assuming the necessary KoolReport and widget libraries are correctly included
require_once "../../../load.koolreport.php";require_once "MyReport.php";
// Define the MyReport classclass MyReport extends \koolreport\KoolReport { protected function setup() { // Assuming $this->src() is properly defined in the parent class to return a data source $this->src('YourDataSource') // Specify your actual data source here ->pipe($this->dataStore('category_sales')); // Store the result in 'category_sales' }}
// Create an instance of MyReport and run it$report = new MyReport;$report->run();
// Data for the chart, this could also be fetched from a database or any other source$category_amount = array( array("category"=>"Books", "sale"=>32000, "cost"=>20000, "profit"=>12000), array("category"=>"Accessories", "sale"=>43000, "cost"=>36000, "profit"=>7000), array("category"=>"Phones", "sale"=>54000, "cost"=>39000, "profit"=>15000), array("category"=>"Movies", "sale"=>23000, "cost"=>18000, "profit"=>5000), array("category"=>"Others", "sale"=>12000, "cost"=>6000, "profit"=>6000),);
// Render the PieChart?>
<div class="report-content"> <div class="text-center"> <h1>PieChart</h1> <p class="lead">This example shows how to draw beautiful PieChart</p> </div> <div style="margin-bottom:50px;"> <?php \koolreport\widgets\google\PieChart::create(array( "title"=>"Sale Of Category", "dataSource"=>$category_amount, // Use the data prepared above "columns"=>array( "category", "sale"=>array( "type"=>"number", "prefix"=>"$", ) ) )); ?> </div></div>
{/source}