Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
by reference "koolreport\amazon\ChartCard"
protected function drawChart($dataStore,$columns,$height,$color,$backgroundColor="transparent")
{
if ($columns==array()) {
$firstRow = $dataStore->get(0);
$keys = array_keys($firstRow);
if (count($keys)>1) {
$columns = array(
$keys[0]=>array(),
$keys[1]=>array(),
);
}
}
$keys = array_keys($columns);
if (count($keys)<2) {
return null;
}
if (!isset($columns[$keys[1]]["config"])) {
$columns[$keys[1]]["config"] = array();
}
$columns[$keys[1]]["config"]["backgroundColor"] = $backgroundColor;
$columns[$keys[1]]["config"]["borderColor"] = $color;
return AreaChart::html(array(
"dataSource"=>$dataStore,
"columns"=>$columns,
"colorScheme"=>array($color),
"height"=>$height,
"options"=>array(
"maintainAspectRatio"=>false,
"legend"=>array(
"display"=>false,
),
"scales"=>array(
"xAxes"=>array(
array(
"display"=>false,
)
),
"yAxes"=>array(
array(
"display"=>false,
)
)
),
"elements"=>array(
"line"=>array(
"borderWidth"=>2,
),
"point"=>array(
"radius"=>0,
"hitRadius"=>10,
"hoverRadius"=>4,
)
)
)
));
}
echo $this->drawChart(
$this->chartDataStore,
$this->chartColumns,
"100px",
"rgba(0,0,255,.55)",
"rgba(0,0,255,.2)"
);
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo