打开/关闭搜索
搜索
打开/关闭菜单
317
258
301
4K
异世界百科
导航
首页
alt z
最近更改
alt r
随机页面
alt x
帮助
特殊页面
alt q
上传文件
alt u
相关网站
异世界资料库
常用功能
翻译页面
全部页面列表
切换首选项菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
中文(中国大陆)
个人工具
登录/创建账号
alt o
查看“︁模块:PChart”︁的源代码
来自异世界百科
分享此页面
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论/笔记
更多操作
←
模块:PChart
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
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.filterValue(names, values) -- 变换数据 local newLines = {} if (names ~= nil and names ~= "") then table.insert(newLines, "," .. names) end local oldLines = mw.text.gsplit(values, "\n") for line in oldLines do if (line ~= "") then table.insert(newLines, line) end end return mw.text.listToText(newLines, '\n', '\n') end function p.radar(frame) local size = getArg(frame.args, "size", "320x300") local max = getArg(frame.args, "max", "5") local names = getArg(frame.args, "names", "") local float = getArg(frame.args, "float") local values = getArg(frame.args, "values", "") local legend = getArg(frame.args, "legend", "right") local isDebug = getArg(frame.args, "debug") local html = "" if (float ~= nil and float ~= "center") then html = html .. "<div class=\"float" .. float .. "\">" end local attributes = { size = size, ymax = max, filled = "", striped = "", legend = legend, } if (legend == "true" or legend == "1") then attributes["legend"] = "right" end -- 变换数据 local fullValue = p.filterValue(names, values) if (isDebug ~= "true") then html = html .. frame:extensionTag("pRadar", fullValue, attributes) else html = html .. "pChart Debug: " html = html .. "<pRadar" for key, value in pairs(attributes) do html = html .. " " .. key if (#value ~= 0) then html = html .. "=" .. value end end html = html .. ">\n" html = html .. fullValue .. "\n" html = html .. "</pRadar>" end if (float ~= nil and float ~= "center") then html = html .. "</div>" end return html end return p
该页面使用的模板:
模块:Pchart/doc
(
查看源代码
)
返回
模块:PChart
。