Plot.plot({
width: 1000,
title: "Asset Allocation - %",
y: {
grid: true
},
x: { label: "Date", tickFormat: " " },
marks: [
Plot.ruleY([65], { stroke: "#e15759", strokeOpacity: opacityValue }),
Plot.ruleY([30], { stroke: "#4e79a7", strokeOpacity: opacityValue }),
Plot.ruleY([5], { stroke: "#FFD700", strokeOpacity: opacityValue }),
Plot.lineY(finRet, {
x: (d) => d.date,
y: (d) => d.eqty,
stroke: "#e15759"
}),
Plot.lineY(finRet, {
x: (d) => d.date,
y: (d) => d.debt,
stroke: "#4e79a7"
}),
Plot.lineY(finRet, {
x: (d) => d.date,
y: (d) => d.gold,
stroke: "#FFD700"
}),
Plot.tip(
finRet,
Plot.pointerX({
x: "date",
y: "eqty",
title: (d) =>
d.date +
"\n\n" +
"Equity: " +
d.eqty +
" %" +
"\n" +
"Debt : " +
d.debt +
" %" +
"\n" +
"Gold : " +
d.gold +
" %"
})
)
]
})