Skip to content

Duplicate clear methods in LegendItem #1227

@ixjlyons

Description

@ixjlyons

def clear(self):
"""Removes all items from legend."""
for sample, label in self.items:
self.layout.removeItem(sample)
self.layout.removeItem(label)
self.items = []
self.updateSize()
def clear(self):
"""
Removes all items from the legend.
Useful for reusing and dynamically updating charts and their legends.
"""
while self.items != []:
self.removeItem(self.items[0][1].text)

Any preference?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions