summary
PRO
The functionality is available in PRO Edition only
Description
Optional. Configures advanced summary task behaviorThe summary property enables advanced, built-in behavior for summary tasks. When enabled, Gantt automatically manages summary task logic such as:
- calculating summary progress based on child tasks
- converting parent tasks to summary tasks and back
Usage
summary?: {
autoProgress?: boolean,
autoConvert?: boolean,
};
Parameters
autoProgress- (optional) when set to true, the progress of summary tasks is calculated automatically based on the progress of their child tasks. The calculation uses the formula∑(duration × progress) / ∑durationwhere:- duration is the task duration in days
- progress is the task progress value
autoConvert- (optional) when set to true, tasks with child items are automatically converted into summary tasks. If all child tasks are removed, the task is automatically converted back to a regular task.
Example
<script setup>
import { getData } from "../data";
import { Gantt, ContextMenu } from "@svar-ui/vue-gantt";
const data = getData();
const api = ref(null);
</script>
<template>
<ContextMenu :api="api">
<Gantt
ref="api"
:tasks="data.tasks"
:links="data.links"
:scales="data.scales"
:cellWidth="30"
:summary="{
autoProgress: true,
autoConvert: true
}"
/>
</ContextMenu>
</template>
Related article: Configuring summary tasks