Skip to content

OHCL / candlestick - Just a scatter with x and four y´s ? #284

Answered by SW4T400
SW4T400 asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone trying to resample traces other than scatters, heres a piece of my code that worked for me:

I have a df-store where my original data is stored - this data is resampled based on what the xrange of the last trace in fig.construct_update_data(relayoutdata)

@app.callback(
    Output("graph-id", "figure", allow_duplicate=True),
    Input("graph-id", "relayoutData"),
    State("store", "data"),  # The server side cached FigureResampler per session
    State("df-store", "data"),
    prevent_initial_call=True,
    memoize=True,
)
def update_fig(relayoutdata: dict, fig: FigureResampler,df: pd.DataFrame):
    if fig is not None:
        patched_figure = Patch()  # create patch
        
 …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SW4T400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant