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