mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Sort fix #698 [skip ci]
This commit is contained in:
parent
2bf54d0b8e
commit
c4ff05b1ba
@ -110,7 +110,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.
|
||||||
asort($data);
|
asort($data);
|
||||||
|
if(bccomp(next($data),'0') === 1) {
|
||||||
|
// next is positive, sort other way around.
|
||||||
|
arsort($data);
|
||||||
|
}
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user