Example of Resource Allocation in ASP.NET Core Gantt Chart Control
This sample demonstrates the options to allocate one or more resources to tasks based on the task requirement.
The Work is the total labor hours necessary to complete a task.
Work can be mapped from the data source field using the property work
and when the work value is mapped from the data source,
the end date and duration of the task will be calculated automatically based on the work and resource unit values from the data source.
Work can be measured in hours, days, and minutes. It is measured in 'hours' scale by default and this can be changed by using the workUnit property.
ID | Task Name | Resources | Work | Duration | Task Type |
---|---|---|---|---|---|
1 | Project initiation | 64.00 hours | 4 days | FixedDuration | |
2 | Identify Site location | Van Jack | 16.00 hours | 2 days | FixedWork |
3 | Perform soil test | Rose Fuller | 32.00 hours | 4 days | FixedWork |
4 | Soil test approval | Fuller King | 16.00 hours | 2 days | FixedWork |
5 | Project estimation | 138.00 hours | 8.5 days | FixedDuration | |
6 | Develop floor plan for estimation | Tamer Vinet | 30.00 hours | 3.75 days | FixedWork |
7 | List materials | Fuller King | 48.00 hours | 6 days | FixedWork |
8 | Estimation approval | Van Jack | 60.00 hours | 7.5 days | FixedWork |
9 | Sign contract | Bergs Anton | 0.00 hours | 0 days | FixedWork |
Mar 26, 2025 | Mar 30, 2025 | Apr 06, 2025 | Apr 13, 2025 | Apr 20, 2025 | Apr 27, 2025 | May 04, 2025 | May 11, 2025 | May 18, 2025 | May 25, 2025 | Jun 01, 2025 | Jun 08, 2025 | Jun 15, 2025 | Jun 22, 2025 | Jun 29, 2025 | Jul 06, 2025 | Jul 13, 2025 | Jul 20, 2025 | Jul 27, 2025 |
---|
W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S | M | T | W | T | F | S | S |
---|
In this example, you can see how to allocate single or multiple resources for the task. Based on the task complexity and the resource availability, you can plan and allocate the resources to task in the project. In this demo, there is a set of predefined resources and those IDs are assigned to the task. Resource information can be shown in Gantt Chart by using the labelSetting property.
Resources can be mapped using resourceFields:
id
: To map resource ID
name
: To map resource name
unit
: To map resource unit
The work, duration and resource unit fields of a task depends upon each other values and will change automatically on editing any one of these fields. But we can also set these field’s values as constant using the taskType property. The following values can be set to the type property:
FixedDuration
: Duration task field will remain constant while updating resource unit or work field.
FixedWork
: Work field will remain constant while updating resource unit or duration fields.
FixedUnit
: Resource units will remain constant while updating duration or work field.
Injecting Module:
Gantt control features are segregated into individual feature-wise modules. To use a selection, inject the
Selection
module using the Gantt.Inject(Selection)
method. To use markers, inject the
DayMarkers
module using the Gantt.Inject(DayMarkers)
method.
To edit resource unit, task type, and duration, inject the Toolbar
and Edit
module.
More information on the Essential® Gantt Chart can be found in this documentation section.