Gantt diagram

Gantt Diagram is a tool for task management and work planning. Graphically it is represented with horizontal stripes, each of which corresponds to a specific task, located between two axes: a list of tasks vertically and dates horizontally.

The Gantt Diagram in PlantUML is different in that there are no axes with a task list: tasks are written directly on strips, and it is very convenient. The diagram shows not only the tasks themselves but also their sequence.

1. Basic elements

Tasks. This is a horizontal strip oriented along the time axis. Each bar in the diagram represents a separate type of work as part of the project, its ends are the moments of the beginning and completion of work, its length is the duration of the work.

A milestone is a mark of a significant moment in the course of work, a common boundary between two or more tasks. Milestones allow you to visually display the need for synchronization, consistency in the implementation of various works. Milestones, like other borders on the diagram, are not calendar dates. Milestone shift leads to a shift in the entire project. The graphically milestone is shown as a filled diamond.

Connections are the arrows showing how different tasks relate to each other, meaning the dependencies of the work.

2. Syntax

Keywords  @startgantt and @endgantt are required to start and finish the Gantt Diagram.

Tasks are defined using square brackets []. The duration of tasks is set using the keyword lasts:

Код скопирован
  • @startgantt
    [Prototype design] lasts 15 days
    [Test prototype] lasts 10 days
    @endgantt

For shortened titles it is possible to use the keyword as

Код скопирован
  • @startgantt
    [Prototype design] as [D] lasts 10 days
    [Code prototype] as [C] lasts 10 days
    [C] starts at [D]’s end
    @endgantt

Adding restrictions. If tasks must be performed consequentially, you can set this on the Gantt Diagram using the keywords starts at [__] 's end (if the task starts after the previous one ends), or starts at [__]' s start (if the task should start in parallel):

Код скопирован
  • @startgantt
    [Prototype design] lasts 10 days
    [Code prototype] lasts 10 days
    [Write tests] lasts 5 days
    [Code prototype] starts at [Prototype design]’s end
    [Write tests] starts at [Code prototype]’s start
    @endgantt

You can use keyword then to define the tasks sequence: 

Код скопирован
  • @startgantt
    [Prototype design] lasts 14 days
    then [Test prototype] lasts 4 days
    then [Deploy prototype] lasts 6 days
    @endgantt

Also you can use  -> symbols for this purpose: 

Код скопирован
  • @startgantt
    [Prototype design] lasts 14 days
    [Build prototype] lasts 4 days
    [Prepare test] lasts 6 days
    [Prototype design] -> [Build prototype]
    [Prototype design] -> [Prepare test]
    @endgantt

Milestone can be specified with keyword happens:

Код скопирован
  • @startgantt 
    [Test prototype] lasts 10 days 
    [Prototype completed] happens at [Test prototype]’s end 
    [Setup assembly line] lasts 12 days 
    [Setup assembly line] starts at [Test prototype]’s end 
    @endgantt 

You can set the task completion status:

Код скопирован
  • @startgantt 
    [foo] lasts 21 days 
    [foo] is 40% completed 
    [bar] lasts 30 days and is 10% complete 
    @endgantt 

Use colors to get the custom look of your Gantt diagram: 

Код скопирован
  • @startgantt 
    [foo] lasts 21 days 
    [foo] is 40% completed 
    [bar] lasts 30 days and is 10% complete 
    [foo] is colored in Fuchsia/FireBrick 
    @endgantt 

Calendar settings. You can specify the project start date, so by default, the first task will begin from this date:

Код скопирован
  • @startgantt
    Project starts the 20th of june 2020
    [Prototype design] as [TASK1] lasts 13 days
    @endgantt

If the project is too long, you can change the scale of the diagram: 

Код скопирован
  • @startgantt
    printscale weekly
    Project starts the 20th of september 2020
    [Prototype design] as [TASK1] lasts 130 days
    [TASK1] is colored in Lavender/LightBlue
    [Testing] lasts 20 days
    [TASK1]->[Testing]
    @endgantt

You can close some days for work (make them non-working) with the keyword closed:

Код скопирован
  • @startgantt
    project starts the 2020/04/09
    saturday are closed
    sunday are closed
    2020/05/01 is closed
    2020/04/17 to 2020/04/19 is closed
    [Prototype design] lasts 14 days
    [Test prototype] lasts 4 days
    [Test prototype] starts at [Prototype design]’s end
    [Prototype design] is colored in Fuchsia/FireBrick
    [Test prototype] is colored in GreenYellow/Green
    @endgantt

You can use the dividing strip to delimit task blocks:

Код скопирован
  • @startgantt
    [Task1] lasts 10 days
    then [Task2] lasts 4 days
    — Phase Two —
    then [Task3] lasts 5 days
    then [Task4] lasts 6 days
    @endgantt

To add resources, you can use the keyword on and curl braces {} for the resource name: 

Код скопирован
  • @startgantt
    [Task1] on {Alice} lasts 10 days
    [Task2] on {Bob:50%} lasts 2 days
    then [Task3] on {Alice:25%} lasts 1 days
    @endgantt

You can also use the keyword and specify task properties. As you can see, the Gantt diagram is built using intuitive words and sentences.

Код скопирован
  • @startgantt
    [Prototype design] lasts 13 days and is colored in Lavender/LightBlue
    [Test prototype] lasts 9 days and is colored in Coral/Green and starts 3 days after [Prototype design]’s end
    [Write tests] lasts 5 days and ends at [Prototype design]’s end
    [Hire tests writers] lasts 6 days and ends at [Write tests]’s start
    [Init and write tests report] is colored in Coral/Green
    [Init and write tests report] starts 1 day before [Test prototype]’s start and ends at [Test prototype]’s end
    @endgantt