Modulo:Graph: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
+colori+etichette |
||
Riga 16:
local color_string = cfg.localization.color
local index = 1
local
local colors = {}
local labels = {}
Riga 23:
local value = tonumber(args[value_string .. index_s])
if value then
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 #
return ''
end
Line 41 ⟶ 43:
{
name = "table",
values =
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 = {
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
theta = { field = "midAngle"},
fill = { value = "#000" },
align = { value = "center" },
baseline = { value = "middle" },
text = { field = "data.x"}
}
}
|