# Graph selectedData update

**URL:** <https://community.plotly.com/t/graph-selecteddata-update/32544>\
**Category:** Dash Python\
**Created:** [December 13, 2019, 6:36am UTC](https://community.plotly.com/t/graph-selecteddata-update/32544 "2019-12-13T06:36:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BSen](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BSen](https://community.plotly.com/u/BSen)\
**Post date:** [December 13, 2019, 6:36am UTC](https://community.plotly.com/t/graph-selecteddata-update/32544/1 "2019-12-13T06:36:02Z")

</div>

Hello, I am new here,

I have a dash app that creates graphs dynamically. I want to add a feature that when user select a data one of that dynamically created graphs, other graphs also marked that position. I saw that the selected data attribute is read-only so I can’t change other graphs selected data attribute however I think I can change other graphs layout to add shapes or arrows to mark that position but again I can’t change a graph layout is there any example that changes a graphs layout dynamically?

And is there any update on multiple callback functions for one output? It will be very good for dynamically to create callback functions. Thanks for helping and thanks for creating the awesome Dash. React is too hard for me to create app’s like this.

---

<div class="post-metadata">

**Author:** ![Krichardson](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@Krichardson](https://community.plotly.com/u/Krichardson)\
**Post date:** [December 13, 2019, 2:09pm UTC](https://community.plotly.com/t/graph-selecteddata-update/32544/2 "2019-12-13T14:09:51Z")

</div>

Hello BSen. Welcome to the Dash Community! To do what you’re wanting to do here you would likely want to use to use dcc.State in your callback along these lines.

```auto
@app.callback(Output('graph1', 'figure'),
               [Input('graph2', 'selectedData')],
              [State('graph1', 'figure')])
def update_graph1(selected_data, figure):
    figure['layout'] = [whatever you want to change]
    return figure

```

However if your graphs are plotting a lot of data this will be costly in terms of performance. I would recommend looking into [this](https://community.plotly.com/t/is-it-possible-to-update-just-layout-not-whole-figure-of-graph-in-callback/8300) post. Especially [this response](https://community.plotly.com/t/is-it-possible-to-update-just-layout-not-whole-figure-of-graph-in-callback/8300/14) to help with that.

Best of luck to you BSen!

---

<div class="post-metadata">

**Author:** ![BSen](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BSen](https://community.plotly.com/u/BSen)\
**Post date:** [December 13, 2019, 2:19pm UTC](https://community.plotly.com/t/graph-selecteddata-update/32544/3 "2019-12-13T14:19:57Z")

</div>

Thank you Krichardson it’s worked. But still, I can’t find a way to do this on dynamically created elements and callbacks. I found this [Callback for Dynamically created Graph](https://community.plotly.com/t/callback-for-dynamically-created-graph/5511/4) I understand from here is that I can’t create dynamically created callbacks for dynamically created graphs currently.

Anyway, thank you so much.
