Modulo:Demografia/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 2:
local getArgs = require('Module:Arguments').getArgs
local p = {}
 
local minimo, massimo
 
-- =====================================================================
Riga 40 ⟶ 42:
local values = { }
for i =1,#populations do
values[i]if (minimo == {nil year =or years[i], population< =minimo) populations[i],then numminimo = years[i] }end
if (massimo == nil or years[i] > massimo) then massimo = years[i] end
t = string.format("%g",math.floor(10*populations[i]+0.5)/10)
t = t:gsub('%.',',')
values[i] = { year = years[i], population = populations[i], num = i, txt = t }
end
return values
Riga 130 ⟶ 136:
title = "Anno",
grid = true,
labels = { font = { value = "Helvetica" } },
title = { font = { value = "Helvetica" } },
},
{
Riga 136 ⟶ 144:
title = "Abitanti",
grid = true,
layer = "back",
labels = { font = { value = "Helvetica" } },
title = { font = { value = "Helvetica" } },
}
},
Riga 189 ⟶ 199:
align = {value = "center"},
fill = {value = "#000"},
text = {field = "populationtxt" },
font = {value = "Helvetica"},
}
}
Riga 264 ⟶ 275:
graph['marks'][5]['properties']['enter']['text']['template'] = template_text
end
if (massimo - minimo > 1) then
graph['scales'][1]['domainMin'] = minimo - (massimo-minimo)*0.05
graph['scales'][1]['domainMax'] = massimo + (massimo-minimo)*0.05
end
local ris = {}
table.insert(ris,titolo)