The above example shows you how to create FunnelChart
using ApexCharts package. In this example, for purpose of chart demonstration only, we do use mock-up data from array. As you can see, the KoolReport's widget in general support dataSource could be DataStore, Process, DataSource or even simple array.
<?php
require_once "../../../../load.koolreport.php";
require_once "MyReport.php";
$report = new MyReport;
$report->run()->render();
<?php
class MyReport extends \koolreport\KoolReport
{
}
<div class="report-content">
<div class="text-center">
<h1>FunnelChart</h1>
<p class="lead">
This example shows how to create beautiful FunnelChart
</p>
</div>
<style>
.apexcharts-canvas {
margin: 0 auto;
}
</style>
<div style="margin-bottom:50px;">
<?php
$data = [
[
'recruitment',
'value'
],
[
"Sourced",
1380
],
[
"Screened",
1100
],
[
"Assessed",
990
],
[
"HR Interview",
880
],
[
"Technical",
740
],
[
"Verify",
548
],
[
"Offered",
330
],
[
"Hired",
200
]
];
\koolreport\apexcharts\FunnelChart::create(array(
"title" => "Recruitment Funnel",
"dataSource" => $data,
"columns" => array(
"recruitment" => [
"label" => "Recruitment"
],
"value" => array(),
),
"options" => [
'dataLabels' => [
'formatter' => "function (val, opt) {
return opt.w.globals.labels[opt.dataPointIndex] + ': ' + val
}",
'dropShadow | enabled' => true,
],
],
"showLegend" => false,
"showLabel" => true,
// "height" => "600px",
// "width" => "85%",
"maxWidth" => "800px",
));
?>
</div>
</div>