hoffstadt / hoffstadt/DearPyGui

Plot 'toggle data series' callback

Open
#2,618 0 comments 1 reaction 0 assignees View on GitHub
state: pending type: improvement
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

### 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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.