Milestone rightside_text truncated at end of scale

Hello,

I have a problem with milestone task gantt.templates.rightside_text labels that are truncated at the right end of the timescale (see attached picture). The start and end dates of the gantt are determined automatically from the task data, that is comprised of project tasks with child milestone tasks, like this:

{ data:[
{id:1, text:‘High Level Plan’, type:gantt.config.types.project, open:true, always_show:true },
{id:2, text:‘Spec Out Drop1’, start_date:‘07/01/2014’, type:gantt.config.types.milestone, open:true, parent:1 },
{id:3, text:‘End of test Drop1’, start_date:‘30/04/2014’, type:gantt.config.types.milestone, open:true, parent:1 }] }

I have tried to set later end dates on the project task and by setting the gantt.config.end_date property to a value a couple of weeks later, but to no avail. Can you tell me how to ensure that the gantt scale is sufficiently wide to display the rightside_text please?

Regards,
Gary

Hi,
you can check whether the task has enough space to display label at right side, and if it’s not - show label at left:[code]function milestone_text(task){
if(task.type == gantt.config.types.milestone){
return task.text;
}
return “”;
}

function fit_label(task){
return (((gantt.posFromDate(gantt.getState().max_date) - gantt.posFromDate(task.end_date)) >= 200));
}

gantt.templates.rightside_text = function(start, end, task){
if(fit_label(task))
return milestone_text(task);
return “”;
};
gantt.templates.leftside_text = function(start, end, task){
if(!fit_label(task))
return milestone_text(task);
return “”;
};[/code]