Skip to content

[BUG]: Pie legend, showlegend attributes don't accept array values #5463

@camdecoster

Description

@camdecoster

Description

plotly.js 3.3.1 updated the pie trace to allow arrays of boolean values to be passed in for the legend and showlegend attributes. In plotly.py 6.5.1 (the latest version), the BooleanValidator doesn't allow for arrays. As such, arrays can't be passed in for these attributes in plotly.py.

Steps to reproduce

  • Install plotly.py 6.5.1
  • Run the following code:
    import plotly.graph_objects as go
    
    pie = go.Pie(
        labels=["A", "B", "C"],
        values=[65, 15, 20],
        showlegend=[True, False, False],
    )
    
    fig = go.Figure([pie], go.Layout())
    fig.show()
  • Note the ValueError that's raised

Notes

  • This is the first time that a boolean attribute has had arrayOk as true in the schema. That's why this update is required.

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions