Skip to content

Plot 'toggle data series' callback #2618

@SergioDhe-DropLab

Description

@SergioDhe-DropLab

Is your feature request related to a problem? Please describe.

I have a small app that reads data from 5 sensors, and a plot that reads the maximum and minimum outputs from said sensors to automatically updates the y-axis limits to fit all the data neatly.
This works, but I often only care about one of the sensors, so I toggle the other 4 off by clicking them on the plot legend.

The only issue I have here is that (as far as I could find looking through the properties of data series and plot legends) there is no real way of detecting if a data series is toggled on/off.

This means I can't have my y-axis limit controller ignore the series I have toggled off to focus on the sensor I care about.

Describe the solution you'd like

I would love an optional callback: Callable =None argument for add_line_series() that could allow me to specify behaviour when the series is toggled on or off through the legend.

Describe alternatives you've considered

I have tried is_item_shown() and get_item_configuration() but I have not found any property or callback I can read to check if the data series is toggled on/off.

For now I might add some checkboxes to hide the unwanted data but it would be nice to have it built in to the plot.

Additional context

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions