Hey guys,
I am trying to create a Gantt chart using Plotly, the goal of which is to display the activity of a group of servers over a day. For example, a server might be running or stopped, and I would like to display its status over a 24 hour period.
The Gantt chart appears to accomplish this, using a combination of the āUsing Hours and Minutes in Timesā and āGroup Tasks Togetherā examples provided here:
However I am having issues getting this to work. I think the problem may be with how my data appears when uploaded to Plotly, in the example from the tutorial the data appears as below:
Whereas my data appears like this:
My code is basically a carbon copy of the āUsing Hours and Minutesā example, with the addition of grouptasks=True. My data exists in a Pandas Dataframe that is handed to Plotly as such:
graphData = weeklyDetailed_Servers[[āNameā, āStart Timeā, āEnd Timeā, āStatusā]]
graphData = graphData.rename(index=str, columns={āNameā: āTaskā, āStart Timeā: āStartā, āEnd Timeā: āFinishā,
āStatusā: āResourceā})
colors = dict(Running=ārgb(46, 137, 205)ā,
Stopped=ārgb(114, 44, 121)ā)
fig = ff.create_gantt(df, colors=colors, index_col=āResourceā, title=āDaily Scheduleā,
show_colorbar=True, bar_width=0.8, showgrid_x=True, showgrid_y=True, group_tasks=True)
py.plot(fig, filename=āgantt-hours-minutesā, world_readable=True)
Any help or suggestions on fixing this would be greatly appreciated. I am open to using a different graph format as well if there are any better options!
Thanks in advance.