mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
Fix #3064
This commit is contained in:
@@ -32,6 +32,7 @@ class ChartJsGenerator implements GeneratorInterface
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -118,7 +119,10 @@ class ChartJsGenerator implements GeneratorInterface
|
|||||||
public function multiSet(array $data): array
|
public function multiSet(array $data): array
|
||||||
{
|
{
|
||||||
reset($data);
|
reset($data);
|
||||||
$first = current($data);
|
$first = current($data);
|
||||||
|
if (!is_array($first)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
|
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
|
||||||
|
|
||||||
$chartData = [
|
$chartData = [
|
||||||
@@ -186,7 +190,7 @@ class ChartJsGenerator implements GeneratorInterface
|
|||||||
$chartData['datasets'][0]['data'][] = (float)app('steam')->positive((string)$value);
|
$chartData['datasets'][0]['data'][] = (float)app('steam')->positive((string)$value);
|
||||||
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
|
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
|
||||||
|
|
||||||
$chartData['labels'][] = $key;
|
$chartData['labels'][] = $key;
|
||||||
++$index;
|
++$index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user