Iโd like to have a functionality similar to the deprecated create_gant()
figure factory option group_tasks = False
, which forces each tasks in the input data frame into its own line in the y-axis, even for repeating tasks.
To illustrate what I mean, the code below produces one single line in the y-axis โJob Aโ for โAlexโ, and puts two bars on this line in the given start-end time.
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28', Resource='Alex'),
dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Resource='Max'),
dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Resource='Max'),
dict(Task="Job A", Start='2009-03-02', Finish='2009-05-30', Resource='Alex')
])
fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color = "Resource")
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()
Produces:
Iโd like:
I tried different arguments for fig.update_yaxes(categoryorder = "")
to no avail.
I also posted this question in stackoverflow