Hi! I am using chartJs radar for PDF view with export, of the five points of the radar, only the data of two points is shown correctly. I think the problem could be solved if the middle point of the radar takes the value 0. The scale is from 0 to 1. But I can't establish that configuration.
$average_app_margin = $this->dataStore('average_margin_application')->toArray();
if (!count($average_app_margin)) {
echo '<div class="d-flex justify-content-center">
<span class="text-info text-sm-center">No data available</span>
</div>';
} else {
foreach ($average_app_margin as &$row) {
$margin = floatval($row['total_margin'] ?? 0);
$row['total_margin'] = number_format($margin, 2, '.', '');
}
}
RadarChart::create(array(
//"title" => "Margin per Application",
"dataSource" => $average_app_margin,
"columns" => array(
"job_application" => [
"label" => "Application"
],
"total_margin" => [
"label" => "Total Margin",
"type" => 'number',
"suffix" => "%",
],
),
"showLegend" => false,
"widthHeightAutoRatio" => 1.3,
"options" => [
"scales" => [
"r" => [
"suggestedMin" => 0,
"suggestedMax" => 100,
"ticks" => [
"beginAtZero" => true,
],
],
],
],
));