Gantt Chart, set legend/colorbar at the top of chart

Hi guys,

I am replying because I am facing the same issue after trying to use a Gantt Chart.

Blockquote
Hi @MQ94, What version of plotly.py are you using? I think there was a fix for this in version 3.2 (https://github.com/plotly/plotly.py/pull/1110 ). Could you try updating?
-Jon

I don’t consider this as a permanent solution because the solution is just to turn showlegend to False (showlegend = False).

Curious about it, I put a color background to the legend, and it shows something funny.
Could it help Plotly team to understand and fix the issue ?

It seems that every single trace provide a legend but only the last one is active.

Here is the code used :

fig = ff.create_gantt(data_2000.iloc[:5], index_col = 'Resource', show_colorbar=True, bar_width=0.2, showgrid_x=True, showgrid_y=True)
fig['layout'].update(autosize = True, margin = dict(l=100), legend=dict(bgcolor='#E2E2E2'))

Finally, a temporary solution is to set :

traceorder=ā€˜reversed’,

However, if the legend is longer than the chart, the scrollbar keep appearing.

Best,

Quentin.