facetArea = (data) => ({
type: "facetRect",
data,
width,
paddingLeft: 40,
paddingBottom: 20,
paddingRight: 50,
encode: { y: "symbol" },
axis: { y: { title: false } },
children: [
{
type: "line",
key: "line",
frame: false,
encode: {
x: (d) => new Date(d.date),
y: "price",
color: "symbol",
key: "symbol"
},
style: { shape: "smooth" },
axis: { x: { title: false }, y: { title: false } },
scale: { y: { zero: true, facet: false, tickCount: 3 } },
tooltip: false
},
{
type: "area",
key: "area",
class: "area",
frame: false,
encode: {
x: (d) => new Date(d.date),
y: "price",
color: "symbol",
key: "symbol"
},
style: { shape: "smooth" },
scale: { y: { facet: false, zero: true, tickCount: 3 } },
axis: { x: { title: false }, y: { title: false } },
animate: { exit: { type: "fadeOut" } },
tooltip: false
}
]
})