6

I'm using mermaid js to produce a gantt chart. In the documentation it shows how to set tasks relative to the completion of the prior task using "after x", for example:

section A section
   Completed task            :done,    des1, 2014-01-06,2014-01-08
   Active task               :active,  des2, 2014-01-09, 3d
   Future task               :         des3, after des2, 5d
   Future task2              :         des4, after des3, 5d

Is there any equivalent for setting a task to before a subsequent deadline? I tried replacing "after" with "before" but that didn't work

pgcudahy
  • 1,542
  • 13
  • 36

1 Answers1

2

Right, mermaid syntax does not support the "before" qualifier, only the "after" qualifier.

Some options to consider are depicted in the "Gantt chart" section on the mermaid-diagrams page of diagrams.net.

title Example Gantt diagram
dateFormat  YYYY-MM-DD
section Team 1
Research & requirements :done, a1, 2020-03-08, 2020-04-10
Review & documentation : after a1, 20d
section Team 2
Implementation      :crit, active, 2020-03-25  , 20d
Testing      :crit, 20d
  1. Use an end date value - like 2020-04-10 for "Research & requirements" task
  2. Use a fixed time duration - like 20d for "Review & documentation" task
  3. Mark the task with ":crit" - like "Implementation" to indicate a "critical path" task

You can also apply the "after" qualifier on the tasks that follow the earlier task that is to be completed before those other tasks.

JohnH
  • 1,920
  • 4
  • 25
  • 32