arcchart: Also compute the sum when the limits are provided.

The result was used even when it wasn't computed.
This commit is contained in:
Emmanuel Lepage Vallee 2019-01-26 11:03:39 -05:00
parent 090f80d173
commit dbb552097c
1 changed files with 4 additions and 3 deletions

View File

@ -104,10 +104,11 @@ function arcchart:after_draw_children(_, cr, width, height)
local max_val = self:get_max_value()
local sum = 0
for _, v in ipairs(values) do
sum = sum + v
end
if not max_val then
for _, v in ipairs(values) do
sum = sum + v
end
max_val = sum
end