How to configure the time scale?

Modified on Wed, 29 May, 2019 at 5:45 PM

You can use  Widget parameter Advanced > Scale ( D || W || M ) - it configures the scale of the timeline. The allowed values are:

  • 'D' - day
  • 'W' - week
  • 'M' - Month



Expert Trick: 

You can override the setting by the  Advanced > Gantt Configuration Script


    gantt.config.scale_unit = "month";
    gantt.config.step = 1;
    gantt.config.date_scale = "%F, %Y";
    gantt.config.min_column_width = 50;

    gantt.config.scale_height = 90;

    var weekScaleTemplate = function (date) {
        var dateToStr = gantt.date.date_to_str("%d %M");
        var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
        return dateToStr(date) + " - " + dateToStr(endDate);
        };

    var daysStyle = function(date){
        var dateToStr = gantt.date.date_to_str("%D");
        if (dateToStr(date) == "Sun"||dateToStr(date) == "Sat")  return "weekend";
        return "";
        };

    gantt.config.subscales = [
        {unit: "week", step: 1, template: weekScaleTemplate},
        {unit:"day", step:1, date:"%D", css:daysStyle }
        ];



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article