# Persisting legend state

**URL:** <https://community.plotly.com/t/persisting-legend-state/14469>\
**Category:** Dash Python\
**Created:** [October 11, 2018, 5:28pm UTC](https://community.plotly.com/t/persisting-legend-state/14469 "2018-10-11T17:28:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![viator](https://avatars.discourse-cdn.com/v4/letter/v/ad7895/32.png) [@viator](https://community.plotly.com/u/viator)\
**Post date:** [October 11, 2018, 5:28pm UTC](https://community.plotly.com/t/persisting-legend-state/14469/1 "2018-10-11T17:28:09Z")

</div>

I have a chart with several plots. Also I have a slider that allows users to subselect chart data.

The problem is if user turns off some traces and then uses slider to switch data period, all disabled plots are shown enabled again.

From my point of view there are two possible ways to solve it:

1. Pass legend state alongside with slider changes.
2. Persist graph state at the user’s browser.

But I cannot find something suitable. Any leads?

Thanks.

---

<div class="post-metadata">

**Author:** ![jorge243](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jorge243/32/6269_2.png) [@jorge243](https://community.plotly.com/u/jorge243)\
**Post date:** [May 17, 2020, 5:28am UTC](https://community.plotly.com/t/persisting-legend-state/14469/2 "2020-05-17T05:28:45Z")

</div>

Hi! Has anyone come up with a solution for this? Persisting legend state would be really useful.

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [May 17, 2020, 6:06am UTC](https://community.plotly.com/t/persisting-legend-state/14469/3 "2020-05-17T06:06:24Z")

</div>

I’d look into uirevision for this. it’s not documented yet but there are some examples in the forum.
