stackOrderAscending function Stack orders Stacks
Returns a series order such that the smallest series (according to the sum of values) is at the bottom.
final stack = Stack(…)..order = stackOrderAscending;
Implementation
List<int> stackOrderAscending(List<List<List<num>>> series) {
var sums = series.map(sum).toList();
return stackOrderNone(series)
..sort((a, b) {
var s = sums[a] - sums[b];
return s > 0
? 1
: s < 0
? -1
: 0;
});
}