Fix periods and labels, add some debug info.

This commit is contained in:
James Cole
2026-02-20 14:43:05 +01:00
parent f6cd45a44c
commit 9cbd0380d6
4 changed files with 13 additions and 5 deletions

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Generator\Chart\Basic;
use FireflyIII\Support\ChartColour;
use FireflyIII\Support\Facades\Steam;
use Illuminate\Support\Facades\Log;
/**
* Class ChartJsGenerator.
@@ -92,14 +93,21 @@ class ChartJsGenerator implements GeneratorInterface
*
* // it's five.
*/
public function multiSet(array $data): array
public function multiSet(array $data, array $labels = []): array
{
reset($data);
$first = current($data);
if (!is_array($first)) {
return [];
}
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
Log::debug('Now in multiSet()');
if(0 !== count($labels)) {
Log::debug('Labels are given: ', $labels);
}
if(0 === count($labels)) {
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
Log::debug('Labels are generated: ', $labels);
}
$chartData = [
'count' => count($data),