From: Roman Bazalevsky Date: Tue, 21 Jan 2020 20:52:47 +0000 (+0300) Subject: Обработка масштабирования в графиках. X-Git-Url: https://git.rvb.name/weathermon.git/commitdiff_plain/8627c853b369400956f07390b4dec549f6dde444?ds=sidebyside Обработка масштабирования в графиках. --- diff --git a/bin/weather-lcd b/bin/weather-lcd index 779bc49..8bf8ce5 100755 --- a/bin/weather-lcd +++ b/bin/weather-lcd @@ -201,7 +201,7 @@ function process_graphs() local minval = 99999999 for k=width,1,-1 do if row then - val = row["val"] + val = row["val"] * def["scale"] row = cur:fetch ({}, "a") else val = nil @@ -217,7 +217,7 @@ function process_graphs() local len = math.max(string.len(minvalstr),string.len(maxvalstr)) write_command(conn,"widget_set "..pageid.." "..pageid..".max "..trim(tostring(width-string.len(maxvalstr)+1)).." 2 "..maxvalstr) for k = 3,height-1 do - write_command(conn,"widget_set "..pageid.." "..pageid..".place"..trim(tostring(k)).." "..trim(tostring(width-len+1)).." "..k.." \""..string.rep("-",len).."\"") + write_command(conn,"widget_set "..pageid.." "..pageid..".place"..trim(tostring(k)).." "..trim(tostring(width-len+1)).." "..k.." \" "..string.rep("-",len-1).."\"") end write_command(conn,"widget_set "..pageid.." "..pageid..".min "..trim(tostring(width-string.len(minvalstr)+1)).." "..height.." "..minvalstr) local m = width