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
//<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
Configs
12Other
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.
Misc
Properties
18
Properties
18Common
Class hierarchy
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.
Functions
31
Functions
31Other
Renders the progress line.
Configuration
Events
Misc
Events
6
Events
6Fired when progress line is rendered
// Adding a listener using the "on" method
progressLine.on('progressLineDrawn', ({ }) => {
});Event handlers
6
Event handlers
6Called when progress line is rendered
new ProgressLine({
onProgressLineDrawn({ }) {
}
});Typedefs
2
Typedefs
2CSS variables
2
CSS variables
2| Name | Description |
|---|---|
--b-progress-line-color | Progress line color |
--b-progress-line-z-index | Progress line z-index |