ProgressLine

This feature draws project progress line with SVG lines. Requires PercentBar to be enabled (which by default, it is)

This feature is disabled by default. For info on enabling it, see GridFeatures.

let gantt = new Gantt({
    features : {
        progressLine : {
           statusDate : new Date(2017, 2, 8)
        }
    }
});

Status date can be changed dynamically:

gantt.features.progressLine.statusDate = new Date();

If status date is not provided, a project's statusDate is used.

If status date is not in the current Gantt time span, progress line will use view start or end coordinates. This behavior can be customized with drawLineOnlyWhenStatusDateVisible config. Or you can override shouldDrawProgressLine method and provide more complex condition.

Progress line is a set of SVG elements drawn between all the tasks.

Progress line
//<code-header>
fiddle.title = 'Progress line';
//</code-header>
targetElement.innerHTML = '<p>Drag tasks and see how progress line reacts.</p>';

const gantt = new Gantt({
    appendTo : targetElement,

    features : {
        progressLine : {
            statusDate : new Date(2019, 1, 11)
        }
    },

    // makes Gantt as high as it needs to be to fit rows
    autoHeight : true,

    columns : [
        { type : 'name', field : 'name', text : 'Name' }
    ],

    startDate : new Date(2019, 1, 4),
    endDate   : new Date(2019, 1, 11),

    tasks : [
        {
            id        : 1,
            name      : 'Project A',
            startDate : '2019-02-04',
            duration  : 5,
            expanded  : true,
            children  : [
                {
                    id          : 11,
                    name        : 'Preparation work',
                    startDate   : '2019-02-04',
                    percentDone : 100,
                    duration    : 5
                },
                {
                    id          : 12,
                    name        : 'Prototype',
                    startDate   : '2019-02-04',
                    percentDone : 50,
                    duration    : 5
                },
                {
                    id        : 13,
                    name      : 'Release',
                    startDate : '2019-02-04',
                    duration  : 0
                }
            ]
        }
    ]
});

Configs

12

Common

disabledInstancePlugin
listenersEvents

Other

Set to true to hide progress line, when status date is not in the current time axis.

parentOffsetY: Number= -4

Vertical pixel offset for connecting point at parent task containers, to keep lines visually consistent. Adjust this value when the task containers are styled differently from default themes. Negative value moves the connecting point up, positive value moves it down.

A reference date, to track the progress from. If not provided, the project's status date is used.

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

18

Common

disabledInstancePlugin

Class hierarchy

isProgressLine: Boolean= truereadonly
Identifies an object as an instance of ProgressLine class, or subclass thereof.
isProgressLine: Boolean= truereadonlystatic
Identifies an object as an instance of ProgressLine class, or subclass thereof.
isDelayableDelayable
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable

Other

A reference date, to track the progress from. If not provided, the project's status date is used.

Progress line status date. If not provided, current date is used.

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Functions

31

Other

Renders the progress line.

Returns true if progress line should be drawn

Returns: Boolean
createOnFrameDelayable
LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Events

6

Fired when progress line is rendered

// Adding a listener using the "on" method
progressLine.on('progressLineDrawn', ({  }) => {

});
catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

6

Called when progress line is rendered

new ProgressLine({
    onProgressLineDrawn({  }) {

    }
});
onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

2

CSS variables

2
NameDescription
--b-progress-line-colorProgress line color
--b-progress-line-z-indexProgress line z-index