mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-03 04:41:41 +00:00
Code for #452
This commit is contained in:
@@ -52,11 +52,16 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
*/
|
||||
public function multiSet(array $data): array
|
||||
{
|
||||
reset($data);
|
||||
$first = current($data);
|
||||
$labels = array_keys($first['entries']);
|
||||
|
||||
$chartData = [
|
||||
'count' => count($data),
|
||||
'labels' => array_keys($data[0]['entries']), // take ALL labels from the first set.
|
||||
'labels' => $labels, // take ALL labels from the first set.
|
||||
'datasets' => [],
|
||||
];
|
||||
unset($first, $labels);
|
||||
|
||||
foreach ($data as $set) {
|
||||
$chartData['datasets'][] = [
|
||||
|
||||
Reference in New Issue
Block a user