1

I generate a following Gantt chart with plotly: enter image description here

Is there any way to have titles within each of the bars? Where info such as worker or machine performing a task is displayed within the bar.

Edit: Code for the gantt chart

dfJobs = pd.DataFrame([])
for i in range(nJobs):
    for j in range(n[i]):
        # print("i"+str(i)+"j"+str(j))
        if (j == 0) or (j%2 == 0):
            df2 = pd.DataFrame([dict(Task ="Job "+str(i), Start=startTime[i][j], Finish=finishTime[i][j], Resource = "Setup")])
            dfJobs = dfJobs.append(df2)
        else:
            df2 = pd.DataFrame(
                [dict(Task="Job " + str(i), Start=startTime[i][j], Finish=finishTime[i][j], Resource="Production")])
            dfJobs = dfJobs.append(df2)

figJobs = px.timeline(dfJobs, x_start="Start", x_end="Finish", y="Task", color = "Resource")
figJobs.update_yaxes(autorange="reversed")
figJobs.update_layout(title="Gantt-Chart sorted by Jobs")
figJobs.show()
Yan H.
  • 49
  • 4
  • 2
    I suggest adding your code to the question. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Mr. T Mar 04 '21 at 16:37

0 Answers0