Module:Television ratings graph: Difference between revisions

Content deleted Content added
No edit summary
Add border.
Line 122:
-- Add bars to timeline, one per viewer figure
local bar = 1
local season = 10
local thisseason = 0
Line 128:
if tonumber(k) ~= nil then
if v == '-' then
-- Hyphen means new season, so change season colour
timeline = timeline .. " color:season" .. season .. "\n"
season = season + 1
-- Determine highest number of episodes in a season
if thisseason > longestseason then
Line 137:
thisseason = 0
elseif average == 0 or (average == 1 and (args[k+1] == '-' or args[k+1] == nil) == false) then
-- Include black bar to act as border
timeline = timeline .. " color:black\n"
timeline = timeline .. " bar:" .. bar .. " width:" .. (barwidth+2) .. " from:start till:" .. (v ~= '' and v or 'start') .. "\n"
-- Include bar for viewer figure, do not include if averages are included and the next parameter is a new season marker
timeline = timeline .. " color:season" .. season .. "\n"
timeline = timeline .. " bar:" .. bar .. " from:start till:" .. (v ~= '' and v or 'start') .. "\n"
-- Increment tracking variables
thisseason = thisseason + 1
bar = bar + 1