Making Room for rightside text

I have some dynamic text displayed to the right of my tasks:

gantt.templates.rightside_text = function (start, end, task) {
			if ($.inArray(task.type, workGapAwares) >= 0) {
				var text = "<b>Plan Inefficiency: " + task.epicPlanInefficiency + "</b>";
				return text;
			}
		};

For the longest tasks this text gets cut off. What would be the best way to dynamically increase the end_date of gantt? I was thinking I could find the “latest task” and change gantt.config.end_date to be “X units of the current scale” beyond that, but couldn’t see where there was a quick and efficient way to “find the end date of the longest and latest task”.

Any suggestions?

Hello,

You can change default value of displayed days after the last task in the source code:
github.com/DHTMLX/gantt/blob/ma … t.js#L3620

Find the latest task by using eachTask method and comparing task.end_date:
docs.dhtmlx.com/gantt/api__gantt_eachtask.html

Thanks for your quick reply!

I’m a little scared to update the original source, so I’ll probably avoid that and it sounds like there’s no more efficient way to calc end date other than to look through all the tasks, so I’ll take that approach.

Thanks again!