Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created May 10, 2024 10:07
Show Gist options
  • Save vnegi10/2a369504b1693916f80f645c58256611 to your computer and use it in GitHub Desktop.
Save vnegi10/2a369504b1693916f80f645c58256611 to your computer and use it in GitHub Desktop.
export function plotBreakdownBar(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.rectY(stackArray, {
          x: "time",
          y: "value",
          interval: "day",
          fill: "name",
          tip: true
          })
        ]
    });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment