Fixes ordering for aggregated widget data

This commit is contained in:
Simone Mainardi 2021-01-20 17:47:24 +01:00
parent 99edf545e5
commit 8e358bc9c8

View file

@ -57,7 +57,7 @@ function slices:aggregate()
end
-- Sort by descending `v`alue of slice
for _, slice in pairsByField(self._data, 'v', rev) do
for _, slice in ipairs(self._data) do
local slice_key = slice.k
if cur_slice < self.meta.max_num_slices and slice.v / total_value * 100 > self.meta.other_threshold_pct then