Plot.plot({
marginLeft: 50,
title: "Cash Flow",
subtitle: htl.html`<h4><span style="color:green">Operating</span> + <span style="color:gold">Investing</span> + <span style="color:red">Financing</span></h4>`,
caption: "Black line is net cash",
grid: true,
y: {line: true},
marks: [
Plot.rectY(data, {x: "FY", y1: "Investing", y2: "Operating", fill: "green", opacity: 0.7, interval: "year"}),
Plot.rectY(data, {x: "FY", y1: "Financing", y2: "Investing", fill: "gold", opacity: 0.7, interval: "year"}),
Plot.rectY(data, {x: "FY", y: "Financing", fill: "red", opacity: 0.7, interval: "year"}),
Plot.rectY(data, {x: "FY", y: (d) => (+d.Operating + +d.Investing + +d.Financing), stroke: "black", interval: "year"}),
Plot.lineY(data, {x: "FY", y: (d) => (+d.Operating + +d.Investing + +d.Financing), stroke: "black"}),
Plot.ruleY([0])
]
})