Modulo:Graph: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
fix vari |
un po di fix |
||
Riga 24:
if value then
values[index] = value
colors[index] = args[color_string .. index_s] or cfg.default_colors[index] or cfg.default_color
labels[index] = args[label_string .. index_s] or 'xxx'
index = index + 1
else
Riga 31:
end
end
return ''
graph.name = args[cfg.localization.name] or 'grafico a torta'▼
graph.width = args[cfg.localization['width']] or 400▼
graph.height = args[cfg.localization['height']] or 400▼
▲ graph.data = {}
data = {
}
graph.marks[1].properties = {}▼
},
graph.marks[1].properties.enter.x = { group = "width", mult = 0.5 }▼
{
graph.marks[1].properties.enter.y = { group = "height", mult = 0.5 }▼
type = "arc",
graph.marks[1].properties.enter.startAngle = {field = "startAngle"}▼
graph.marks[1].properties.enter.innerRadius = {value = 0}▼
enter = {
graph.marks[1].properties.enter.outerRadius = {value = tonumber(args[cfg.localization.radius]) or 200 }▼
graph.marks[1].properties.enter.stroke = {value = "#000"}▼
endAngle = {field = "endAngle"},
▲ graph.marks[2] = { }
▲
},
enter = {
▲ }
x = { group = "width", mult = 0.5 },
local json = mw.text.jsonEncode(graph, mw.text.JSON_PRETTY)▼
y = { group = "width", mult = 0.5 },
radius = { scale = {value = tonumber(args[cfg.localization.radius]) or 150, offset = 8 }},
theta = { field = "midAngle"},
fill = { value = "#000" },
align = { value = "center" },
baseline = { value = "middle" },
text = { field = "data"}
}
}
}
}
}
end
|