Skip to content

[BUG]: legend does not exist in type PlotData #7767

@FlorianPix

Description

@FlorianPix

Description

As shown in this example from the docs I'd like to add two legends for two subplots.
But the PlotData type does not include the legend attribute and therefore I get an error during my build.
I am using plotly.js-dist-min 3.4.0 and @types/plotly.js-dist-min 2.3.4.

const traces: Partial<Plotly.PlotData>[] = [
    {
      name: "Off",
      type: "bar",
      orientation: "h",
      y: y,
      x: x,
      legend: "legend", // <-- Here's the error !
      xaxis: "x",
      yaxis: "y",
    },
    ...
]

A similar problem exists in Layout where legend2, legend3 and so on are missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions