# gantt-resource-view

> Gantt chart with resource rows and resource-unit allocations on parent tasks.

**Framework:** vue  **Component:** Gantt  **Variant:** resource-view

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/gantt-resource-view.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-gantt
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/gantt-resource-view/Gantt.vue

```vue
<template>
  <div class="control-section">
    <div class="content-wrapper">
      <ejs-gantt
        ref="ganttChart"
        id="ResourceView"
        :dataSource="data"
        :viewType="viewType"
        :taskFields="taskFields"
        :allowSelection="true"
        :allowResizing="true"
        :resourceFields="resourceFields"
        :taskType="taskType"
        :editSettings="editSettings"
        :toolbar="toolbar"
        :height="height"
        :rowHeight="46"
        :taskbarHeight="25"
        :treeColumnIndex="1"
        :resources="resources"
        :highlightWeekends="true"
        :columns="columns"
        :labelSettings="labelSettings"
        :projectStartDate="projectStartDate"
        :projectEndDate="projectEndDate"
        :splitterSettings="splitterSettings"
        :showOverAllocation="true"
        @toolbarClick="toolbarClick"
      >
      </ejs-gantt>
    </div>
  </div>
</template>

<script lang="ts">
import { GanttComponent, Selection, Edit, DayMarkers, Toolbar, Resize } from "@syncfusion/ej2-vue-gantt";
import { getResourcesData, getResourceCollection } from "../datasource/gantt-data";

export default {
  components: {
    'ejs-gantt': GanttComponent
  },
  data() {
    return {
      data: getResourcesData(),
      resources: getResourceCollection(),
      viewType: 'ResourceView',
      taskFields: {
        id: 'TaskID',
        name: 'TaskName',
        startDate: 'StartDate',
        endDate: 'EndDate',
        duration: 'Duration',
        progress: 'Progress',
        dependency: 'Predecessor',
        resourceInfo: 'resources',
        work: 'work',
        child: 'subtasks'
      },
      taskType: "FixedWork",
      resourceFields: {
        id: 'resourceId',
        name: 'resourceName',
        unit: 'resourceUnit',
        group: 'resourceGroup'
      },
      toolbar: ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll',
        { text: 'Show/Hide Overallocation', tooltipText: 'Show/Hide Overallocation', id: 'showhidebar' }
      ],
      height: '650px',
      columns: [
        { field: 'TaskID', visible: false },
        { field: 'TaskName', headerText: 'Name', width: 280 },
        { field: 'work', headerText: 'Work' },
        { field: 'Progress' },
        { field: 'resourceGroup', headerText: 'Group' },
        { field: 'StartDate' },
        { field: 'Duration' }
      ],
      editSettings: {
        allowAdding: true,
        allowEditing: true,
        allowDeleting: true,
        allowTaskbarEditing: true,
        showDeleteConfirmDialog: true
      },
      labelSettings: {
        rightLabel: 'resources',
        taskLabel: 'Progress'
      },
      projectStartDate: new Date('03/26/2025'),
      projectEndDate: new Date('05/18/2025'),
      splitterSettings: {
        columnIndex: 3
      }
    };
  },
  provide: {
    gantt: [Selection, DayMarkers, Toolbar, Edit, Resize]
  },
  methods: {
    toolbarClick(args: any) {
      if (args.item.id === 'showhidebar') {
        (this.$refs.ganttChart as any).ej2Instances.showOverAllocation = 
          !(this.$refs.ganttChart as any).ej2Instances.showOverAllocation;
      }
    }
  }
};
</script>

```
