模块:PChart
来自异世界百科
此模块的文档可以在模块:PChart/doc创建
local p = {}
function getArg(args, key, default)
local val = args[key]
if(val == nil or #val == 0 or val == "{{{" .. key .. "}}}") then
return default
else
return val
end
end
function p.radar(frame)
local size = getArg(frame.args, "size", "200x200")
local max = getArg(frame.args, "max", "5")
local names = getArg(frame.args, "names", "Data")
local float = getArg(frame.args, "float")
local values = getArg(frame.args, "values", "")
local html = ""
if(float ~= nil or float == "center" or #float == 0) then
html = html .. "<div class=\"float" .. float .. "\">"
end
html = html ..
frame:extensionTag("pRadar", "," .. names .. "\n" .. values, {
size = size,
ymax = max,
filled = "",
striped = "",
})
if(float ~= nil or float == "center" or #float == 0) then
html = html .. "</div>"
end
return html
end
return p