Hi!
I have noticed that the the GANTT view inerts a leading empty gantt.config.scale_unit (hour / day / week / month).
Is there any way to supress this behaviour?
See attached image and example below.
---- CODE ----
//GANTT configuration
gantt.config.duration_unit = “hour”;
gantt.config.duration_step = 1;
gantt.config.scale_unit = “day”;
gantt.config.step = 1;
gantt.config.min_column_width = 50;
gantt.config.scale_height = 90;
var weekScaleTemplate = function(date){
var dateToStr = gantt.date.date_to_str(“%Y”);
return “Week”+ dateToStr(date) +“-”+ gantt.date.getISOWeek(date);
};
gantt.config.subscales = [
{unit:“week”, step:1, template:weekScaleTemplate},
{unit:“day”, step:1, date:“%D %d %M”},
{unit:“hour”, step:3, date:“%H:%i”}
];
gantt.config.columns = [
{name:“text”, label:“Task name”, tree:true},
{name:“duration”, label:“Duration”, align: “right”}
];
gantt.config.autosize = true; //“xy”;
gantt.config.readonly = true;
gantt.config.start_date = new Date(2014, 3, 18);
//Init GANTT
gantt.init(“gantt_plo”);
//Load data
var baseURI = unescape(location.href.split(‘.nsf’)[0] +‘.nsf’);
baseURI = baseURI.split(‘\’).join(‘/’);
var ganttURI = baseURI +“/dhtmlxgantt-data05.json”;
gantt.load(ganttURI, “json”);
------ JSON ----
{
“data”: [{
“id”: 1,
“start_date”: “18-04-2014 06:00:00”,
“duration”: 11,
“text”: “Ekhyddan”,
“progress”: 0.8,
“sortorder”: 20,
“parent”: 0,
“open”: true
}, {
“id”: 2,
“start_date”: “18-04-2014 06:00:00”,
“duration”: 4,
“text”: “Apa”,
“progress”: 0.5,
“sortorder”: 10,
“parent”: 1,
“open”: true
}, {
“id”: 3,
“start_date”: “18-04-2014 10:00:00”,
“duration”: 4,
“text”: “Bapa”,
“progress”: 0.7,
“sortorder”: 20,
“parent”: 1,
“open”: true
}, {
“id”: 4,
“start_date”: “19-04-2014 00:00:00”,
“duration”: 8,
“text”: “Task #3”,
“progress”: 0,
“sortorder”: 30,
“parent”: 1,
“open”: true
}]
}