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
// Creates Gantt project chart.
5
var chart = anychart.ganttProject();
6
chart.data(data, "asTable");
7
8
chart.title("Create a Gantt Project chart");
9
chart.container("container");
10
chart.draw();
11
12
function getData() {
13
return [
14
{
15
"id": "1",
16
"name": "Phase 1 - Strategic Plan",
17
"progressValue": "14%",
18
"actualStart": 951350400000,
19
"actualEnd": 954201600000
20
},
21
{
22
"id": "2",
23
"name": "Self-Assessment",
24
parent: "1",
25
"progressValue": "25%",
26
"actualStart": 951350400000,
27
"actualEnd": 951955200000
28
},
29
{
30
"id": "3",
31
"name": "Define business vision",
32
parent: "2",
33
"progressValue": "0%",
34
"actualStart": 951408000000,
35
"actualEnd": 951440400000,
36
"connectTo": "4",
37
"connectorType": "FinishStart"
38
},
39
{
40
"id": "4",
41
"name": "Identify available skills, information and support",
42
parent: "2",
43
"progressValue": "0%",
44
"actualStart": 951494400000,
45
"actualEnd": 951526800000,
46
"connectTo": "5",
47
"connectorType": "FinishStart"
48
},
49
{
50
"id": "5",
51
"name": "Decide whether to proceed",
52
parent: "2",
53
"progressValue": "0%",
54
"actualStart": 951753600000,
55
"actualEnd": 951786000000,
56
"connectTo": "7",
57
"connectorType": "FinishStart"
58
},
59
{
60
"id": "6",
61
"name": "Define the Opportunity",
62
parent: "1",
63
"progressValue": "27%",
64
"actualStart": 951782400000,
65
"actualEnd": 952992000000
66
},
67
{
68
"id": "7",
69
"name": "Research the market and competition",
70
parent: "6",
71
"progressValue": "0%",
72
"actualStart": 951840000000,
73
"actualEnd": 951872400000,
74
"connectTo": "8",
75
"connectorType": "FinishStart"
76
}
77
];
78
}
79
});