我正在使用PHPWord生成Radar Chart,需要强制轴从0开始,但是从最小值开始
$categories = $series = [];
foreach ($groups as $gId => $score) {
$series[] = round($score, 2);
$categories[] = $groups[$gId]->getName();
}
$section->addPageBreak();
$section->addText('Radar Chart', 'chartTitle', ['alignment' => 'center']);
$chart = $section->addChart('radar', $categories, $series, [
'width' => Converter::cmToEmu(17.7),
'height' => Converter::cmToEmu(10.8),
'dataLabelOptions' => [
'showVal' => true,
'showCatName' => false,
'showPercent' => true
],
'colors' => ['dc3545']
]);
$chart->getStyle()->setShowGridY(true);
$chart->getStyle()->setShowGridX(true);
$chart->getStyle()->setShowAxisLabels(true);