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
7
var timeline = chart.getTimeline();
8
9
var header = timeline.header();
10
header.topLevel({tileFill: "none"});
11
header.midLevel({tileFill: "none"});
12
header.lowLevel({tileFill: "none"});
13
14
// Set background fill.
15
header.backgroundFill(["#FAFFD1", "#A1FFCE"]);
16
17
chart.title("Set background fill parameter as an array");
18
chart.container("container");
19
chart.draw();
20
chart.fitAll();
21
});
22
function getData() {
23
return [
24
{
25
"id": "1",
26
"name": "Phase 1 - Strategic Plan",
27
"progressValue": "14%",
28
"actualStart": 951350400000,
29
"actualEnd": 951609600000
30
},
31
{
32
"id": "2",
33
"name": "Self-Assessment",
34
parent: "1",
35
"progressValue": "25%",
36
"actualStart": 951350400000,
37
"actualEnd": 951782400000
38
},
39
{
40
"id": "3",
41
"name": "Define business vision",
42
parent: "2",
43
"progressValue": "0%",
44
"actualStart": 951408000000,
45
"actualEnd": 951440400000,
46
"connectTo": "4",
47
"connectorType": "FinishStart"
48
},
49
{
50
"id": "4",
51
"name": "Identify available skills, information and support",
52
parent: "2",
53
"progressValue": "0%",
54
"actualStart": 951494400000,
55
"actualEnd": 951526800000,
56
"connectTo": "5",
57
"connectorType": "FinishStart"
58
},
59
{
60
"id": "5",
61
"name": "Decide whether to proceed",
62
parent: "2",
63
"progressValue": "0%",
64
"actualStart": 951609600000,
65
"actualEnd": 951696000000,
66
"connectTo": "6",
67
"connectorType": "FinishStart"
68
},
69
{
70
"id": "6",
71
"name": "Define the Opportunity",
72
parent: "1",
73
"progressValue": "27%",
74
"actualStart": 951696000000,
75
"actualEnd": 951782400000
76
},
77
{
78
"id": "7",
79
"name": "Research the market and competition",
80
parent: "6",
81
"progressValue": "0%",
82
"actualStart": 951523200000,
83
"actualEnd": 951609600000,
84
"connectTo": "8",
85
"connectorType": "FinishStart"
86
}
87
];
88
}