Group by color in px.timeline

how does one create the grouping in px.timeline?
Let’s say I have a dataframe and I want column “Task” on y-axis and I want to color it with “Root Domain” column. But I also want the grouping in y-axis given by the colors as presented in the image. So far I only have

fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color="Root Domain")

Thanks for you advices!

1 Like

I’m trying to figure out the same. I assume it’s done using this barmode=‘group’, but I haven’t implemented it yet for a timeline. Did you ever manage to do it?

Easier than expected!

fig = px.timeline(df, x_start=“Start”, x_end=“Finish”, y=“Task”, color=“Key”, color=“Rood Domain”)