【发布时间】:2020-03-12 12:50:38
【问题描述】:
我在 ChartJS 中使用 Laravel Charts (https://charts.erik.cat/),但遇到了问题。我无法更改图表中的标签位置。
我已尝试以下方法,但我的标签仍位于顶部。我还尝试使用工具提示复制文档中的示例,但这也不起作用。 backgroundColor 函数出于某种原因起作用。
$typeChart->dataset('Aantal', 'pie', [$countCustomers, $countProspects, $countColdLeads, $countHotLeads])
->options([
'backgroundColor' => 'green',
'displayLegend' => true,
'legend' => [
'position' => 'right',
'align' => 'right',
'display' => true
],
'tooltip' => [
'show' => false
]
]);
// $typeChart->options([
// 'tooltip' => [
// 'show' => true // or false, depending on what you want.
// ],
// ]);
【问题讨论】: