mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 13:16:31 +00:00
🤖 Auto commit for release 'develop' on 2026-03-13
This commit is contained in:
@@ -39,7 +39,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
*/
|
||||
public function multiCurrencyPieChart(array $data): array
|
||||
{
|
||||
$chartData = ['datasets' => [0 => []], 'labels' => []];
|
||||
$chartData = ['datasets' => [0 => []], 'labels' => []];
|
||||
|
||||
$amounts = array_column($data, 'amount');
|
||||
$next = next($amounts);
|
||||
@@ -117,7 +117,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
unset($first, $labels);
|
||||
|
||||
foreach ($data as $set) {
|
||||
$currentSet = ['label' => $set['label'] ?? '(no label)', 'type' => $set['type'] ?? 'line', 'data' => array_values($set['entries'])];
|
||||
$currentSet = ['label' => $set['label'] ?? '(no label)', 'type' => $set['type'] ?? 'line', 'data' => array_values($set['entries'])];
|
||||
if (array_key_exists('yAxisID', $set)) {
|
||||
$currentSet['yAxisID'] = $set['yAxisID'];
|
||||
}
|
||||
@@ -143,7 +143,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
*/
|
||||
public function pieChart(array $data): array
|
||||
{
|
||||
$chartData = ['datasets' => [0 => []], 'labels' => []];
|
||||
$chartData = ['datasets' => [0 => []], 'labels' => []];
|
||||
|
||||
// sort by value, keep keys.
|
||||
// different sort when values are positive and when they're negative.
|
||||
@@ -178,7 +178,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
return [
|
||||
'count' => 1,
|
||||
'labels' => array_keys($data), // take ALL labels from the first set.
|
||||
'datasets' => [['label' => $setLabel, 'data' => array_values($data)]],
|
||||
'datasets' => [['label' => $setLabel, 'data' => array_values($data)]],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user