Content deleted Content added
medium fontsize for axis labels |
added option for Y axis intervals, added some space around the title and the axis labels |
||
Line 108:
-- Basis parameters
timeline = timeline .. "ImageSize = width:" .. (args.width or graphwidth) .. " height:" .. (args.height or 300) .. "\n"
timeline = timeline .. "PlotArea = left:50 bottom:70 top:
timeline = timeline .. "AlignBars = justify\n"
Line 159:
timeline = timeline .. "Period = from:0 till:" .. math.ceil(maxviewers) .. "\n"
timeline = timeline .. "TimeAxis = orientation:vertical\n"
timeline = timeline .. "ScaleMajor = gridcolor:gray increment:" .. (args.y_intervals or 10^math.ceil(math.log10(maxviewers)-math.log10(15))) .. " start:0\n"
timeline = timeline .. (args.hidelegend == nil and "Legend = orientation:horizontal\n" or "")
-- Interval parameter set to prevent overlapping bars
local bar = 1
if args.
timeline = timeline .. "BarData =\n"
for k,v in pairs(args) do
if string.lower(v) == 'n/a' then v = '' end
if tonumber(k) ~= nil and (tonumber(v) ~= nil or v == '') and (average == 0 or (average == 1 and args[k+1] ~= '-' and args[k+1] ~= nil)) then
timeline = timeline .. " bar:"..bar.." text:"..((bar == 1 or bar % args.
bar = bar + 1
end
Line 230:
end
timeline = timeline .. "TextData =\n"
timeline = timeline .. " pos:(" .. ((args.width or graphwidth)/2-18) .. ",
timeline = timeline .. " pos:(10," .. ((args.height or 300)-
-- If there's a title, add it with the viewers caption, else just display the viewers caption by itself
if args.title ~= nil and args.title ~= '' then
root:wikitext("'''''" .. args.title .. "''" .. frame:expandTemplate{ title = 'hsp' } ..
": " .. ((countryDisplayUS or countryDisplayUK or countryDisplayOther) or "") .. ((countryDisplayUS or countryDisplayUK or countryDisplayOther) and " v" or "V") .. "iewers per episode (" .. multiple .. ")'''"):css('margin-top', '1em')
else
root:wikitext("'''Viewers per episode (" .. multiple .. ")'''"):css('margin-top', '1em')
end
|