0

I have created a Gantt chart in Plotly Express

fig = px.timeline(short_term, x_start="Starting Date2", x_end="Ending Date2", y="Concat",color="Input Quantity", text="Input Quantity",title = "Production Plan")
fig.add_vline(x=date, line_width=3, line_color="black")
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()

The y = "Concat" is actually a string where I have concatenated some of the information I need for each line in the Gantt chart. But this is not a very elegant solution. Is there any way to put a table or similar right to the left of the chart with the information, or include it in the chart some how? I have an illustration of how it looks now: enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Morten_DK
  • 209
  • 2
  • 12
  • The right way would be to add the y-text you want seen as a column in the dataframe `short_term` so that plotly will take care of the plotting. What is the content of `Concat`, string or an array? Can you not add the relevant text as a column? – Redox Jun 14 '23 at 10:56
  • @Redox - if I add it as a column then it does not look all that pretty, because I need the following informatio: "Order number", "Item number", "Item description", "Quantity". If I add that just as a concatenated string with some kind of seperator between it will look messy as item numbers can vary between 2-15 characters. And I also cannot make any header that would match a normal column structure? – Morten_DK Jun 23 '23 at 08:24

0 Answers0