| Name | Gantt Chart Plugin |
|---|---|
| Author(s) | |
| Priority | Medium |
| Description | Allow creation of Gantt Chart from Wiki Markup |
http://forums.atlassian.com/thread.jspa?messageID=257223025
| Chart version 1.8 released 1.8 contains the proposal below as a beta. I have moved some of the documentation from here to Gantt Charts. Discussions and/or issues welcome. |
Proposal
- Add a gantt chart to the Chart Plugin based on the information and comments below.
- One issue is how to specify the data for a chart - the following gives some detail on this
Example 1 - simple
| Plan | Start | End |
|---|---|---|
| Create issue | 1/30/2007 | 2/1/2007 |
| Provide examples | 1/30/2007 | 2/7/2007 |
| Write code/tests | 2/3/2007 | 2/4/2007 |
| Write docs | 2/4/2007 | 2/5/2007 |
| Release update | 2/5/2007 | 2/5/2007 |
Example 2 - more features
| Category | Parent task |
Task | Start | End | Percent complete |
|---|---|---|---|---|---|
| Plan | Create issue | 1/30/2007 | 2/1/2007 | 30% | |
| Actual | Create issue | 1/30/2007 | +3 | 100% | |
| Plan | Provide examples | 1/30/2007 | 2/7/2007 | 40% | |
| Plan | Code | 2/3/2007 | 2/4/2007 | ||
| Plan | Code | Initial code | 2/3/2007 | +1 | |
| Plan | Code | Tests | 2/3/2007 | +2 | |
| Plan | Code | Final | 2/4/2007 | +2 | |
| Plan | Write docs | 2/4/2007 | 2/5/2007 | ||
| Plan | Release update | 2/5/2007 | 2/5/2007 |
Notes
- Multiple tables can be used (just like other charts)
- Only dataOrienction=vertical is supported (there are no horizontal data layouts proposed)
- Rows represent tasks (or subtasks)
- Dates are specified in format defined by the dateFormat parameter (like other time based charts)
- Percent complete column is optional
- Category column is optional, if not provided header column 1 will be the category name
- Parent column is optional, if not provided, you cannot specify subtasks
- End time can be specified as a full date or as a duration added to the start time
- Duration is measured in number of units specified by the timePeriod parameter
- Can be specified as a simple number like 1 or +1
- full date and duration times can be intermixed
- To specify a subtask, the parent task must be provided
- Column selection would be done by a general columns parameter being added to the Chart Plugin via CHRT-28
- Other possibilities
- Allow start time to be specified as a delta over some global start time
- Allow start time to be determined as a delta from the end date of a "depends on" task - this would need another optional column
- Allow subsequent category names to be blank and default to previous category name to make input tables easier to make and read
I think this is pretty easy. I propose you write up a issue against the Chart Plugin and I can put it in. The more details or examples you can provide the better. Look here at the examples that are possible. I haven't looked at the details yet, but I am thinking the input is a just a simple table something like:
| Task | Start | End |
|---|---|---|
| Create issue | 1/30/2007 | 2/1/2007 |
| Provide examples | 1/30/2007 | 2/7/2007 |
| Write code/tests | 2/3/2007 | 2/4/2007 |
| Write docs | 2/4/2007 | 2/5/2007 |
| Release update | 2/5/2007 | 2/5/2007 |
Also need to add another (optional) column for % complete.
Now I see the difficulty - how to represent the data for more complex scenarios. Specifically:
1) multiple categories - example plan and actual. One suggestion would be by table. Each table represents a category. Table id represents category name.
2) sub-tasks - large task broken up into smaller tasks. Don't have a good suggestion for this yet.
Suggestions please
My suggestion would be to add a new macro to the Chart Plugin which has it's own rules for how it reads the data (e.g. {gantt-chart}). Something like this might be ok:
{gantt-chart:columnOrder=title,start,end,percent|dateFormat=dd-MMM-yyyy}
h3. Scheduled
|| Title || Start Date || End Date || % Complete ||
| Task 1 | 01-Feb-2007 | 5-Feb-2007 | 80% |
| Task 2 | Task 1>> | 23-Feb-2007 | 0% |
h3. Scheduled: Task 2
|| Title || Start Date || End Date || % Complete ||
| Task 2.1 | <<Scheduled: Task 2 | 14-Feb-2007 | 40% |
| Task 2.2 | 12-Feb-2007 | Scheduled: Task 2>> | 0% |
h3. Actual
|| Title || Start Date || End Date || % Complete ||
| Task 1 | 01-Feb-2007 | 8-Feb-2007 | 80% |
| Task 2 | Task 1>> | 02-Mar-2007 | 0% |
h3. Actual: Task 2
|| Title || Start Date || End Date || % Complete ||
| Task 2.1 | <<Actual: Task 2 | 14-Feb-2007 | 40% |
| Task 2.2 | 12-Feb-2007 | Actual: Task 2>> | 0% |
{gantt-chart}
Here are the rules:
- Any heading row immediately prior to a table is the series title.
- Any heading row which starts with the name of a prior series, followed by ": " and then a task title from that series will be interpreted as sub-tasks of that task. If a title contains a ":" but doesn't match a prior series/task, it is interpreted as a new series.
- The column order is set by the 'columnOrder' parameter, not the actual table column headings. That allows us to have flexible titles (e.g. in a foreign language) as well as being able to skip some columns if they are not desired for the current chart (e.g. % complete)
- The special "<<Series Name: Task Name" and "Series Name: Task Name >>" dates indicate the date is dependent on the start or finish date of the named task, respectively. Alternate suggestions welcome.
The rule here would be that the task being referenced must be described earlier in the table.
This layout would be pretty easy to set up a Scaffold for too, so data could be entered using the scaffold editor. The one tricky bit would be fixed vs. relative dates, but a text box will work, it just won't enforce correct date formatting being entered...
Anyway, this would be pretty nifty if we get it going...
I like the ideas here. Specifically, the potential to address some of AJ Jack comments. This gets deeper than a simple data table and chart. I have implemented a simple version that is consistent with other charts where the header row 1 (your title field) represents the category name. Probably just ship that soon and then work on the more complex macro later as it will take significantly more time. Perhaps others can provide more feedback and suggestions before we get to far.
After thinking about this some more, I believe keeping to a simple table structure is preferred. This is necessary to be able to use SQL, excel, or automation to produce the tables from existing data. I will document another proposal for discussion. I suppose we still might need some special markup to cover the more complex cases.
I really like the idea that you'd be able to make a task's start date depend on the end date of another task. However, if you do go this route, then you get into some sticky areas:
- You'd really need to be able to specify task durations, not end dates. If you look at the example above, the end date for Task 2.1 should be dependent on its start date. And, if its start date is variable, dependent on Task 2. So its end date also needs to be variable.
- You'd want to be able to specify working days - or a calendar. If Task 2 ends on a Friday and the team works Monday through Friday, Task 2.1's start date shouldn't be calculated as that Saturday.
- You'd want to be able to specify whether the dependent task starts on the day its preceding task ends or the number of days it starts before/after the end of the preceding task.
As long as we're blue-skying here, it would also be nice to be able to specify the resources assigned to a task (that looks like it fits in easily with the example above) and - here's the kicker - being able to toggle the display of the chart to hide all but selected resource(s).
I'd love to raise an issue but I don't have a clue how to use JIRA and the help guide doesn't really explain how to do it.
% complete isn't essential - a basic Gantt chart for planning purposes would be great.
Another level of complexity is introduced by dependencies. For example task 2 cannot be started until task 1 is completed, but task 3 can start anytime. Maybe the start of task 5 doesn't even have a fixed date, but must start not less than 30 days after task 4.
I have attached a beta this provides a simple gantt capability. Here is an example:

{csv:output=wiki}
Plan, Start, End, Percent\\complete
Create issue, 1/30/2007, 2/1/2007, 30%
Provide examples, 1/30/2007, 2/7/2007, 40%
Write code/tests, 2/3/2007, 2/4/2007
Write docs, 2/4/2007, 2/5/2007
Release update, 2/5/2007, 2/5/2007
{csv}
{csv:output=wiki}
Actual, Start, End, Percent\\complete
Create issue, 1/30/2007, 2/11/2007, 100%
Provide examples, 1/30/2007, 2/17/2007, 90%
Write code/tests, 2/3/2007, 2/14/2007
Write docs, 2/4/2007, 2/15/2007
Release update, 2/5/2007, 2/15/2007
{csv}
| Plan | Start | End | Percent complete |
|---|---|---|---|
| Create issue | 1/30/2007 | 2/1/2007 | 30% |
| Provide examples | 1/30/2007 | 2/7/2007 | 40% |
| Write code/tests | 2/3/2007 | 2/4/2007 | |
| Write docs | 2/4/2007 | 2/5/2007 | |
| Release update | 2/5/2007 | 2/5/2007 |
| Actual | Start | End | Percent complete |
|---|---|---|---|
| Create issue | 1/30/2007 | 2/11/2007 | 100% |
| Provide examples | 1/30/2007 | 2/17/2007 | 90% |
| Write code/tests | 2/3/2007 | 2/14/2007 | |
| Write docs | 2/4/2007 | 2/15/2007 | |
| Release update | 2/5/2007 | 2/15/2007 |
Hey Bob,
I get the following exception thrown when trying to use the beta:
Error formatting macro: chart: java.lang.NoSuchMethodError: org.jfree.data.gantt.TaskSeriesCollection.getSeries(Ljava/lang/Comparable;)Lorg/jfree/data/gantt/TaskSeries;
I expanded the jar and noted that the JFreeChart libraries aren't being bundled? I'm expecting that the Gantt chart feature was only added after the version of the JFreeChart which is bundled with Confluence.
Yes, forgot to mention that this requires jfreechart 1.0.3/jcommons 1.0.6. Need to replace existing ones in WEB-INF/lib
3 more comments by: Bob Swift, David Peterson, Andy Brook

I'd love this one. Just trying to do a project plan at the moment and having to do the Gantt chart on visio and then embed the image in the wiki.