# -*- coding:utf-8 -*-

# pip install plotly -i https://pypi.tuna.tsinghua.edu.cn/simple

import plotly as py
import plotly.figure_factory as ff

pyplt = py.offline.plot

### test1
df = [dict(Task = "项目1", Start = '2015-02-05', Finish = '2019-08-28'),
      dict(Task="项目4", Start='2019-09-05', Finish='2022-05-25'),
      dict(Task = "项目2", Start = '2019-09-05', Finish = '2022-05-25'),
      dict(Task = "项目3", Start = '2022-05-26', Finish = '2023-04-17'),

      ]

fig = ff.create_gantt(df)
pyplt(fig, filename='t1.html')      # 貌似只能存为 html 文件

 

posted on 2023-04-25 11:48  大话人生  阅读(81)  评论(0)    收藏  举报