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
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
Configs are options you supply in a configuration object when creating an instance of this class-
Set to
trueto 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
falseto disable localization of this object.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Delayable class, or subclass thereof.
-
Identifies an object as an instance of Events class, or subclass thereof.
-
Identifies an object as an instance of Localizable class, or subclass thereof.
-
Identifies an object as an instance of ProgressLine class, or subclass thereof.
-
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.
-
An empty array that can be used as a default value.
-
An empty object that can be used as a default value.
-
Identifies an object as an instance of InstancePlugin class, or subclass thereof.
-
Identifies an object as an instance of ProgressLine class, or subclass thereof.
-
Returns a copy of the full configuration which was used to configure this object.
-
This property is set to
truebefore theconstructorreturns. -
This property is set to
trueon entry to the destroy method. It remains on the objects after returning fromdestroy(). If isDestroyed istrue, this property will also betrue, so there is no need to test for both (for example,comp.isDestroying || comp.isDestroyed). -
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-
This optional class method is called when a class is mixed in using the mixin() method.
-
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
-
Auto detaches listeners registered from start, if set as detachable
-
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-
Fired when progress line is rendered
Event handlers
Event handlers are callbacks called as a result of certain actions in this class-
Called when progress line is rendered
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 |