Modulo:Demografia/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica |
use require("strict") instead of require("Module:No globals") |
||
(4 versioni intermedie di un altro utente non mostrate) | |||
Riga 1:
require("
local getArgs = require('Module:Arguments').getArgs
local p = {}
Riga 45:
if (minimo == nil or years[i] < minimo) then minimo = years[i] end
if (massimo == nil or years[i] > massimo) then massimo = years[i] end
t = string.format("%g",math.floor(
t = t:gsub('%.',',')
values[i] = { year = years[i], population = populations[i], num = i, txt = t }
Riga 137:
title = "Anno",
grid = true,
properties = {
labels = { font = { value = "Helvetica" } }, title = { font = { value = "Helvetica" } }
}
},
{
Riga 146 ⟶ 148:
grid = true,
layer = "back",
properties = {
labels = { font = { value = "Helvetica" } }, title = { font = { value = "Helvetica" } }
}
}
},
Riga 225 ⟶ 229:
fill = {value = "black"},
fontSize = {value = 14},
font = {value = "Helvetica"},
align = {value = "center"},
fontWeight = {value = "bold"}
Riga 256 ⟶ 261:
if args.etichette == "dispari" then
-- mostra solo etichette dispari
graph['marks'][4]['from']['transform'] = {{ type = "filter", test = "
elseif args.etichette == "pari" then
-- mostra solo etichette pari
graph['marks'][4]['from']['transform'] = {{ type = "filter", test = "
elseif args.etichette == "tabella" then
-- nasconde etichette e crea tabella a fianco
Riga 266 ⟶ 271:
tabella2 = mostraTabella(years, populations, fattore)
end
end
--if true then return mw.text.jsonEncode(graph) end
Riga 278 ⟶ 281:
if (massimo - minimo > 1) then
graph['scales'][1]['domainMin'] = minimo - (massimo-minimo)*0.
graph['scales'][1]['domainMax'] = massimo + (massimo-minimo)*0.
end
|