Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.org

README.org

How to make a Gantt graph from an Org-Mode project ?

Follow the structure of the example.org file

RESOURCES

Resources are affected to tasks by using them as tags. Resource tag is defined by the property “resource_id”.

Each resource can contain a list of vacations which can take two forms :

  • single date such as [2014-12-30 mar.]
  • a timeframe such as [2014-12-30 mar.]–[2015-01-02 ven.], last day is included

Group of resources

Groups of resources are defined by the property “resource_id”. Each resource which is a child of a group will be included in this group.

VACATIONS

Vacations item can contain a list of vacations which can take two forms :

  • single date such as [2014-12-25 jeu.]
  • a timeframe such as [2014-12-25 jeu.]–[2015-01-01 jeu.], last day is included

Those vacations are for all resources.

Projects

Projects are level 1 items other than RESOURCES or VACATIONS. If they are tagged with the :no_gantt: tag, project will not be included.

For each project, two SVG will be generated :

  • PROJECTNAME.svg : it contains the Gantt graph for the project
  • PROJECTNAME_resources.svg : it contains the graph for the resources affectation.

For the whole projects, two graphs are generated :

  • project.svg
  • project_resources.svg

Projects can have some properties :

  • the “ORDERED” property which allows you to state that the child tasks have to be completed in the order they appear (top most first).
  • the “color” property for defining a color for tasks in this project
  • the “task_id” property which will be the ID for the project. It must be uniq If not set, an uuid will be generated.

Example :

:PROPERTIES:
:ORDERED: t
:color: #ff8080
:task_id: project_id
:END:

Tasks

Tasks are level 1 or 2 items. They depends from a project (level 1). Task ID is mandatory and is defined by the property “task_id”.

Timeframe is delimited by from two of the following criteria :

  • starting date : set by the SCHEDULED keyword followed by a date
  • duration : set as a property, keyword “Effort”, duration is defined in days !
  • ending date : set by the DEADLINE keyword followed by a date

Or by :

  • dependencies to other task : set as a property, keyword “BLOCKERS” or tags.
  • duration : set as a property, keyword “Effort”, duration is defined in days !

Other options are possible :

  • percent done : defined as a property, keyword “PercentDone”
  • dependencies : could be defined as a property, keyword “BLOCKERS”. Multiples dependencies are separated by spaces.
  • the “color” property for defining a color for this task
  • the “task_id” property which will be the ID for this task. It must be uniq. If not set, an uuid will be generated.

Resources are allocated to tasks either using tags (:resourceid:) or by using the property “allocate”.

Example :

** TODO Task  :grp1:
SCHEDULED: <2014-12-21 dim.>
:PROPERTIES:
:Effort:   6d
:task_id: task2
:BLOCKER: task1 task0
:PercentDone: 40
:color: #ff8080
:END:

CONFIGURATION

The gantt chart timeframe can be set using the item CONFIGURATION and the following properties :

  • start_date : first day of the chart (default begining of project)
  • end_date : last day of the chart (default end of project)
  • today : force today date (default is today) (iso format yyyy-mm-dd)

start_date and end_date could be references to today’s date in the form -1d, +2w or be a date (iso format yyyy-mm-dd)

For resources chart, if set to “t”, the property one_line_for_tasks puts all tasks on one line.

TODO keywords must be defined by using #+SEQ_TODO. Otherwise only “TODO” and “DONE” are defined.

For each keyword, a specific color could be defined by using the “colorKEYWORD” property.

The property “ignore_tags” make org2gantt ignore thoses tags as resources allocation.

Exemple :

#+SEQ_TODO: TODO(t) STARTED(s) WAITING(w) | DONE(d) CANCELED(c)
:PROPERTIES:
:start_date: -5d
:end_date: +5w
:today: [2015-01-01 Thu]
:one_line_for_tasks: nil
:color_TODO: #FFFF90
:color_DONE: #90FF90
:color_STARTED: #FFA0FF
:color_CANCELED: #FF9090
:color_WAITING: #FFFF00
:one_line_for_tasks: t
:ignore_tags: WAITING IQ FORM APPR PPRD PRD
:END:

Installation of the scripts

You will need python (v2.7 or later) and some python modules :

and of course those scripts :

  • org2gantt.py : to transform org mode project file in my source code for my python gantt generator
  • gantt.py : to transform gantt source code in SVG.

You can download them from http://xael.org/pages/python-gantt-en.html

Running the scripts

Transform org-mode file example.org in example.py

python org2gantt.py example.org -g example_gantt.py

You can check help for options :

python org2gantt.py -h
Usage: org2gantt.py [OPTIONS] org

org2gantt.py

Positional arguments:
  org   org-mode filename

Options:
  -g, --gantt=STR        output python-gantt filename (if not
                         specified, code is directly
                         executed)(default: )
  -s, --start-date=STR   force start date for output or used for
                         checking resource availibility(default: )
  -e, --end-date=STR     force end date for output or used for
                         checking resource availibility(default: )
  -t, --today=STR        force today date(default: )
  -d, --debug            debug
  -r, --resource=STR     check resource availibility between
                         start_date and end_date(default: )
  -S, --svg=STR          svg base name for files output(default:
                         project)
  -h, --help             Show this help
  -v, --version          Show the version

Make SVG

If the example.py was generated, it should be straightaway : just launch it…

python example_gantt.py

You should have now have those files :

  • project_1_resources.svg
  • project_1.svg
  • project_2_resources.svg
  • project_2.svg
  • project_resources.svg
  • project.svg

There could be some warnings, read them, it should be easy to understand.

Interpretate the graphs

Project graph

  • Each project on the graph is named. A purple bar on the left groups all tasks.
  • The blue vertical bar is current date (today)
  • The gray days are either off work days (by default saturday and sundays) or VACATIONS

Tasks

  • Each task is represented by an horizontal bar
  • Name of the task is on the upper left
  • Affected resources are on the bottom left
  • Dependencies between tasks are represented by dashed lines
  • If the task has a upper left blueish square, the means that begining date has been influenced by constraints (vacations, dependencies…)
  • If the task has a upper right blueish square, the means that ending date has been influenced by constraints (vacations, dependencies…)

Resource graph

  • For each resource, a line contains all tasks affected for this resource
  • On the line above, there are some markers :
    • green half square when this resources is on vacations
    • red half square when this resources is overcharged (more than one task at a time). In the example, task 2 and 7 are overlapping on days 22/12 and 23/12.

Licence: GPL v3 or any later version

Author : Alexandre Norman (norman at xael.org)