Hi John,
To be able to select an extended period, multiple weekends or an entire month. You have to use you can leverage the customGridLines property. This property allows you to add custom grid lines to the Gantt chart, effectively creating markers on specific dates. You can use a for loop through these dates and it will be displayed on your chart. This is a code sample to achieve this
// Assume you have an array of selected dates
var selectedDates = ["2023-11-15", "2023-11-22", "2023-12-01"];
// Loop through the selected dates and add custom grid lines
for (var i = 0; i < selectedDates.length; i++) {
apex.jQuery("#GANTT_CHART_ID").ganttChart("addCustomGridLine", {
value: selectedDates[i],
label: "Selected Date",
style: {
stroke: "red", // You can customize the line color
"stroke-width": 2
}
});
}
Replace "GANTT_CHART_ID" with the actual ID of your Gantt chart region.
Let me know if you need further clarification on this
Sam
apex developer
Hello John
Thanks for writing this document its been very helpful I am in the process of trying to get a constant line or marker to appear on selected dates on a gantt chart. So far are ive been able to display selected dates but unable to select an extended period, multiple weekends or an entire month. Could you please advise on how to do this?