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

Is possible to costomize the tickText font in gantt chart

is possible to costomize the tickText (task Font) font in gantt chart?


Hi @liceblone, the create_gantt function itself doesn’t provide this option. But the nice thing about the figure factory methods is that they simple build a plotly figure, so you are free to customize that figure before displaying it.

Here’s an example of customizing the tickfont after creating the figure using create_gantt.

from plotly.offline import iplot, init_notebook_mode
import plotly.figure_factory as ff

df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28'),
      dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'),
      dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')]

fig = ff.create_gantt(df)
fig.layout.xaxis['tickfont'] = {'family': 'Courier New', 'size': 18}
fig.layout.yaxis['tickfont'] = {'family': 'Courier New', 'size': 18}



See the full set of layout properties here: