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