I am using Plotly’s Python API to build a Gantt chart for tasks that are discontinuous. The current method available in Ploty’s library can build gantt charts where a task has one start and end date, whereas I am trying to plot a gantt chart for tasks with multiple start and end dates ( task is partially completed at different times). For example, a task may start on Jan 1 2016 and halt on Feb 30 2016, then start again on 1 May 2016 and finish completion on 1 June 2016. The current method only allows input of one start and end date, where a horizontal bar is displayed from the start to the end. I want two (or multiple) horizontal bars to show clearly which periods the task was ‘active’ and ‘inactive’. The link below shows an image of the sort of gantt chart I want to make.
I would appreciate it if someone could let me know how to go about making such a chart.
In regards to your question, there is nothing currently in place that allows for .create_gantt to do what you are requesting. What you would have to do is simply make multiple of the same task in your dictionary/dataframe and assign a different task to each one.
However, this is a very good suggestion and I will work on getting it implemented as soon as I can. Will probably take a week or so as I have several other tasks at the moment.
I have been trying to use create_gantt method to create a gantt chart with discontinuities, using the same code as in @spextrow’s test. However, when specifying group_task=True, I receive an error (TypeError: create_gantt() got an unexpected keyword argument ‘group_task’). I have updated plotly and I continue to get this error. Has anyone else successfully used this method?
sorry for the delayed response.
If you are using the pip version of plot.ly, you cannot use the group_task function. The pip package was last updated on August 23th 2016, as you can see here: https://pypi.python.org/pypi/plotly.
So if you want to use this, you have to either manually install the github version, or wait until the devs upgrade the pip package.
What I have done to get this to work in my current project is to copy or symlink the tools.py file into the currently installed package folder (/site-packages/plotly).
Hi, related to this issue, I’m doing a Gantt chart with discontinuous tasks. I’m using the GitHub master, and create_gantt(data,group_tasks=True) appears to work, but I cannot get an offline chart created. I edited offline.py as described in #399, but I still get
Traceback (most recent call last):
File “<pyshell#3>”, line 1, in/
File “/usr/lib64/python2.7/site-packages/plotly-1.12.10-py2.7.egg/plotly/offline/offline.py”, line 411, in plot
‘100%’, ‘100%’, global_requirejs=False)
TypeError: _plot_html() got multiple values for keyword argument ‘global_requirejs’
Any help or pointers would be appreciated. I’m new to Python, so apologies if this is a silly question.