Modulo:Graph: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m stesso fix
aggiorno
Riga 414:
stats =
{
name = "aggregatestats", source = "chart", transform = {
{
{ type = "facetaggregate", groupby = { "x" } },
{ type summarize = "aggregate",{ valuey = "ysum" },
groupby = { "x" }
}
}
}
Line 449 ⟶ 451:
if args.yMin or args.yMax then yscale.clamp = true end
if args.is_stacked then
yscale.___domain = { data = "aggregatestats", field = "sumsum_y" }
else
yscale.___domain = { data = "chart", field = "y" }
Line 497 ⟶ 499:
if args.is_stacked then
-- for stacked charts this lower bound is cumulative/stacking
marks.properties.enter.y2 = { scale = "y", field = "y2layout_end" }
else
--[[
Line 520 ⟶ 522:
if args.graph_type == "line" then marks.properties.enter.strokeWidth = { value = args.stroke_thickness } end
-- stacked charts have their own (stacked) y values
if args.is_stacked then marks.properties.enter.y.field = "ylayout_start" end
-- set interpolation mode
if args.interpolate then marks.properties.enter.interpolate = { value = args.interpolate } end
Line 575 ⟶ 577:
-- for stacked charts apply a stacking transformation
if args.is_stacked then
table.insert(marks.from.transform[2] = { type = "stack", point = "x"1, height = "y" }{
field = "y",
type = "stack",
sortby = { "-_id" },
groupby = { "x" }
})
else
-- for bar charts the series are side-by-side grouped by x