The links.add() method adds a new link to the Gantt Chart and updates the view.
DayPilot.Gantt.links.add(link);link (DayPilot.Link) - a new link to be added
// HTML: <div id="gantt"></div>
const gantt = new DayPilot.Gantt("gantt");
gantt.tasks.add(new DayPilot.Task({
id: "task-1",
start: "2015-01-01",
end: "2015-01-02",
text: "Task 1"
}));
gantt.tasks.add(new DayPilot.Task({
id: "task-2",
start: "2015-01-02",
end: "2015-01-03",
text: "Task 2"
}));
gantt.links.add(new DayPilot.Link({
id: "link-1",
from: "task-1",
to: "task-2",
type: "FinishToStart"
}));
gantt.init();