✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Possible to have dynamic width for bars on Gantt chart? Autosize chart

Hey there,

I was wondering it possible to update the width of a bar in a Gantt chart per a data value? similar to how the show_colorbar function works?

So a large value would equal a wider bar and vice versa.

I have tried entering a list as the value for bar_width which fails.

It seems that I would have to update the y1 values to customize the bar width per the desired value.

        fig = ff.create_gantt(df_chart, colors=['#333F44', '#93e4c1'], index_col='Details',
                   show_colorbar=True,
                   bar_width=0.1,
                   group_tasks=True,
                   showgrid_x=True,
                   showgrid_y=True,
                   title='Gantt')
        print(fig['layout'])
        y = fig['layout']['shapes']
        
        q = [d['y0'] for d in y]
        r = [d['y1'] for d in y]
        
        a=[]
        for f, b in zip(q, width):
            s = f + b 
            print(s)
            a.append(s)
            
            


        fig['layout'].update(autosize=True, width=1500, height=500, margin=dict(l=110))

How would I insert/update the list of new y1 values into the fig[‘layout’] shape?

currently I have set the width manually as by default it is set to 900, any idea to autosize this? autosize=True doesn’t seem to work

thanks