This commit is contained in:
James Cole
2016-12-15 13:47:28 +01:00
parent 482688ac3c
commit b58bc97422
7 changed files with 305 additions and 458 deletions

View File

@@ -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'][] = [