Project task should only calculate actual subtasks duration and shows gap if there is no subtask at a point of time

Hi Team,

Not sure, if it is right place to ask this question. We are using pro version of Gantt Chart and have very custom requirement we seek some help to understand whether it is doable and if yes then some pointer how can we achieve it.

Please take a look on attached image this is what we want. currently we have gantt chart with project and tasks. the project is dependent on tasks and if you move the task timeline the project will also change. Currently our project shows whole time line from minimum start date to maximum end date of the sub task. So the duration also calculate the free time or the time when there is a gap between two tasks.
what we require is only sum of actual tasks time duration and not any gap. Also we want to show that gap on project timeline where there is no active task exist.

let me know if we can achieve something like that. one thing which we would like to retain is, the project should continue having dependency on the tasks, so if I change the task it should automatically update the project.

Appreciates all your help.

There is no built-in way to make it work that way. You need to implement a custom solution.

You can display subtasks in the task_text template that allows showing any HTML elements inside the task element in the timeline:
Here is an example with the task names:
And here is another example with empty rectangles:
To show gaps instead of the actual project, you can add the white color style rule for the project elements:

You can also implement it by using the addTaskLayer feature:
Here is an example of how it might be implemented:

Project tasks ignore the date parameters(start_date, end_date and duration). There is no way to change how it works.
However, you can calculate the duration of subtasks in a function and show it in the grid by using the template function:

The following example can help you to start: