Content deleted Content added
m replace deprecated "Image:" with "File:" |
Copyedit. Add number got to error message. |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 48:
table.insert( tab,
mw.text.tag( 'ul',
{style="
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 314:
local function calcHeights( gi, i, val )
local barHeight = math.max( 2, math.floor( val / yscales[gi] * chartHeight + 0.5 ) ) -- add half to make it "round" instead of "trunc", min height to 2 to avoid negative bar sizes
local top, base = chartHeight - barHeight, 0
if stack then
if tonumber(values[j][i]) > 0 then
base = base + math.
end
end
▲ end
return barHeight, top - base
end
Line 406 ⟶ 405:
setOffset, setWidth = groupBounds( i )
-- setWidth = 0.85 * setWidth
table.insert( res, mw.text.tag( 'div', { style = string.format( legendDivStyleFormat, setOffset +
table.insert( res, mw.text.tag( 'div', { style = string.format( tickDivstyleFormat, setOffset + setWidth / 2 ) }, '' ) )
end
Line 413 ⟶ 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 ) } ) )
|