You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/desktop/baselines.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,9 @@ Custom Elements in Timeline Area
6
6
dhtmlxGantt provides the [built-in functionality](desktop/inbuilt_baselines.md) that allows rendering such extra elements as baselines,
7
7
deadlines and task constraints by default. In case, you need to extend or modify the default features, you can add custom elements into timeline manually as described below.
8
8
9
+
Displaying additional elements is usually done by creating a displayable layer and placing custom elements there
10
+
(using the absolute positioning to put custom elements next to the related task).
11
+
9
12
**To add one more layer to the timeline area**, use the api/gantt_addtasklayer.md method. As a parameter, the method takes a function that:
Copy file name to clipboardExpand all lines: data/desktop/inbuilt_baselines.md
+115-9Lines changed: 115 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,10 @@ By default, dhtmlxGantt renders elements of the timeline area as layers and does
9
9
1. Timeline's grid
10
10
2. Links
11
11
3. Tasks
12
+
4. Additional elements
12
13
13
-
Displaying additional elements, such as a baseline or deadline marker, is usually done by creating a displayable layer and placing custom elements there
14
-
(using the absolute positioning to put custom elements next to the related task).
14
+
Gantt includes such built-in elements as baselines, deadlines and time constraints. Instead of the default extra elements,
15
+
you can also [create custom ones as additional layers](desktop/baselines.md).
15
16
16
17
Baselines
17
18
----------------
@@ -21,7 +22,58 @@ Gantt API provides built-in support for baseline entities, greatly simplifying t
In case, the default baselines functionality doesn't suit your project requirements, you can disable it using the api/gantt_baselines_config.md configuration option.
30
+
31
+
~~~js
32
+
gantt.config.baselines=false;
33
+
~~~
34
+
35
+
After that you can customize the display of baselines in one of the following ways:
36
+
37
+
1\. Using the **gantt.config.baselines** configuration object
38
+
39
+
The **baselines** configuration option also allows customizing the rendering of baselines in the Gantt chart when set as an object.
40
+
The object configuration contains the following properties:
41
+
42
+
-**datastore** (*string*) - the name of the datastore used for storing baseline entries. For related functionality, see the `getDatastore` method.
43
+
-**render_mode** (*boolean | string*) - determines how baselines are displayed:
44
+
- `false` - baselines are not shown.
45
+
- `"taskRow"` - baselines are displayed in the same row as the task bar.
46
+
- `"separateRow"` - baselines are shown in a separate subrow, expanding the task row height.
47
+
- `"individualRow"` - each baseline is displayed in its own subrow beneath the task.
48
+
-**dataprocessor_baselines** (*boolean*) - specifies whether baseline updates trigger the DataProcessor as individual entries.
49
+
-**row_height** (*number*) - defines the height of the subrow for baselines, applicable only when `render_mode` is set to `"separateRow"` or `"individualRow"`.
50
+
-**bar_height** (*number*) - sets the height of the baseline bar.
51
+
52
+
For example:
53
+
54
+
~~~js
55
+
gantt.config.baselines= {
56
+
datastore:"baselines",
57
+
render_mode:false,
58
+
dataprocessor_baselines:false,
59
+
row_height:16,
60
+
bar_height:8
61
+
};
62
+
gantt.init("gantt_here");
63
+
~~~
64
+
65
+
If you dynamically modify the display settings of the **gantt.config.baselines** config, you should use the api/gantt_adjusttaskheightforbaselines.md method
66
+
for proper display of baseline elements.
67
+
68
+
~~~js
69
+
consttask=gantt.getTask(taskId);
70
+
gantt.adjustTaskHeightForBaselines(task); /*!*/
71
+
gantt.render();
72
+
~~~
73
+
74
+
2\.[Creating a custom baseline element](desktop/baselines.md) for adding into the timeline.
75
+
76
+
### Loading baselines with tasks
25
77
26
78
Baselines can be loaded directly alongside tasks, streamlining data management and display. Check the example below:
27
79
@@ -56,11 +108,38 @@ gantt.parse({
56
108
57
109
Once baselines are loaded, Gantt will automatically display them in the timeline without any additional configuration.
58
110
59
-
{{sample 04_customization/15_baselines.html}}
111
+
### Getting task baselines
112
+
113
+
You can get the baselines of a particular task using the api/gantt_gettaskbaselines.md method.
114
+
115
+
~~~js
116
+
gantt.getTaskBaselines(5);
117
+
~~~
60
118
61
-
### Using the lightbox
119
+
The method will return an array of baselines objects of the specified task from the datastore.
62
120
63
-
You can manage baselines via the lightbox control. Adding, editing and deleting baselines is avalable directly from the task details.
121
+
~~~js
122
+
[
123
+
{
124
+
task_id:5,
125
+
id:1,
126
+
duration:2,
127
+
start_date:"03-04-2019 00:00",
128
+
end_date:"05-04-2019 00:00"
129
+
},
130
+
{
131
+
task_id:5,
132
+
id:2,
133
+
duration:1,
134
+
start_date:"06-04-2019 00:00",
135
+
end_date:"07-04-2019 00:00"
136
+
}
137
+
]
138
+
~~~
139
+
140
+
### Baselines in the lightbox
141
+
142
+
You can manage baselines via the lightbox control. Adding, editing and deleting baselines is available directly from the task details.
In project management, tracking deadlines and understanding task constraints are vital for timely delivery.
114
203
DHTMLX Gantt comes with built-in visualization for deadlines and constraints, enhancing the ability to manage project timelines effectively.
115
204
205
+

206
+
207
+
{{sample 04_customization/14_deadline.html}}
208
+
116
209
### Deadlines visualization
117
210
118
211
Gantt supports a numeric **task.deadline** field. When specified, it displays a visual indicator on the chart, thereby simplifying the tracking of task deadlines.
@@ -132,6 +225,19 @@ gantt.parse({
132
225
});
133
226
~~~
134
227
135
-

228
+
### Customizing deadlines
229
+
230
+
In case, the default deadlines functionality doesn't suit your project requirements, you can disable it using the api/gantt_deadlines_config.md configuration option.
231
+
232
+
~~~js
233
+
gantt.config.deadlines=false;
234
+
~~~
235
+
236
+
After that you can customize the display of deadlines by [creating a custom deadline element](desktop/baselines.md) for adding into the timeline.
237
+
238
+
The **gantt.config.deadlines** config enables or disables the display of deadline elements for tasks. If enabled, Gantt will check the **task.deadline** property,
239
+
and if it contains a valid date, the deadline element will be displayed in the timeline.
0 commit comments