Issue updating candlestick chart and bar chart in dash

Hi there,
First post in this forum!
Basically, I am generating a high frequency candlestick and volume chart and need to update new data rather than entire figure (it’s memory intensive).
Example:

I’m trying to update a Candlestick trace and bar trace at the same time but it’s not working for me. I searched all over in Stackoverflow and here but can’t find a good answer…
Does Plotly Dash not support updating with “extendData” input for multiple traces (candlestick and bar trace)? If not, would Plotly JS support it or it’s inherently a limitation of Plotly? Please advise.
Thanks in advance!

FYI: I’m using an interval component and callback successfully to update the candlestick only. If I try to update both using same callback it won’t work (I believe because traces are of different type).

    return [dict(x=[[x_new]],
                 close=[[close_new]],
                 high=[[high_new]],
                 low=[[low_new]],
                 open=[[open_new]],
                 ),
            [0],
            len(figure["data"][0]["open"])
            ]

hi @hassan
could you share a complete minimal reproducible example code, so we can try to run this locally. Does it work if you update the graphs on separate callbacks?

Thank you @Eledwin who pointed me to GitHub - bcliang/dash-extendable-graph: Graphing component for Dash. Forked from the core Graph component, with modified extend/prepend properties to accept data formats matching `figure["data"]`

This library enabled me to solve my problem.

Closed.

1 Like