리소스 관리
이 기능은 Gantt PRO 에디션에만 포함되어 있습니다.
Gantt는 리소스 부하를 시각화할 수 있는 사전 정의된 리소스 뷰, 작업별로 프로젝트를 분해하여 작업 부하를 균형 있게 조정할 수 있는 도구, 그리고 작업 및 리소스에 맞춤화된 캘린더를 제공합니다.

Gantt 자체적으로 리소스 부하를 계산하거나 내장된 방법을 제공하지는 않지만, 필요한 모든 맞춤 기능을 생성할 수 있 도록 public API를 제공합니다.
리소스 뷰 패널
dhtmlxGantt는 리소스 부하를 표시하기 위해 두 가지 사전 정의된 레이아웃 뷰를 제공합니다: 리소스 부하 다이어그램과 리소스 히스토그램입니다.
리소스 부하 다이어그램
이 다이어그램에는 "resourceGrid"와 "resourceTimeline"이라는 그리드와 타임라인 전용 뷰가 포함되어 있습니다.

gantt.config.layout = {
css: "gantt_container",
rows: [
{
// 기본 Grid 및 Timeline 레이아웃
cols: [
{view: "grid", group:"grids", scrollY: "scrollVer"},
{resizer: true, width: 1},
{view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer"},
{view: "scrollbar", id: "scrollVer", group:"vertical"}
],
gravity:2
},
{ resizer: true, width: 1},
{
// 리소스 패널의 Grid 및 Timeline 레이아웃
config: resourceConfig, // Grid 및 Timeline용 config
cols: [
{view: "resourceGrid", group:"grids", width: 435, scrollY:"resourceVScroll"},
{resizer: true, width: 1},
{view: "resourceTimeline", scrollX: "scrollHor", scrollY:"resourceVScroll"},
{view: "scrollbar", id: "resourceVScroll", group:"vertical"}
],
gravity:1
},
{view: "scrollbar", id: "scrollHor"}
]
};
설정 후 resourceGrid는 기본 grid 뷰처럼 동작하지만 읽기 전용입니다. resourceTimeline은 기본 타임라인과 동일한 스케일 설정을 사용하며, 두 개의 레이어가 있습니다:
- 배경 행: task_row_class 및 timeline_cell_class에서 제공하는 템플릿을 사용합니다. 이들은 레이아웃 수준에서 사용자 정의할 수 있습니다.
- 리소스 레이어: resourceTimeline에만 존재하며, 리소스가 할당된 작업이 있는 셀에 블록을 보여줍니다. 이 블록의 스타일과 내용은 resource_cell_class 및 resource_cell_value 템플릿으로 사용자 정의할 수 있습니다.
gantt.templates.resource_cell_value = function(start_date, end_date, resource, tasks,
assignments){
var html = "<div>" + tasks.length * 8 + "h</div>";
return html;
};
Templates of the Resource diagram
리소스 히스토그램
이 리소스 부하 레이아웃 뷰는 그리드와 타임라인에 각각 "resourceGrid"와 "resourceHistogram" 뷰를 포함합니다.

gantt.config.layout = {
css: "gantt_container",
rows: [
{
// 기본 Grid 및 Timeline 레이아웃
gravity: 2,
cols: [
{view: "grid", group:"grids", scrollY: "scrollVer"},
{resizer: true, width: 1},
{view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer"},
{view: "scrollbar", id: "scrollVer", group:"vertical"}
]
},
{ resizer: true, width: 1, next: "resources"},
{
// 리소스 패널의 Grid 및 Timeline 레이아웃
gravity:1,
id: "resources",
config: resourceConfig, // Grid 및 Timeline용 config
templates: resourceTemplates, // Grid 및 Timeline용 templates
cols: [
{ view: "resourceGrid", group:"grids", scrollY: "resourceVScroll" },
{ resizer: true, width: 1},
{ view: "resourceHistogram", capacity:24, scrollX: "scrollHor",
scrollY: "resourceVScroll"},
{ view: "scrollbar", id: "resourceVScroll", group:"vertical"}
]
},
{view: "scrollbar", id: "scrollHor"}
]
};
리소스 부하 다이어그램과 마찬가지로 resourceGrid는 기본 grid 뷰와 유사하게 동작하지만 읽기 전용입니다. resourceHistogram은 여러 추가 템플릿을 제공합니다:
- histogram_cell_class - 리소스 패널 셀에 적용되는 CSS 클래스
gantt.templates.histogram_cell_class="function(start_date,end_date,resource,tasks,"
assignments){
return "";
};
- histogram_cell_label - 셀 내부에 표시되는 라벨
gantt.templates.histogram_cell_label="function(start_date,end_date,resource,tasks,"
assignments){
return tasks.length * 8;
};
- histogram_cell_allocated - 히스토그램에서 채워진 영역의 높이 (0 ~ maxCapacity)
gantt.templates.histogram_cell_allocated="function(start_date,end_date,resource,tasks,"
assignments){
return tasks.length * 8;
};
- histogram_cell_capacity - 리소스의 사용 가능 용량을 나타내는 선의 높이 (-1 ~ maxCapacity, 0 미만이면 선이 숨겨짐)
gantt.templates.histogram_cell_capacity="function(start_date,end_date,resource,tasks,"
assignments){
return 24;
};
maxCapacity 이해하기
각 히스토그램 행은 막대그래프처럼 작동하며, maxCapacity는 Y축의 스케일 높이를 의미합니다. 아래 예시에서 maxCapacity는 24입니다.

따라서 histogram_cell_allocated 또는 histogram_cell_capacity를 24로 설정하면 행의 맨 위에 도달합니다.
기본적으로 maxCapacity는 모든 리소스에 대해 24로 설정되어 있습니다. histogram_cell_capacity에서 24보다 큰 값을 반환해도 계산은 올바르게 처리되지만, 리소스 패널 셀에서 채워진 영역이 예상과 다르게 보일 수 있습니다.

maxCapacity는 전체 히스토그램 또는 리소스별로 개별적으로 설정할 수 있습니다. 예시는 다음과 같습니다:
Related example: maxCapacity 설정 예시
maxCapacity는 히스토그램 수준에서 설정할 수 있습니다:
{ view: "resourceHistogram", capacity:24, scrollX: "scrollHor",
scrollY: "resourceVScroll"}
또는 각 리소스별로 개별 지정할 수 있습니다:
resourcesStore.parse([
{id: 1, text: "John", capacity:8},
{id: 2, text: "Mike", capacity:4},
{id: 3, text: "Anna", capacity:8},
{id: 4, text: "Bill", capacity:8},
{id: 5, text: "Floe", capacity:8}
]);
리소스별로 설정된 capacity는 해당 리소스에 대해 히스토그램의 전역 capacity를 덮어씁니다.
리소스 뷰 패널 사용하기
기본적으로 두 뷰("resourceGrid"와 "resourceTimeline" 또는 "resourceGrid"와 "resourceHistogram") 모두 gantt.config.resource_store 설정에서 지정한 데이터 스토어와 연결됩니다.