HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var data = getData();
3
4
var chart = anychart.ganttProject();
5
chart.data(data, 'as-table');
6
chart.xScale().minimumGap(0.3);
7
chart.xScale().maximumGap(0.3);
8
chart.defaultRowHeight(30);
9
10
var baselines = chart.getTimeline().baselines();
11
var blProgress = baselines.progress();
12
blProgress.fill('pink');
13
blProgress.labels().fontStyle('italic').fontColor('purple');
14
blProgress.height('70%');
15
16
chart.title('Complex demo of baseline progress features');
17
chart.container('container');
18
chart.draw();
19
chart.fitAll();
20
});
21
22
function getData() {
23
return [
24
{
25
id: 0,
26
name: 'with BL-progress',
27
actualStart: 1263715200000,
28
actualEnd: 1265392800000,
29
progressValue: 0.17,
30
baselineStart: 1263110400000,
31
baselineEnd: 1265270400000,
32
baselineProgressValue: 0.35
33
}, {
34
id: 1,
35
name: 'with BL-progress, w/o BL',
36
parent: 0,
37
actualStart: 1263715200000,
38
actualEnd: 1264420800000,
39
baselineProgressValue: 0.5,
40
progressValue: 0.15
41
},
42
{
43
id: 2,
44
name: 'BL-progress not set, w/o BL',
45
actualStart: 1263715200000,
46
actualEnd: 1264420800000,
47
progressValue: 0.75
48
},
49
{
50
id: 3,
51
name: 'BL-progress set to 0',
52
actualStart: 1263715200000,
53
actualEnd: 1265392800000,
54
progressValue: 0.17,
55
baselineStart: 1263110400000,
56
baselineEnd: 1265270400000,
57
baselineProgressValue: 0
58
},
59
{
60
id: 4,
61
name: 'BL-progress not set',
62
parent: 3,
63
actualStart: 1263715200000,
64
actualEnd: 1265392800000,
65
progressValue: 0.17,
66
baselineStart: 1263110400000,
67
baselineEnd: 1265270400000,
68
},
69
{
70
id: 5,
71
name: 'No BL, No Actual, BL-progress is set',
72
progressValue: 0.17,
73
baselineProgressValue: 0.5
74
},
75
{
76
id: 6,
77
name: 'Point settings coloring',
78
actualStart: 1263715200000,
79
actualEnd: 1265392800000,
80
progressValue: 0.17,
81
baselineStart: 1263110400000,
82
baselineEnd: 1265270400000,
83
baselineProgressValue: 0.35,
84
baselineProgress: {
85
fill: 'yellow',
86
label: {
87
enabled: true,
88
fontColor: 'navy',
89
format: 'Planned Progress: [{%baselineProgress}]'
90
}
91
}
92
}];
93
}