The above example shows you how to create RadialBarChart
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>RadialBarChart</h1>
<p class="lead">
This example shows how to create beautiful RadialBarChart
</p>
</div>
<style>
.apexcharts-canvas {
margin: 0 auto;
}
</style>
<div style="margin-bottom:50px;">
<?php
$data = [
[
'label',
'series-1'
],
[
'Median Ratio',
67
]
];
\koolreport\apexcharts\RadialBarChart::create(array(
// "title" => "Product Trends by Month",
"dataSource" => $data,
"columns" => array(
"label",
"series-1"
),
"options" => [
'chart | offsetY' => -10,
'plotOptions | radialBar' => [
'startAngle' => -135,
'endAngle' => 135,
'dataLabels | name' => [
'fontSize' => '16px',
'color' => null,
'offsetY' => 120
],
'dataLabels | value' => [
'offsetY' => 76,
'fontSize' => '22px',
'color' => null,
'formatter' => 'function (val) {
return val + "%";
}'
]
],
'fill | gradient' => [
'shade' => 'dark',
'shadeIntensity' => 0.15,
'inverseColors' => false,
'opacityFrom' => 1,
'opacityTo' => 1,
'stops' => [
0,
50,
65,
91
]
],
'stroke | dashArray' => 4,
],
'fillType' => 'gradient',
"showLegend" => false,
// "showLabel" => true,
// "height" => "600px",
// "width" => "85%",
"maxWidth" => "450px",
));
?>
</div>
</div>