hoffstadt / hoffstadt/DearPyGui
Provide programmatic access to plot legends' unique ability to show/hide series
- 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.**
There is inconsistent behavior between toggling a series of a plot on/off by clicking its color in the legend and using the hide_item()/show_item() functions. Clicking the legend causes the plot to stop displaying the series and greys out its label in the legend. It can be shown by clicking its label again. Hiding the series by calling hide_item(series) removes it from the plot AND the legend. It can only be returned by calling "show_item(series)".
Additionally, there is no programmatic way to check if a series is being hidden by the legend (its "show" parameter will still equal True) or to cause this effect without clicking.
**Describe the solution you'd like**
I would prefer that the legend behavior be the default behavior of show_item() and hide_item() as applied to a series. This would make it possible to check and control programmatically without introducing new functions or properties of series.
**Describe alternatives you've considered**
For consistency, the current behavior of show_item() and hide_item() applied to a series can remain in order to remove them from the plot and legend without destroying them. A new property or new function would be added to give programmatic checking and control of the special behavior seen when hiding a series using the legend.
**Additional context**
The following images illustrate the normal state of a two-series bar plot, its state when one series is hidden using the legend, and its state when one series is hidden by calling hide_item() using the series ID:



Contributor guide
Assessment
This issue has not been assessed yet.