Module:Chart: Difference between revisions

Content deleted Content added
m Changed protection settings for "Module:Chart": High-risk template or module: 2578 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
Copyedit. Add number got to error message.
 
(One intermediate revision by one other user not shown)
Line 48:
table.insert( tab,
mw.text.tag( 'ul',
{style="width:100%;list-style:none;column-width:12em;"},
table.concat( list, '\n' )
)
Line 232:
if #values[gi] ~= numValues then error( keywords.group .. " " .. gi .. " does not have same number of values as " .. keywords.group .. " 1" ) end
end
if #xlegends ~= numValues then error( 'Illegal number of ' .. keywords.xlegend .. '. Should be exactly ' .. numValues .. ' not ' .. #xlegends) end
end
 
Line 319:
for j = 1, gi - 1 do
if tonumber(values[j][i]) > 0 then
base = base + math.max( 2, math.floor( values[j][i] / yscales[gi] * chartHeight + 0.5 ) ) -- sum the "i" value of all the groups below our group, gi, and keep the same calculation for each bar
end
end
Line 412:
 
local function drawChart()
table.insert( res, mw.text.tag( 'div', { class = 'chart noresize', style = string.format( 'padding-top:10px;margin-top:1em;max-width:%spx;', width ) } ) )
table.insert( res, mw.text.tag( 'div', { style = string.format("position:relative;min-height:%spx;min-width:%spx;max-width:%spx;", height, width, width ) } ) )