Stock Tickers with dynamic controls

I am looking to create a app tat looks like the dash demo Stock Tickers, but with controls added for each new graphs. So when I add a ticker, not only do I get a graph, but also a few buttons and input box attached to that graph.
Is this possible in dash?

It is possible, you will just fill out whatever content you want inside some component’s children property. I recommend reading through the user guide carefully: Part 2. Layout | Dash for Python Documentation | Plotly and then searching through this forum for 'children'.

Many thanks Chris.
Yes I knew how to return those controls but the thing I am struggling with is how do I make sure that those new controls added also trigger callback to update to right graphs.
For example if in the children I return two figures and two corresponding buttons, I want to update the period of one of graphs if I click one of the button

They will trigger automatically when they are rendered

@chriddyp I think that @yellowpower is trying to create callbacks dynamically, after the app is loaded. So e.g user selects two stocks from a dropdown, now two graphs are created and each one also gets a radio button that controls the graph, so it’s a callback with an output that’s dynamically created.

As far as I can tell, the options are

  1. Have a fixed maximum number of selections. Create the graphs + controls upfront and hide them all. Then when the user selects some items, assign them to graphs 1 through k and unhide those.

  2. Create a custom component that encompasses both the graph and the control and has the responsiveness built in.

Are there other options? I’m very interested in this type of setup also.

1 Like

@chubukov thanks! I didn’t explain it too well but yes that’s exactly what I mean. Option 1 is what I am currently trying. I am quite curious about option 2 how do you actually have the responsiveness built in