Minute subscale keeps changing

The basic idea of what I want to set up is 3 scales:

DAY > HOUR > MINUTES (0,15,30,45)

It does things like
(0,15,30,45)
(12,27,42,57)

Everything is working, except the hour scale, keeps switching, it seems to be based on my system clock. That is to say, it increments after refreshing the chart.

I’ve attached a screenshot.


Here is my init:

[code]
gantt.config.fit_tasks = true;
gantt.config.scale_height = 80;
gantt.config.min_column_width = 50;
gantt.config.xml_date = “%Y-%m-%d %H:%i:%s”;

gantt.config.columns = [
{ name: “text”, label: “Nom de la tâche”, align: “left”, tree: true, width: ‘*’ },
{ name: “start_date”, label: “Date initiale”, align: “center” },
{ name: “duration”, label: “Duration”, align: “center” },
{ name: “form_identifier”, label: “Identifiant de formulaire”, align: “center”, hide: true }
];

gantt.config.scale_unit = “day”;
gantt.config.step = 1;
gantt.config.date_scale = “%j %F, %l”;
gantt.config.duration_unit = “hour”;
gantt.config.duration_step = 1;

gantt.config.subscales = [
{ unit: “hour”, step: 1, date: “%g” },
{ unit: “minute”, step: 15, date: “%i” }
];

gantt.init(‘gantt-data’);
gantt.load(loadTasksUrl);

var dp = new gantt.dataProcessor(loadTaskUrl);
dp.init(gantt);
dp.setTransactionMode(‘REST’);a[/code]

Hi,
It is expected behaviour.
If the scale interval is not strictly specified ( by the start_date, end_date options) dhtmlxGantt calculates it based on the dates of the earliest and latest tasks and adds an empty interval to the start and end of the scale. By default, this ‘empty’ interval is equal to the minimum unit of used scale (in your case 1 minute).

So if you have a subscale with a step greater than 1, you need either set the value of scale_offset_minimal config to false. In this case scale_unit = “day” will be the main and the scale will be rendered according it.
docs.dhtmlx.com/gantt/api__gant … onfig.html
docs.dhtmlx.com/gantt/snippet/c1b555ff

or strictly specify the required time range for the scale using start_date/end_date configurations
docs.dhtmlx.com/gantt/api__gant … onfig.html
docs.dhtmlx.com/gantt/snippet/56069566

Ah ok, that did the trick. Thanks.