Modulo:Sandbox/moroboshi2: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
test lettura anno |
||
Riga 1:
local p = {}
local mWikidata = require('Modulo:Wikidata')
local mChart = require('Modulo:Chart')
local getArgs = require('Module:Arguments').getArgs
function p.demograph(frame)
local args = getArgs(frame)
local
local raw_year = mWikidata._getQualifier({'P1082', 'P585', from=args[1], rank='normal'}, true)
local
--if true then return mw.text.jsonEncode(demograph_data, mw.text.JSON_PRETTY) end▼
local
for i =1, #
▲
local graph_args = {▼
ygrid = true,▼
xtitle = 'anni',▼
ytitle = 'popolazione',▼
graph_type = 'rect',▼
seriesTitles = {'Popolazione'},▼
colors = {'#4682B4'}
}▼
local graph_json = mChart.chart_json(graph_args)▼
--if true then return graph_json end▼
return frame:extensionTag('graph', graph_json)▼
end
▲ local graph_args = {
▲ ygrid = true,
▲ xtitle = 'anni',
▲ ytitle = 'popolazione',
▲ y = { demograph_data },
▲ x = x,
▲ graph_type = 'rect',
▲ seriesTitles = {'Popolazione'},
▲ colors = {'#4682B4'}
▲ }
▲ local graph_json = mChart.chart_json(graph_args)
▲ --if true then return graph_json end
▲ return frame:extensionTag('graph', graph_json)
return p
|