Displaying a plotly gannt chart to a form

Here is a clone showing how to make a Gannt chart with the Plotly module (as figure_factory is now available on the server side).

Clone:
https://anvil.works/build#clone:XKCOOFPCMRGVWD35=DWU432KT5SA5IVNMJBSH2XY4

Server:

import anvil.server
from plotly import figure_factory as ff

@anvil.server.callable
def get_gannt():

  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)
  return fig

Client:

# in a form with a plot component on it
fig=anvil.server.call('get_gannt')
self.plot_1.figure=fig
5 Likes