Files
Jacek Pyziak 1f38807599 feat: Integrate JS Gantt Chart library and update styles
- Added JS Gantt Chart library files including CSS and JS.
- Updated existing Gantt chart styles for better visual representation.
- Translated month and day names to Polish in the Gantt chart settings.
- Implemented Gantt chart initialization in the main view with sample data.
- Added a toggle switch for displaying tasks in the calendar.
- Enhanced task edit form with a new checkbox for calendar visibility.
- Improved the layout of the logged-in user template to include Gantt chart styles and scripts.
2025-04-11 00:26:54 +02:00

70 lines
1.9 KiB
JavaScript

let data = [
{
recordID: 1,
row: "Row for ID #1",
tooltip: "Tooltips here! Get your tooltips!",
start: "Wed Jun 03 2020 14:21:55",
end: "Wed Jun 03 2020 20:21:55",
group: "This is a group with a new name",
groupId: 5
},
{
recordID: 2,
row: "Row for ID #2",
tooltip: "Tooltip for row 2",
start: "Jun 03 2020 11:00:00",
end: "Jun 03 2020 15:23:43",
group: "empty",
groupId: 1
},
{
recordID: 1,
row: "Row for ID #1",
tooltip: "Tooltip unique to this item",
start: "Wed Jun 03 2020 06:00:00",
end: "Wed Jun 03 2020 10:00:00",
group: "test",
groupId: 2,
subGroupId: 1,
subGroup: "Subgroup #1"
},
{
recordID: 5,
row: "Now we have grouping",
tooltip: "Tooltip after grouping",
start: "Wed Jun 03 2020 06:00:00",
end: "Wed Jun 03 2020 10:00:00",
group: "test",
groupId: 2,
subGroupId: 1,
subGroup: "Subgroup #1"
}
];
//This could be an API call to grab data
function refreshFunction() {
return data;
}
//Parameters that the chart expects
let params = {
sidebarHeader: "Unused right now",
noDataFoundMessage: "No data found",
startTimeAlias: "start",
endTimeAlias: "end",
idAlias: "recordID",
rowAlias: "row",
linkAlias: null,
tooltipAlias: "tooltip",
groupBy: "groupId,subGroupId",
groupByAlias: "group,subGroup",
refreshFunction: refreshFunction
}
//Create the chart.
//On first render the chart will call its refreshData function on its own.
let ganttChart = new Gantt("chart", params);
//To refresh the chart's data
ganttChart.refreshData();