{
const area = {
type: "area",
paddingLeft: 0,
paddingRight: 0,
paddingBottom: 0,
paddingTop: 0,
axis: false,
data,
scale: {
color: { type: "identity" }
},
encode: {
x: "x",
y: "y",
color: "color",
series: "series",
key: (d) => `(${d.x}, ${d.y})`,
shape: "smooth"
}
};
const chart = G2.render({
type: "timingKeyframe",
width: width,
height: 500,
direction: "alternate",
iterationCount: 10,
duration: 1500,
children: [
area,
{ ...area, transform: [{ type: "stackY" }] },
{ ...area, transform: [{ type: "stackY" }, { type: "normalizeY" }] },
{ ...area, transform: [{ type: "stackY" }, { type: "symmetryY" }] }
]
});
return chart;
}