Update the layout after callback updated a plot

Hi All,

In my application, I have a stacked bar chart. Using ClickData i need to get the ‘name’ attribute of the plot. Using the solution here: get trace names, I proceeded to get the name through app.layout properties as below:
name = layout[‘bar_plot’].figure[‘data’][curve_num][‘name’]

But, a small problem here, my app.layout keeps changing the plot based on the user interaction. So, I can no longer use this solution.

Is there a way to update the layout properties after a callback changes it? Or any help to get the trace name would also be helpful.

Thank you!

You could try a callback listening to the chart’s figure property as a State while the Input is the clickData, then use the same figure[‘data’][curve_num][‘name’] process.

Yes, that worked! thank you for replying :slight_smile: