I am trying to have the gantt chart with 2 gantt resources, however I want these gantt resources to be split on y axis separated more than required and hence I tried to update the y axis of the fig data using something like below -
fig_pdx_gantt_multiple.data[3].y = (50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0)
My code is as below -
import plotly.express as px
import plotly.graph_objs as go
from plotly.offline import iplot
fig_pdx_gantt_multiple = plt.figure(figsize=(20,10))
fig_pdx_gantt_multiple = ff.create_gantt(df_pdx_multiple, colors=colors, index_col=âResourceâ, show_colorbar=False,
group_tasks=True,show_hover_fill=True,title=âTimeSpace Diagram only changes in v4_currState temp id = 745â,
showgrid_x=True, showgrid_y=True,bar_width=10, height = 500)
fig_pdx_gantt_multiple[âlayoutâ][âyaxisâ].update(ticktext= [âMarketStreetâ , âBroadwayâ])
fig_pdx_gantt_multiple[âlayoutâ][âyaxisâ].update(range=[-300,200])
fig_pdx_gantt_multiple.update_xaxes(rangeslider_visible=True)
fig_pdx_gantt_multiple.update_layout(showlegend=True)
fig_pdx_gantt_multiple.data[3].y = (50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0)
fig_pdx_gantt_multiple.data[4].y = (50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0)
fig_pdx_gantt_multiple.data[5].y = (50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,50,50,50,50,50,50,50,50,50,
50,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0)
for tr in fig_pdx.data:
fig_pdx_gantt_multiple.add_trace(tr)
for tr in fig_pdx_street.data:
fig_pdx_gantt_multiple.add_trace(tr)
fig_pdx_gantt_multiple.show()
Currently I can see -
Required graph is something like this - (this is some data hack I did to achieve this)
Please let me know how can I achieve the second graph without hacking with dataâŚ
Thanks