Module:Television ratings graph: Difference between revisions

Content deleted Content added
default width
Tt appears that "n/a" cells are also included in "numberargs" when calculating the default width, which they shouldn't. What should "N/A cells" be replaced with in this line for example? ... if numberargs < 20 then defaultwidth = (numberargs-N/A cells)*13+98
Line 70:
elseif numberargs >= 50 and numberargs < 80 then barwidth = 6
elseif numberargs >= 80 then barwidth = 5
end
 
-- Default width
local defaultwidth
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
-- Basis parameters
timeline = timeline .. "ImageSize = width:" .. (args.width or defaultwidth1000) .. " height:" .. (args.height or 300) .. "\n"
timeline = timeline .. "PlotArea = left:50 bottom:70 top:20 right:50\n"
timeline = timeline .. "AlignBars = justify\n"
Line 210 ⟶ 202:
end
timeline = timeline .. "TextData =\n"
timeline = timeline .. " pos:(" .. ((args.width or defaultwidth1000)/2-18) .. ",45) textcolor:black fontsize:S text:Episode\n"
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"