Module:Television ratings graph: Difference between revisions

Content deleted Content added
Colours shouldn't be included without good reason, just like the oranges used in original uses of Template:Television season ratings
default width
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 1000defaultwidth) .. " height:" .. (args.height or 300) .. "\n"
timeline = timeline .. "PlotArea = left:50 bottom:70 top:20 right:50\n"
timeline = timeline .. "AlignBars = justify\n"
Line 202 ⟶ 210:
end
timeline = timeline .. "TextData =\n"
timeline = timeline .. " pos:(" .. ((args.width or 1000defaultwidth)/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"