Discussion and examples of Gantt charts
See also the preliminary discussions on this topic.
| Beta Consider this a beta until there is more user feedback and discussion |
| Installation requirements Requires JFreeChart 1.0.3 or higher to be installed. |
Overview
The key problem is the format of the data used to generate the chart. Here is the current proposal:
- 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 Confluence 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
Examples
- These examples use the csv macro (Table Plugin needs to be installed) to create the tables, but any method can be used to create the tables (ie. Confluence notation, Table-plus macro, CSV Macro, Excel Plugin, SQL Plugin)
Example 1 - simple
- In order to make some columns optional, the columns parameter is used to allow the simple data format.

{chart:type=gantt|dataOrientation=vertical|columns=,,1,2,3,4|displayData=before|width=500|dateFormat=MM/dd/yyyy} {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} {chart}
Example 2 - more features
|
|
{chart:type=gantt|dataOrientation=vertical|displayData=before|width=500|rangeAxisRotateTickLabel=true}
{csv:output=wiki|id=Plan}
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, 70%
Plan, , Provide examples, 1/30/2007, 2/7/2007, 100%
Actual, , Provide examples, 1/30/2007, +5, 100%
Plan, , Code, 2/1/2007, 2/11/2007
Plan, Code, Initial code, 2/1/2007, +3
Plan, Code, Tests, 2/5/2007, +3
Plan, Code, Final, 2/9/2007, +2
Plan, , Write docs, 2/9/2007, 2/11/2007
Plan, , Release update, 2/10/2007, 2/12/2007
{csv}
{chart}
|


Comments (29)
Jun 14, 2007
MB says:
I've tried the wiki markup above for both examples. However, I'm receiving the ...I've tried the wiki markup above for both examples.
However, I'm receiving the following error on both:
chart: java.lang.IllegalArgumentException: Requires end >= start.
Any ideas as far as correcting this?
Thanks.
Jun 14, 2007
Bob Swift says:
No, but write up an issue with your exact markup, log entry that has details of ...No, but write up an issue with your exact markup, log entry that has details of the failure, and what release you are on.
Jul 09, 2007
Randy Gladish says:
Your global date format is not the same as the date format in the data. The ex...Your global date format is not the same as the date format in the data.
The example should probably specify the dateFormat parameter so that it will work for everyone.
Add the dateFormat parameter to your chart macro.
dateFormat=MM/dd/yyyy
Can anyone tell me where to find the global date format? I notice that our installation is British English... is there an American English one?
Thanks!
Jul 09, 2007
Bob Swift says:
Yes, date format is important to specify if it does not match your locale. Adde...Yes, date format is important to specify if it does not match your locale. Added dateFormat=MM/dd/yyyy to the example above to make it explicit.
Regarding default date formats, the chart plugin uses the Confluence installed and default languages. Go to Administration->Configuration->Languages to see the current setting. Yes, there is a US language - Language Pack Translations. The chart plugin also supports language and country parameters.
Jul 16, 2007
Oskari Kettunen says:
How do I enable this chart type? I have confluence 2.5.3 and the bundled chart ...How do I enable this chart type?
I have confluence 2.5.3 and the bundled chart plugin version 1.8. CHRT-44 says the feature was added for 1.8, but I get chart: com.atlassian.renderer.v2.macro.MacroException: Unsupported chart type: gantt from copy-pasting the example markup.
Jul 16, 2007
Bob Swift says:
Unfortunately, Atlassian still has not bundled the latest JFreeChart enablers in...Unfortunately, Atlassian still has not bundled the latest JFreeChart enablers into the Confluence packages, so look at the yellow area at the top of this page for what to install to enable Gantt charts.
Sep 25, 2007
Daniel Bethke says:
I'm also getting the same message. I'm trying to use the example chart code...I'm also getting the same message. I'm trying to use the example chart code in example 1. I also have the Tables macro installed.
The error is:
Here's what I did:
I downloaded jfreechart-1.0.6.zip then extracted it to my desktop.
I copied the jfreechart-1.0.6.jar and jcommon-1.0.10.jar to the conflunece/WEB-INF/lib directory
I removed the the 1.0.0 versions of jfreechart and jcommon that was in there.
I restarted confluence.
no gantt chart... just get that error above. Any other suggestions?
Sep 25, 2007
Bob Swift says:
Looks like the right things to do. Suggest removing chart plugin, verify a {cha...Looks like the right things to do. Suggest removing chart plugin, verify a {chart} macro on a page fails as macro not found, then re-install 1.8 from repository client. The plugin looks for the class org.jfree.chart.entity.CategoryLabelEntity which is in JFreeChart 1.0.3 and above before allowing gantt charts (and other functions) to be valid.
Sep 26, 2007
Daniel Bethke says:
I put an example of a simple bar chart on the same page. The bar chart displays ...I put an example of a simple bar chart on the same page.
The bar chart displays fine, but the gantt chart doesn't.
In the plugin repo, I can uncheck the box to disable the plugin.
This makes the chart macro unknown for both the gantt and the bar chart.
I can check the box again to re-enable the plugin, and then the bar chart works but I still get the gantt chart error
I was unable to find a way to actually remove the 1.8 plugin, because it says it is a bundled plugin. I can only enable or disable. I don't have the option to 'uninstall' it like I do for other plugins.
Aug 02, 2007
Randy Gladish says:
Greetings: I have been dabbling with the gantt charting a bit, but in a way tha...Greetings:
I have been dabbling with the gantt charting a bit, but in a way that it may not be intended to be used.
Using the Scaffolds plugin, I have added data to several pages (data needed for gantt charting). Then the Reporting plugin is used to report a table. This table is used to generate the chart.
Here is a sample of the chart command with the embedded reporting macros:
{chart:type=gantt|dataOrientation=vertical|columns=1,2,3,4,5|displayData=after|width=1000|height=100|dateFormat=MM/dd/yyyy|legend=false} {report-table:displayTitles=true} {content-reporter:spaces=PT|type=page|scope=New And Revised Test area > descendents} {text-sort:data:breadcrumb} {content-reporter} {report-column:title=Goo}Plan{report-column} {report-column:title=Parent}{report-info:content:parent}{report-column} {report-column:title=Project}{report-info:content:title}{report-column} {report-column:title=Start}{report-info:data:dStart|format=MM/dd/yyyy}{report-column} {report-column:title=End}{report-info:data:dEnd|format=MM/dd/yyyy}{report-column} {report-column:title=Percent}{report-info:data:nPercent}\%{report-column} {report-table} {chart}My observations are as follows:
1. The first data line in the table is ignored (not charted)
2. If the all five columns are not defined, a multi-part project is not broken down on a single line. Instead the first part gets the project name and each sub-task gets its own line displayed in the chart.
I expect that these issues are related to how the table is generated by the Reporting plugin. Neither of these observations are true when the table is entered by hand.
Everything I have tried, creating gantt charts with hand entered tables, has worked exactly as expected.
Those are my only observations at this point.
Aug 02, 2007
Bob Swift says:
You might want to look at the hmtl and note any differences in how the table and...You might want to look at the hmtl and note any differences in how the table and rows are done between two approaches. You can also write up an issue with the html from both, but I doubt I can get to in anytime soon.
Aug 02, 2007
David Peterson [CustomWare] says:
Hi Randy, Without having looked at it, I'd guess that this is caused by a bug i...Hi Randy,
Without having looked at it, I'd guess that this is caused by a bug in Reporting where the header row is not correctly put inside a <tr> tag. This has been corrected in SVN and will be in the next release, due out sometime next week.
Jun 04
Firat Vakiliev says:
Hi Randy, Unfortunately this bug is not killed. I find sloppy, but a workable so...Hi Randy,
Unfortunately this bug is not killed. I find sloppy, but a workable solution. Try something like:
{chart:type=gantt|dataOrientation=vertical|columns=,1,2,3,4,5|displayData=before|width=500|dateFormat=dd-MMM-yyyy} {table} {tr}{td:colspan=5}{td}{tr} {report-block} {local-reporter:data:Tasks} {report-body} {tr}{td}{report-info:data:Milestone}{td} {td}{report-info:data:Task}{td} {td}{report-info:data:Start|format=dd-MMM-yyyy}{td} {td}{report-info:data:Days}{td} {td}{report-info:data:Percent}%{td}{tr} {report-body} {report-block} {table} {chart}Oct 10, 2007
Stephen Day says:
Hi, I'm wondering how customizable the colors are for these charts. Specificall...Hi,
I'm wondering how customizable the colors are for these charts. Specifically, I need to be able to have differnet colors for each sub-interval in a task. i.e, using the Example 2 chart from above, is it possible to have different colors for each of the intervals of the Code task (Initial Code, Tests, Final)?
Thanks,
Steve
Oct 10, 2007
Bob Swift says:
No color customization is available for Gantt charts. Please write up an issue ...No color customization is available for Gantt charts. Please write up an issue with what you want to see.
Oct 16, 2007
Stephen Day says:
Okay, thanks. http://developer.atlassian.com/jira/browse/CHRT-53Okay, thanks.
http://developer.atlassian.com/jira/browse/CHRT-53
Dec 07, 2007
alan richards says:
Hi can I link a chart bar to a page and drill down to the page by clickin...Hi
can I link a chart bar to a page and drill down to the page by clicking on the bar? I'd like to have a plan and actual bar for each project and a linked document giving fuller project information.
Thanks,
Alan
Dec 07, 2007
Bob Swift says:
No. Please create an issue.No. Please create an issue.
Jan 02, 2008
alan richards says:
Me again, it would help to add a [short] description vs a subtask bar - maybe o...Me again,
it would help to add a [short] description vs a subtask bar - maybe on or just under the bar. Is that possible?
Thanks - Alan
Apr 10, 2008
Jim Dibble says:
Can you clarify the purpose of the columns parameter? I'm guessing that the gant...Can you clarify the purpose of the columns parameter? I'm guessing that the gantt chart assumes that the columns will be in the following positions:
So, if you want to exclude particular columns, or reorder them, then you must specify the column number at which each of the above pieces of data appear in your table. Is this correct?
Apr 10, 2008
Jim Dibble says:
I'm using the gantt chart in conjunction with the Scaffolding plug-in. I notice ...I'm using the gantt chart in conjunction with the Scaffolding plug-in. I notice that the first row entered into a table using the Scaffolding plug-in is never included in the Gantt chart. Any idea why this is the case?
Here is my code:
h3. Tasks {chart:type=gantt|dataOrientation=vertical|columns=,1,2,3,4,5|displayData=before|width=500|dateFormat=dd-MMM-yyyy} {table-data:Tasks} || Milestone || Task || Start || Days || Percent Complete || | {text-data:Milestone} | {text-data:Task} | {date-data:Start|format=dd-MMM-yyyy} | {number-data:Days} | {number-data:Percent}0{number-data}% | {table-data} {chart}The result looks like this. Note that the first row of data is missing from the Gantt chart:
Apr 10, 2008
Bob Swift says:
Please open an issue and include the data generation markup. The chart works co...Please open an issue and include the data generation markup. The chart works correctly with regular table data.
Aug 25, 2008
Steven Herod says:
This would be a useful replacement/augmentation for the seemingly moribund ms-pr...This would be a useful replacement/augmentation for the seemingly moribund ms-project plugin.
The trouble is, exporting from project as xls or csv does not seem straight forward.
Does anybody have the profile/hints for saving from MS-Project into the required format?
Sep 22, 2008
Stephen Morad says:
Is there a way to create this type of graph (e.g. the representation of how far ...Is there a way to create this type of graph (e.g. the representation of how far one has to go verses how far they have currently gone), without using dates? For example, something like what's at the top of the task marco so you can show someone the progress they have made toward a goal (not necessarily date related)?
Oct 07, 2008
Kim Halavakoski says:
I have the same problem with using the gantt-chart with a scaffolding plugin: ...I have the same problem with using the gantt-chart with a scaffolding plugin:
h2. Gantt chart with table-macro {chart:type=gantt\|dataOrientation=vertical \| columns=,,1,2,3,4,5 \| displayData=before\|width=500\|dateFormat=dd-MMM-yyyy} {table-data:Project} || Activity || Start || End || Percent Complete || | {text-data:Activity} | {date-data:Start|format=dd-MMM-yyyy} | {date-data:End|format=dd-MMM-yyyy} | {number-data:Percent}0{number-data}% | {table-data} {chart}Any news on the status of this bug?
Oct 07, 2008
David Peterson [CustomWare] says:
Actually, I've noticed it with any table that uses <thead> sections - char...Actually, I've noticed it with any table that uses <thead> sections - chart will skip the first item of the table.
Oct 07, 2008
Kim Halavakoski says:
OK, so how do we get rid of the thead sections that cause this? Or maybe ...OK, so how do we get rid of the thead sections that cause this?
Or maybe that is a bad idea but I'd really like to get this working somehow...
Oct 07, 2008
David Peterson [CustomWare] says:
Well, you could skip the heading section of the table-data, but then you won't h...Well, you could skip the heading section of the table-data, but then you won't have a title section. Fixing {chart} is really the only way around it, I believe.
May 24
Dedra Chamberlin says:
I am experimenting with the Gantt chart plugin. I need to add a couple col...I am experimenting with the Gantt chart plugin. I need to add a couple columns to the standard table so I can track not only the milestone but also who is assigned to it (see below). Sometimes the gantt chart renders properly even when I add these columns and sometimes it doesn't. Is there any way I can do this and get the gantt chart to render properly consistently?
task