|Version 25 (modified by 5 years ago) (diff),|
Trac jsGantt plugin
A plugin which allows Trac ticket data to be displayed in a jsGantt chart in a wiki page. Tasks and milestones are links to the corresponding ticket or milestone.
Configurable field names allow integration with other plugins such as MasterTicketsPlugin (for dependencies), SubticketsPlugin (for parent/child relationships) and TimingAndEstimationPlugin (for estimated and total hours).
[[TracJSGanttChart(sample=1)]] displays the sample project from jsgantt.com.
[[TracJSGanttChart(milestone=Test)]] displays all the tickets in the Test milestone.
The chart display can be controlled with a number of macro arguments:
| ||What to display in the format control. A pipe-separated list of |
| ||Initial display format, one of those listed in ||First format|
| ||Display sample tasks (1) or not (0)||0|
| ||Show resource column (1) or not (0)||1|
| ||Show duration colunn (1) or not (0)||1|
| ||Show percent complete column (1) or not (0)||1|
| ||Caption to place to right of tasks: None, Caption, Resource, Duration, %Complete||Resource|
| ||Show start date column (1) or not (0)||1|
| ||Show end date column (1) or not (0)||1|
| ||Date display format: 'mm/dd/yyyy', 'dd/mm/yyyy', or 'yyyy-mm-dd'||'mm/dd/yyyy'|
| ||Number of levels of tasks to show. 1 = only top level task.||999|
| ||0.9||Show children of closed tickets (1) or collapse the subtree (0).||1|
| ||Field to use to choose task colors. Each unique value of the field will have a different color task. Other likely useful values are owner and milestone but any field can be used.||priority|
| ||When using something like Subtickets plugin to maintain a tree of tickets and subtickets, you may create a Gantt showing a ticket and all of its descendants with |
Multiple roots may be provided like
When used in a ticket description or comment,
| ||0.9||When using something like MasterTickets plugin to maintain ticket dependencies, you may create a Gantt showing a ticket and all of its predecessors with |
Multiple goals may be provided like
When used in a ticket description or comment,
| ||The width, in pixels, of the table of task names, etc. on the left of the Gantt.|
| ||Show dependencies (1) or not (0)||1|
| ||0.8||Map user IDs to full names (1) or not (0).||1|
| ||0.8||Show milestones for displayed tickets (0) or only those specified by ||0|
Site-wide defaults for macro arguments may be set in
option.<opt> overrides the built-in default for
<opt> from the table above.
All other macro arguments are treated as TracQuery specification (e.g., milestone=MS1|MS2) to control which tickets are displayed.
- Install globally with:
sudo easy_install http://trac-hacks.org/svn/tracjsganttplugin/0.11/
- Enable the plugin by updating TracIni file (..../trac.ini) as follows:
[components] tracjsgantt.* = enabled
- Configure custom fields for the start date and finish date:
[ticket-custom] userfinish = text userfinish.label = Planned Finish userstart = text userstart.label = Planned StartAdditional custom fields will be necessary (or may be provided by the associated plugins) if you wish to use additional features such as parent/child and predecessor/successor ticket relationships, and work estimates. Look here for the necessary plugins. See also TracTicketsCustomFields for more details.
- Configure the plugin at its own configuration section, placed into 'trac.ini' file as follows:
[trac-jsgantt] # To work with Timing and Estimation for percent complete fields.estimate = estimatedhours fields.worked = totalhours # Each unit in estimate is 1/8 of a day days_per_estimate = 0.125 # To work with Master Tickets for dependencies fields.pred = blockedby fields.succ = blocking # To work with Subtickets for parent/child relationships fields.parent = parents # # To work with ChildTickets plugin # parent_format = #%s # # Custom fields for start and due dates fields.start = userstart fields.finish = userfinish # date_format = %Y-%m-%d milestone_type = milestone
- See configuration details below for explanations and more options.
- Restart web server on command line:
$ sudo /etc/init.d/apache2 restart
TracJsGanttPlugin is intended to be flexible enough to get data from various plugins by configuring the field names for those plugins in
trac.ini. It is known to work with TimingAndEstimationPlugin (for estimated and total hours), MasterTicketsPlugin (for FS dependencies), and SubticketsPlugin for parent/child relationships. Custom fields for start and finish date are also supported.
Tasks are colored based on ticket attributes. When colored by priority colors are consistent with the colors used in Trac reports. Other coloring choices (e.g., by milestone or owner) use arbitrary, unique colors.
All of the
fields.* items name custom fields which may contain data for the Gantt.
worked are both configured, the plugin attempts to display (100 * worked/estimate) as the percent complete. The example works with TimingAndEstimationPlugin. Alternatively, if
percent is configured, the plugin attempts to display it as the percent complete (it should be a number from 0 to 100). If none of those are configured, all tasks will be marked as 0% complete.
succ are configured the plugin uses them to determine the task dependencies. The example works with MasterTicketsPlugin. If these fields are not configured, no dependencies are shown.
parent is configured, it is the field which holds the parent ticket number. The example works with Subtickets. If this field is not configured, no parent/child relationship will be displayed. If it is configured, the Gantt can be collapsed by the user to show or hide subtasks. (
parent_format determines the format of the content of the
parent field. Use "%s" (default) for SubticketsPlugin, "#%s" for ChildTicketsPlugin.)
finish are configured, the plugin uses them to set task start and finish dates. The
date_format field is a Python
strptime() format specifier which describes the contents of
finish. If these fields are not configured, all tasks end today and have a 1-day duration.
finish are both configured (and
start is not configured or not on the ticket), the plugin attempts to determine the start of the task from
start = finish - estimate with consideration for weekends and hours per day.
milestone_type may be used to have a custom ticket type show up as milestones on the chart. If this field is not specified, only Trac milestones are displayed as milestones.
Existing bugs and feature requests for TracJsGanttPlugin are here.
If you have any issues, create a new ticket.
- Only one chart can be displayed per page.
- Allow configuration of default task duration.
- Display a legend of task colors and their meaning (e.g., which milestone or owner they represent).
- Allow some tasks to be open or closed by default.
- Figure out finish date if start and estimate are provided.
- Display critical path
- Display slack time
Source & Download
Download the zipped source from [download:tracjsganttplugin here].
- 14208 by ChrisNelson on 2014-10-14 17:39:23
Fix a typo. Refs #9648.
- 14207 by ChrisNelson on 2014-10-14 17:18:33
Use Trac 1.0 DB API to find active tickets. Refs #9648.
- 14206 by ChrisNelson on 2014-10-14 17:18:28
Use Trac 1.0 DB API to find tickets by owner. Refs #9648.
- 14205 by ChrisNelson on 2014-10-14 17:18:23
Use Trac 1.0 DB API to find owners. Refs #9648.
- 14204 by ChrisNelson on 2014-10-14 17:18:17
Use Trc 1.0 DB API to build enum map. Refs #9648.
- 14203 by ChrisNelson on 2014-10-14 17:18:12
Use Trac 1.0 DB API to follow relations. Refs #9648.
- 14202 by ChrisNelson on 2014-10-14 17:18:05
Use Trac 1.0 DB API to find ticket dates. Refs #9648.
- 14201 by ChrisNelson on 2014-10-14 17:18:00
Use Trac 1.0 DB API to find milestones. Refs #9648.
- 14200 by ChrisNelson on 2014-10-14 17:17:55
Use Trac 1.0 DB API for finding scheduled tickets. Refs #9648.
- 14199 by ChrisNelson on 2014-10-14 17:17:48
Use Trac 1.0 DB API to follow links. Refs #9648.