타임라인 뷰
정보
이 뷰는 Scheduler PRO 버전에만 포함되어 있습니다.
타임라인 뷰는 이벤트를 수평으로 표시하며, 각각의 타임라인을 좌우로 나란히 배치합니다.

초기화
스케줄러에 타임라인 뷰를 추가하려면 다음 단계를 따르세요:
- 페이지에서 Timeline 확장 기능을 활성화하세요:
- Timeline - 'Bar' 및 'Cell' 모드용
- Timeline, Treetimeline - 'Tree' 모드용
- Timeline, Daytimeline - 'Days' 모드용
scheduler.plugins({
timeline: true,
treetimeline: true,
daytimeline: true
});
- 스케줄러의 마크업에 뷰 탭을 추가하세요:
<div id="scheduler_here" class="dhx_cal_container" ...>
<div class="dhx_cal_navline">
...
<div class="dhx_cal_tab" name="timeline_tab"></div>
</div>
...
</div>
- 탭의 라벨을 설정하세요:
//'timeline_tab'은 div의 이름을 참조합니다
scheduler.locale.labels.timeline_tab ="Timeline";
- createTimelineView 메서드를 호출하세요:
scheduler.createTimelineView({
name:"timeline",
x_unit:"minute", // X축의 단위
x_date:"%H:%i", // X축에 표시되는 날짜 포맷
x_step:30, // X축 단위의 간격
x_size:24, // X축에 표시되는 'x_step'의 총 개수
x_start:16, // X축 시작 오프셋 (x_unit 기준)
x_length:48, // 한 번에 스크롤되는 'x_step'의 개수
y_unit: // Y축에 표시되는 섹션
[{key:1, label:"Section A"},
{key:2, label:"Section B"},
{key:3, label:"Section C"},
{key:4, label:"Section D"}],
y_property:"section_id", // 데이터를 섹션에 매핑하는 속성
render:"bar" // 뷰 모드
});
노트
'Days' 모드를 사용할 때, 타임 스케일은 반드시 정확히 하루를 포함해야 합니다. 설정이 더 짧거나 길면 타임라인이 올바르게 렌더링되지 않습니다.
스케일 구성 예시
createTimelineView 메서드는 많은 파라미터를 포함하고 있지만, 실제로는 간단합니다.
예시: 09:00부터 15:00까지 30분 간격으로, 하루 단위로 스크롤되는 타임 스케일.

{
x_unit:"minute",// 스케일 단위는 분
x_step:30, // 30분 간격, 예: 09:00 - 09:30
x_size:12, // 09:00~15:00까지 30분 구간의 개수
// 15 - 9 = 6시간 = 360분 = 360/30 = 12
x_start:18, // 스케일 시작은 09:00, 즉 00:00으로부터 9시간
// 9시간 = 540분 = 540/30 = 18 'x_step'
x_length:48,// 하루 스크롤: 1일 = 24시간 = 1440분 = 1440/30 = 48 'x_step'
...
}
타임라인 뷰 구성
이름에 (timeline)_some이 포함된 모든 템플릿 함수는 뷰를 생성한 후에 정의해야 합니다. 이러한 함수들은 타임라인 생성자에 의해 동적으로 할당되며 createTimelineView 호출 시 덮어쓰기 때문입니다.
타임라인 뷰의 시작 날짜 설정
예를 들어, 타임라인 뷰의 시작 날짜를 설정하는 방법은 다음과 같습니다.
모든 뷰의 시작 날짜는 scheduler.date[<viewName> +"_start"] 함수로 제어됩니다. 타임라인 스케일의 첫날을 조정하려면, scheduler.createTimelineView() 호출 후 scheduler.date.timeline_start 함수를 오버라이드하세요:
// 주의 시작을 월요일로 설정
scheduler.config.start_on_monday = true;
// 타임라인 뷰 생성
scheduler.createTimelineView({
name: "timeline",
render: "tree",
days: 7,
folder_dy: 20,
x_unit: "day",
x_date: "%D %j %F",
x_step: 1,
x_size: 7,
x_start: 0,
x_length: 7,
y_unit:[],
y_property: "section_id"
});
// 생성 후 시작 날짜 함수 오버라이드
scheduler.date.timeline_start = scheduler.date.week_start;
// 스케줄러 초기화
scheduler.init("timeline_tree", new Date(), "timeline");
타임라인 객체 API
타임라인 뷰와 상호작용할 수 있는 여러 메서드가 제공됩니다.