Gantt Chart in PlantUML using VPasCode: Part 1: The Foundations – Defining Tasks, Time, and Structure
Introduction
Project management is often less about complex algorithms and more about clear communication. A Gantt chart is the universal language of project timelines, allowing teams to visualize what needs to be done, how long it will take, and when it happens. While many tools require you to drag and drop bars in a rigid interface, PlantUML offers a different approach: diagrams as code.
By defining your schedule in text, you gain version control, easy collaboration, and the ability to generate charts dynamically. However, starting with raw code can feel intimidating. Where do you begin? How do you define a simple task?
This guide, Part 1 of our PlantUML Gantt Series, strips away the complexity. We will focus exclusively on the foundations: defining tasks, setting durations, and establishing your project’s timeline. Whether you are a developer documenting a sprint or a manager planning a rollout, mastering these basics is the first step toward building professional, automated project schedules.
To make this learning curve smoother, we will introduce a powerful tooling ecosystem—Visual Paradigm VPasCode, AI Chatbot, and OpenDocs—that transforms the experience from “writing code” to “designing logic.” Let’s build your first chart.

Welcome to the first step in mastering PlantUML Gantt Charts. Before you can manage complex dependencies or style your diagrams for executive presentations, you need to understand the core grammar: how to define a task, how long it takes, and when it happens.
This guide covers the essential syntax required to build a basic, functional project timeline.
Key Concepts
Before diving into syntax, it is helpful to understand the three pillars of a PlantUML Gantt chart:
-
Tasks: The fundamental units of work, defined by a name and a duration.
-
Timeline: The horizontal axis representing time, anchored by a project start date.
-
Constraints: Rules that dictate when a task occurs, either absolutely (specific dates) or relatively (offsets from the start).
1. The Basic Structure
Every PlantUML diagram starts and ends with specific tags. For Gantt charts, these are @startgantt and @endgantt. Anything between these tags is interpreted as part of your project schedule.
@startgantt
' Your tasks go here
@endgantt
Tip: You can add comments using a single quote
'for single-line comments, or/' ... '/for multi-line comments. Comments are ignored by the renderer and are great for documenting your logic.
2. Defining Tasks and Duration
The fundamental unit of a Gantt chart is the Task. In PlantUML, tasks are defined using square brackets [ ].
The requires Keyword
To tell PlantUML how long a task takes, use the verb requires. You can specify time in days, weeks, or months.
-
Days:
[Task Name] requires 5 days -
Weeks:
[Task Name] requires 2 weeks -
Months:
[Task Name] requires 1 month(Note: In PlantUML, 1 month is strictly defined as 30 days).
Example:

@startgantt
[Design Prototype] requires 10 days
[Build Model] requires 2 weeks
[Final Review] requires 1 month
@endgantt
Natural Language Syntax
PlantUML is designed to be readable. You can use natural phrasing. The following are all valid and equivalent:
-
[Task] requires 5 days -
[Task] lasts 5 days
3. Setting the Project Start Date
By default, PlantUML will start your project on the current date or an arbitrary starting point. To have control over your timeline, you should explicitly define when the project begins.
Use the Project starts command followed by a date. PlantUML accepts various date formats:
-
YYYY-MM-DD(e.g.,2023-10-01) -
the [Day] of [Month] [Year](e.g.,the 1st of October 2023)
Example:

@startgantt
Project starts 2023-10-01
[Design Prototype] requires 10 days
@endgantt
When you set a project start date, the first task defined will typically begin on that date unless specified otherwise.
4. Controlling Task Timing: Start and End Dates
While requires sets the duration, you often need to control when a task happens. You can do this absolutely (using specific dates) or relatively (using offsets from the project start).
Absolute Dates
You can force a task to start or end on a specific calendar date using starts or ends.

@startgantt
Project starts 2023-10-01
[Design] requires 10 days
[Testing] requires 5 days
[Design] starts 2023-10-01
[Testing] starts 2023-10-15
@endgantt
Relative Dates (D+nn)
For simpler planning, you can use relative offsets from the project start date using D+number.
-
D+0= Project Start Date -
D+10= 10 days after Project Start Date

@startgantt
[Design] requires 10 days
[Testing] requires 5 days
[Design] starts D+0
[Testing] starts D+10
@endgantt
Combining Start and End
You can define both the start and end dates explicitly. PlantUML will calculate the duration automatically for the table view, but the visual bar will stretch between these two points.

@startgantt
Project starts 2023-10-01
[Design] starts 2023-10-01
[Design] ends 2023-10-10
@endgantt
5. One-Line Declarations with and
To keep your code clean, you can combine multiple attributes into a single line using the and conjunction. This is particularly useful for defining start/end dates and durations simultaneously.
Syntax:
[Task] starts [Date] and ends [Date]
[Task] starts [Date] and requires [Duration]
Example:

@startgantt
Project starts 2023-10-01
[Design] starts 2023-10-01 and requires 10 days
[Testing] starts 2023-10-11 and requires 5 days
@endgantt
6. Complete Beginner Example
Here is a complete, copy-pasteable example that combines all the concepts from Part 1:

@startgantt
' Define the project start
Project starts 2023-11-01
' Define tasks with durations
[Requirement Gathering] requires 5 days
[UI Design] requires 10 days
[Backend Development] requires 15 days
[Integration Testing] requires 7 days
' Define timing
[Requirement Gathering] starts D+0
[UI Design] starts D+5
[Backend Development] starts D+5
[Integration Testing] starts D+20
' Alternative one-line syntax
[Milestone: Kickoff] happens at D+0
@endgantt
(Note: The happens at keyword used for the milestone above is a preview of Part 2, but it fits naturally here as a zero-duration event.)
Common Pitfalls for Beginners
-
Forgetting Brackets: Always wrap task names in
[ ].Task 1 requires 5 dayswill fail;[Task 1] requires 5 dayswill work. -
Date Formats: Stick to
YYYY-MM-DDfor the least ambiguity. If you use “January 1”, ensure you include the year. -
Overlapping Definitions: If you define
requires 10 daysANDstarts Date AANDends Date B, ensure that Date B is actually 10 days after Date A. If they conflict, PlantUML may produce unexpected results or errors. It is best to define either Duration + Start OR Start + End.
Tooling Spotlight: Accelerating PlantUML with Visual Paradigm
PlantUML makes it possible to build precise Gantt charts with text, but writing and refining code for a complex schedule can take time. Visual Paradigm’s AI Chatbot, VPasCode, and OpenDocs offer a streamlined workflow: move from initial guidance to a PlantUML diagram, then organize and share the result.
The Integrated Workflow
To get the most out of Part 1, try this optimized workflow:
-
Ideate with AI Chatbot: Start by describing your project goals in natural language. Ask the VP AI Chatbot to generate a basic 5-task project structure or clarify syntax questions.
-
Refine in VPasCode: Paste the generated code into VPasCode. Use its live preview to tweak dates, durations, and task names. VPasCode validates your syntax in real-time, helping you catch errors before they become problems.
-
Publish with OpenDocs: Once your diagram is finalized, use OpenDocs to document your project plan. OpenDocs allows you to embed your PlantUML code alongside explanatory notes, making it easy to share with stakeholders who may not be familiar with the code itself.

Deep Dive: Visual Paradigm OpenDocs
The “Interactive Reference” Library
OpenDocs is Visual Paradigm’s comprehensive, searchable documentation hub. While the official PlantUML site is great, OpenDocs often provides more structured, beginner-friendly examples with context.
-
Why it helps with Part 1:
-
Searchable Syntax: Forgot if it’s
Project startsorStart project? A quick search in OpenDocs for “Gantt Start Date” will give you the exact keyword and multiple examples. -
Copy-Paste Templates: OpenDocs contains ready-to-use templates for common project types (Agile Sprints, Waterfall Phases). You can copy these into VPasCode and modify them rather than starting from scratch.
-
Version-Specific Features: PlantUML updates frequently. OpenDocs ensures you are using the latest supported syntax (e.g., newer ways to define
monthsorweeks) rather than outdated forum posts.
-
How to use it: Keep the PlantUML Gantt Documentation page on OpenDocs open in a tab while you work. Use it as your “dictionary” for keywords.
Conclusion
You have now mastered the core grammar of PlantUML Gantt charts. You can define tasks, set their durations in days or weeks, and place them precisely on a timeline using absolute or relative dates. By leveraging the requires, starts, and ends keywords, you’ve moved from a blank screen to a structured project plan.
While this foundation is powerful, a list of independent tasks only tells half the story. Real projects are defined by their dependencies—the logical links that dictate when one task can begin based on the completion of another.
Next Steps
In Part 2, we will bring your chart to life by:
-
Connecting tasks with Dependencies (
->andthen). -
Marking key achievements with Milestones.
-
Assigning Resources to specific tasks to track workload.
Keep Your Toolkit Ready
As you move forward, remember to utilize the Visual Paradigm ecosystem:
-
Use VPasCode for instant visual feedback as you add complex dependencies.
-
Lean on the AI Chatbot to generate dependency structures from natural language descriptions.
-
Consult OpenDocs when you need to reference advanced styling or resource management syntax.
You now have the building blocks. In the next article, we’ll start connecting them. Happy charting!

