v7.3.0
SupportExamplesFree Trial

ProgressLine
Feature

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.

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 } ] } ] });

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Set to true to hide progress line, when status date is not in the current time axis.

  • 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.

    Has a corresponding runtime statusDate property.

  • Internal listeners, that cannot be removed by the user.

  • The widget which this plugin is to attach to.

    Has a corresponding runtime client property.

  • Set to false to disable localization of this object.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isDelayable : Booleantrue
    READONLY
    static
    ADVANCED
    Delayable
    Identifies an object as an instance of Delayable class, or subclass thereof.
  • isEvents : Booleantrue
    READONLY
    static
    ADVANCED
    Events
    Identifies an object as an instance of Events class, or subclass thereof.
  • isLocalizable : Booleantrue
    READONLY
    static
    ADVANCED
    Localizable
    Identifies an object as an instance of Localizable class, or subclass thereof.
  • isProgressLine : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of ProgressLine class, or subclass thereof.
  • properties : Object
    internal
    static
    InstancePlugin

    A class property getter for the default values of internal properties for this class.

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

    Has a corresponding statusDate config.

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

    Has a corresponding statusDate config.

  • emptyArray : Array
    internal
    READONLY
    InstancePlugin

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    InstancePlugin

    An empty object that can be used as a default value.

  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    InstancePlugin
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • isProgressLine : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of ProgressLine class, or subclass thereof.
  • config : Object
    READONLY
    ADVANCED
    InstancePlugin

    Returns a copy of the full configuration which was used to configure this object.

  • This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    InstancePlugin

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

  • client : Widget
    READONLY
    ADVANCED
    InstancePlugin

    The Widget which was passed into the constructor, which is the Widget we are providing extra services for.

    Has a corresponding client config.

  • Get the global LocaleHelper

  • Get the global LocaleManager

Functions

Functions are methods available for calling on the class
  • onClassMixedIn( )
    internal
    static
    InstancePlugin

    This optional class method is called when a class is mixed in using the mixin() method.

  • initClass( )
    static
    ADVANCED
    InstancePlugin

    Registers this class type with its Factory

  • draw( )

    Renders the progress line.

  • onProjectRefresh( )
    private

    Redraws the line when the project propagation is done

  • Internal function used to hook destroy() calls when using thisObj

  • Internal function used restore hooked destroy() calls when using thisObj

  • doDestroy( )
    internal
    Events

    Auto detaches listeners registered from start, if set as detachable

  • once( )
    private
    Events

    Internal function used to run a callback function after an event is triggered

  • Removes all listeners registered to this object by the application.

  • This will merge a feature's (subclass of InstancePlugin) keyMap with it's client's keyMap.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class

CSS variables

CSS variables that can be set to adjust appearance
Name Description
--b-progress-line-color Progress line color
--b-progress-line-z-index Progress line z-index
id: progressLine

Source path

Gantt/feature/ProgressLine.js

Demo

examples/progressline

Contents