Black Lives Matter. Please consider donating to Black Girls Code today.

Gantt Chart integer/float x axis labels instead of date

df = [dict(Task="Job A", Start=2, Finish=5.5, Resource='Apple'),
      dict(Task="Job B", Start=1, Finish=7, Resource='Grape'),
      dict(Task="Job C", Start=1, Finish=2, Resource='Banana')]

I would like to have my gantt chart x axis to show a number or float on the axis instead of the dates that it usually does.

Hi @bhimabi welcome to the forum! You can do this by forcing the xaxis type to be linear (instead of date)

import plotly.figure_factory as ff

df = [dict(Task="Job A", Start=1, Finish=5.5),
      dict(Task="Job B", Start=2, Finish=3),

fig = ff.create_gantt(df)

1 Like