Iโm attempting to apply a custom zoom to a gantt chart iโve created with plotly express, using the template and docs here:
My plot is fairly simple:
fig = px.timeline(df,x_start='start_date',x_end='end_date',y='milestone_name',color='milestone_type',range_x=[dt.now().date()-time_delta(days=3),dt.now().date()+time_delta(days=3)])
fig.update_traces(hovertemplate='Task: %{y}<br>Start: %{base|%m-%d-%Y}<br>End: %{x|%m-%d-%Y}')
fig.add_vline(x=dt.now().date(), line_width=3, line_color='blue')
fig.update_layout(yaxis=dict(title='Milestone',side='left'),xaxis=dict(title='Date'),showlegend=False)
fig.update_yaxes(autorange='reversed')
I can apply a custom range_x without issue using dates. But I canโt figure out what is required for a custom range_y.
Iโve tried:
- The two applicable milestone_names
- The indexes of the two milestone_names
- Two numbers in the range [0,1]
- Two numbers in the range [0,100]
None of these seem to effect the y range zoom. Is it possible to apply a custom y range zoom to a px timeline?
Thanks in advance!