Modulo:Graph: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
Nessun oggetto della modifica
Moroboshi (discussione | contributi)
+colori+etichette
Riga 16:
local color_string = cfg.localization.color
local index = 1
local valuesdata = {}
local colors = {}
local labels = {}
Riga 23:
local value = tonumber(args[value_string .. index_s])
if value then
valuesdata[index] = value{
colors[index] x = args[color_stringlabel_string .. index_s] or cfg.default_colorsargs[index]value_string or cfg.default_color. index_s],
labels[index] = args[label_string .. index_s]y or= 'xxx'value,
color = args[color_string .. index_s] or cfg.default_colors[index] or cfg.default_color
}
index = index + 1
else
Line 31 ⟶ 33:
end
end
if #valuesdata == 0 then
return ''
end
Line 41 ⟶ 43:
{
name = "table",
values = valuesdata,
transform = { { type = "pie", value = "data.y" } }
}
},
Line 51 ⟶ 53:
properties = {
enter = {
x = { field = "data.y", group = "width", mult = 0.5 },
y = { field = "data.y", group = "height", mult = 0.5 },
startAngle = {field = "startAngle"},
endAngle = {field = "endAngle"},
innerRadius = {value = 0},
outerRadius = {value = tonumber(args[cfg.localization.radius]) or 150 },
stroke = {value = "#fff"},
},
update = { fill = {value field = "#cccdata.color"} },
hover = { fill = {value = "pink"} }
},
Line 68 ⟶ 71:
properties = {
enter = {
x = { field = "data.y", group = "width", mult = 0.5 },
y = { field = "data.y", group = "height", mult = 0.5 },
radius = { value = tonumber(args[cfg.localization.radius]) or 150 100, offset = 8 },
theta = { field = "midAngle"},
fill = { value = "#000" },
align = { value = "center" },
baseline = { value = "middle" },
text = { field = "data.x"}
}
}