在我的甘特图中,我有两个相同的资源,它们针对一个任务彼此接触.由于是相同的资源,甘特图使用相同的 colored颜色 ,但从视觉上看,它看起来像一个漫长的过程,而不是两个单独的过程.
我正在try 生成如下所示的内容,添加一条线来划分两个过程,或者可能有一种更好的方法来明确区分这两个过程:
下面是一个简短的测试代码:
import pandas as pd
import plotly.figure_factory as ff
values = []
values.append(dict(Task="John",Start=0,Finish=10,Resource="A"))
values.append(dict(Task="John",Start=10,Finish=20,Resource="A"))
df = pd.DataFrame(values)
fig = ff.create_gantt(df, index_col='Resource', bar_width=0.4, show_colorbar=True,
group_tasks=True, title="Simulation")
fig.update_layout(xaxis_type='linear', autosize=False, width=800, height=400)
fig.show()