Вот фрагмент:
Код: Выделить всё
gantt.plugins({
export_api: true
})
function exportData() {
gantt.exportToExcel({
visual: "base-colors",
cellColors: true
})
}
gantt.templates.timeline_cell_class = function (task, date) {
if (date.getDay() == 0 || date.getDay() == 6) {
return "weekend";
}
};
gantt.config.open_tree_initially = true;
gantt.config.grid_width = 410;
const tasks = {
"data": [
{
id: 10, text: "Task #2", start_date: "03-04-2018", type: "project",
render: "split"
},
{
id: 20, text: "Task #2.1", start_date: "03-04-2018", duration: 1,
parent: 10
},
{
id: 30, text: "Task #2.2", start_date: "05-04-2018", duration: 2,
parent: 10
},
{
id: 40, text: "Task #2.3", start_date: "08-04-2018", duration: 1,
parent: 10
}
]
}
gantt.init("gantt_here");
gantt.parse(tasks);
Подробнее здесь: https://stackoverflow.com/questions/797 ... -exporting