如何在laravel中的nsoleTVs/Charts charts.js包中添加多个数据集。 我的单个数据集代码运行良好:
$data['transactionChart'] = new TransactionChart();
$data['transactionChart']->dataset('Sample', 'line',[100, 65, 84, 45, 90])
->options(['borderColor' => '#97d881']);
答案 0 :(得分:1)
只需多次使用 - > dataset()。
https://github.com/ConsoleTVs/Charts/issues/331
示例:
$data['transactionChart'] = new TransactionChart();
$data['transactionChart']->dataset('Sample', 'line',[100, 65, 84, 45, 90])
->options(['borderColor' => '#97d881']);
$data['transactionChart']->dataset('Another Sample', 'line',[100, 65, 84, 45, 90])
->options(['borderColor' => '#ff0000']);