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