The DayPilot.Gantt constructor creates a JavaScript Gantt chart instance bound to a placeholder element and optionally initializes it using a configuration object.
new DayPilot.Gantt(id, options)id (string) - id of the placeholder <div> element
options (object) - configuration object that can include DayPilot.Gantt Properties, DayPilot.Gantt Events, and the special members listed below
In addition to the standard events and properties, the options parameter also supports these special properties:
tasks - initial task array that will be loaded to tasks.list
scrollTo - initial scroll position (DayPilot.Date object or string in ISO 8601 format)
HTML
<div id="dp"></div>JavaScript
const gantt = new DayPilot.Gantt("dp");
gantt.theme = "gantt_white";
gantt.tasks.list = [
{ id: 1, start: "2015-01-01T00:00:00", end: "2015-01-01T15:00:00", text: "Task 1" }
];
gantt.init();
gantt.scrollTo("2015-01-01");Initialization with properties
const gantt = new DayPilot.Gantt("dp", {
theme: "gantt_white",
tasks: [
{ id: 1, start: "2015-01-01T00:00:00", end: "2015-01-01T15:00:00", text: "Task 1" }
],
scrollTo: "2015-01-01"
});
gantt.init();Task Loading [doc.daypilot.org]
Task Hierarchy [doc.daypilot.org]