3

I've done a bit of research and found that plotly does not natively support click and hover events like the scatter plot does. Can someone find a way around this? I need to be able to click on a Task and use it in a callback to feed to another component in Dash.

fig = ff.create_gantt(df, height=y * 15, bar_width=0.2, index_col='Resource', show_colorbar=True,
                      group_tasks=True, title='Tags Timeline')
fig.update_layout(
    xaxis=dict(
        rangeselector=dict(
        ),
        rangeslider=dict(
            visible=True
        ),
        type="category",
        autorange=False,
        range=(0,30)
    )
)
@app.callback(
    Output("video-display", "currentTime"),
    [Input("tags-timeline", "clickData")],
)
def sync_timeline_video(clickData):
    if clickData:
        print(clickData)
    else:
        print("none yet")

Thank you

Aliisa Roe
  • 136
  • 2
  • 8

0 Answers0