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
7
var timeLine = chart.getTimeline();
8
9
var customTextMarker = timeLine.textMarker();
10
customTextMarker.value('2000-02-27T00:00:00');
11
customTextMarker.offsetY(7);
12
customTextMarker.text('Custom');
13
14
// Get text.
15
var text = customTextMarker.text();
16
17
customTextMarker.text(text + ' marker');
18
19
chart.title('Get and modify marker text');
20
chart.container('container');
21
chart.draw();
22
chart.fitAll();
23
});
24
25
function getData() {
26
return [
27
{
28
id: 1,
29
name: 'Phase 1 - Strategic Plan',
30
progressValue: 0.14,
31
actualStart: '2000-02-24T08:00:00',
32
actualEnd: '2000-02-27T08:00:00'
33
},
34
{
35
id: 2,
36
name: 'Self-Assessment',
37
parent: 1,
38
progressValue: 0.25,
39
actualStart: '2000-02-24T08:00:00',
40
actualEnd: '2000-02-29T08:00:00',
41
'baselineStart': '2000-02-27T08:00:00',
42
'baselineEnd': '2000-02-28T08:00:00'
43
},
44
{
45
id: 3,
46
name: 'Define business vision',
47
parent: 2,
48
progressValue: 0,
49
actualStart: '2000-02-25T00:00:00',
50
actualEnd: '2000-02-25T09:00:00',
51
connectTo: 4,
52
connectorType: 'finish-start'
53
},
54
{
55
id: 4,
56
name: 'Identify available skills, information and support',
57
parent: 2,
58
progressValue: 0,
59
actualStart: '2000-02-26T00:00:00',
60
actualEnd: '2000-02-26T09:00:00',
61
connectTo: 5,
62
connectorType: 'finish-start'
63
},
64
{
65
id: 5,
66
name: 'Decide whether to proceed',
67
parent: 2,
68
progressValue: 0,
69
actualStart: '2000-02-27T08:00:00',
70
actualEnd: '2000-02-28T08:00:00',
71
connectTo: 6,
72
connectorType: 'finish-start'
73
},
74
{
75
id: 6,
76
name: 'Define the Opportunity',
77
parent: 1,
78
progressValue: 0.27,
79
actualStart: '2000-02-28T08:00:00',
80
actualEnd: '2000-02-29T08:00:00'
81
},
82
{
83
id: 7,
84
name: 'Research the market and competition',
85
parent: 6,
86
progressValue: 0,
87
actualStart: '2000-02-26T08:00:00',
88
actualEnd: '2000-02-27T08:00:00'
89
}
90
];
91
}