Content deleted Content added
m Dummy edit: Actually, i believe the problem is that "numberargs" includes averages, not N/A. It just so happened that Z Nation ratings, which i am currently testing, has four N/A cells as well as four cells with average ratings. |
Subtracting the averages appears to have fixed it. |
||
Line 16:
-- #000 format
return tonumber("0x"..hex:sub(1,1)..hex:sub(1,1))/256, tonumber("0x"..hex:sub(2,2)..hex:sub(2,2))/256,
tonumber("0x"..hex:sub(3,3)..hex:sub(3,3))/256
else
-- #000000 format
Line 71:
elseif numberargs >= 80 then barwidth = 5
end
-- Basis parameters▼
timeline = timeline .. "ImageSize = width:" .. (args.width or 1000) .. " height:" .. (args.height or 300) .. "\n"▼
timeline = timeline .. "PlotArea = left:50 bottom:70 top:20 right:50\n"▼
timeline = timeline .. "AlignBars = justify\n"▼
timeline = timeline .. "Colors =\n"▼
timeline = timeline .. " id:gray value:gray(0.7)\n"▼
-- Determine number of seasons
Line 88 ⟶ 80:
end
end
-- Default width
local defaultwidth
-- Subtract averages if included (they should be equal to the number of seasons).
if v ~= '' then
if numberargs < 20 then defaultwidth = (numberargs-num_seasons)*13+98
elseif numberargs >= 20 and numberargs < 50 then defaultwidth = (numberargs-num_seasons)*12+98
elseif numberargs >= 50 and numberargs < 80 then defaultwidth = (numberargs-num_seasons)*11+98
elseif numberargs >= 80 then defaultwidth = (numberargs-num_seasons)*10+98
end
else
if numberargs < 20 then defaultwidth = numberargs*13+98
elseif numberargs >= 20 and numberargs < 50 then defaultwidth = numberargs*12+98
elseif numberargs >= 50 and numberargs < 80 then defaultwidth = numberargs*11+98
elseif numberargs >= 80 then defaultwidth = numberargs*10+98
end
end
▲ -- Basis parameters
▲ timeline = timeline .. "ImageSize = width:" .. (args.width or
▲ timeline = timeline .. "PlotArea = left:50 bottom:70 top:20 right:50\n"
▲ timeline = timeline .. "AlignBars = justify\n"
▲ timeline = timeline .. "Colors =\n"
▲ timeline = timeline .. " id:gray value:gray(0.7)\n"
-- Colour and legend variables
Line 202 ⟶ 219:
end
timeline = timeline .. "TextData =\n"
timeline = timeline .. " pos:(" .. ((args.width or
timeline = timeline .. " pos:(10," .. ((args.height or 300)-10) .. ") textcolor:black fontsize:S text:" .. ((countryDisplayUS or countryDisplayUK or countryDisplayOther) or "") .. ((countryDisplayUS or countryDisplayUK or countryDisplayOther) and " v" or "V") .. "iewers (" .. multiple .. ")\n"
|