Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created May 10, 2024 10:09
Show Gist options
  • Save vnegi10/f1b4b171dfdf53e0d65533daea62edb4 to your computer and use it in GitHub Desktop.
Save vnegi10/f1b4b171dfdf53e0d65533daea62edb4 to your computer and use it in GitHub Desktop.
export function plotBreakdownArea(stackArray, {width} = {}) {
  return Plot.plot({
    width,
    //title: "Portfolio breakdown",
    x: {label: "Time [days]"},
    y: {grid: true, label: "Value [euros]", domain: [0, domain_max]},
    color: {legend: true},
    marks: [
      Plot.areaY(stackArray, {
        x: "time",
        y: "value",
        interval: "day",
        fill: "name",
        tip: true
        }),
      Plot.ruleY([0])
      ]
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment