Modulo:Demografia/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 44:
{ type = "sort", by = "year" }
},
values = { }
}
},
Riga 53:
range = "width",
zero = false,
___domain = {
},
{
Riga 60:
range = "height",
nice = true,
___domain = {
}
},
axes = {
{
type = "x",
scale = "x",
format = "d",
title = "Anno",
grid = true,
},
{
type = "y",
scale = "y",
title = "Abitanti",
grid = true,
layer = "back"
}
},
marks = {
Riga 73 ⟶ 85:
properties = {
enter = {
interpolate = {
x = {
y = {
stroke =
strokeWidth = {
}
}
Riga 83 ⟶ 95:
{
type = "symbol",
from = {
properties = {
enter = {
x = {
y = {
stroke =
fill =
size =
}
}
Riga 96 ⟶ 108:
{
type = "symbol",
from = {
properties = {
enter = {
x = {
y = {
stroke = {
fill = {
size = {
}
}
Riga 112 ⟶ 124:
properties = {
enter = {
x = {
y = {
align = {
fill = {
text = {
}
}
Riga 127 ⟶ 139:
{
type = "aggregate",
summarize = {
}
}
},
properties = {
enter = {
x = {
y = {
text = {
template = ""
template = "Censimenti dal \u007b{datum.min_year}\u007d al \u007b{datum.max_year}\u007d {{#if:{{{b1|}}}|e dati annuali}}"▼
},
fill = {value = "black"},
fontSize = {value = 16},
align = {value = "center"},
fontWeight = {
}
}
Riga 156 ⟶ 168:
local values1 = { }
for i =1,#populations do
values1[i] = { year = years[i], population = populations[i] }
end
graph['data'][1]['values'] = values1
local values2 = { }
for i =1,#populations2 do
values2[i] = { year = years2[i], population = populations2[i] }
end
graph['data'][2]['values'] = values2
local height = tonumber(args.dimy)▼
end
▲ if height then graph['height'] = height end
if args.dimy then
if height then graph['height'] = height end
end
--if true then return mw.text.jsonEncode(graph) end
▲
if #values2 > 0 then
graph['marks'][5]['properties']['enter']['text']['template'] = template_text .. " e dati annuali"
else
graph['marks'][5]['properties']['enter']['text']['template'] = template_text
end
return titolo .. mw.getCurrentFrame():extensionTag('graph', mw.text.jsonEncode(graph))
end
|