Critical path not showing with lag -1

I noticed that if I set the lag of a task to -1, all upstream tasks are no longer shown on the critical path. Why is this?

Gantt considers a task as a critical one in the following cases:

  1. The task has the greatest end date in the whole chart.

  2. The task is connected to a critical task, and the duration between them is 0.
    That depends on the gantt.config.duration_unit parameter. When the duration_unit is 'day' and duration between tasks is several hours, Gantt will round the duration.
    If the link between tasks has the lag parameter, it allows changing the duration between tasks. When it is 1, the task becomes critical when the duration between tasks is 1. Here is the demo of those parameters:
    link.lag is 0:
    http://prnt.sc/pq2dqe
    link.lag is 1:
    http://prnt.sc/pq2egk
    link.lag is -1:
    http://prnt.sc/pq2evk

  3. The gantt.config.project_end parameter is specified and the task dates are greater than the gantt.config.project_end date.

Hi, ramil, my i know that the if we set the correct lag, the critical path with show with the right way?
PS: correct lag means the days of previous task end date and next task start date same to the lag.

Hello Weis,
If you set everything correctly, the critical path will be displayed.
In the following snippet, you can experiment with the parameters to see how it works:
https://snippet.dhtmlx.com/bb4f752c4