mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Fix small issue in chart.
This commit is contained in:
@@ -112,10 +112,12 @@ class ChartJsGenerator implements GeneratorInterface
|
|||||||
// sort by value, keep keys.
|
// sort by value, keep keys.
|
||||||
// different sort when values are positive and when they're negative.
|
// different sort when values are positive and when they're negative.
|
||||||
asort($data);
|
asort($data);
|
||||||
if(bccomp(next($data),'0') === 1) {
|
$next = next($data);
|
||||||
|
if (!is_bool($next) && bccomp($next, '0') === 1) {
|
||||||
// next is positive, sort other way around.
|
// next is positive, sort other way around.
|
||||||
arsort($data);
|
arsort($data);
|
||||||
}
|
}
|
||||||
|
unset($next);
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
|
Reference in New Issue
Block a user